aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/chipdb.h
diff options
context:
space:
mode:
authorAlessandro Comodi <acomodi@antmicro.com>2021-06-02 09:49:30 +0200
committerAlessandro Comodi <acomodi@antmicro.com>2021-06-11 11:19:01 +0200
commit104536b7aae5970ae1d1e95394f26fbf04603d12 (patch)
tree0f1fad9a952f272e6436456077fe54ba3a7730ea /fpga_interchange/chipdb.h
parent7278d3c0edbc6f92ef4c69d7c5db66e811c7e9c4 (diff)
downloadnextpnr-104536b7aae5970ae1d1e95394f26fbf04603d12.tar.gz
nextpnr-104536b7aae5970ae1d1e95394f26fbf04603d12.tar.bz2
nextpnr-104536b7aae5970ae1d1e95394f26fbf04603d12.zip
interchange: add support for generating BEL clusters
Clustering greatly helps the placer to identify and pack together specific cells at the same site (e.g. LUT+FF), or cells that are chained through dedicated interconnections (e.g. CARRY CHAINS) Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Diffstat (limited to 'fpga_interchange/chipdb.h')
-rw-r--r--fpga_interchange/chipdb.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/fpga_interchange/chipdb.h b/fpga_interchange/chipdb.h
index 155c2bb2..78d9c1c5 100644
--- a/fpga_interchange/chipdb.h
+++ b/fpga_interchange/chipdb.h
@@ -402,6 +402,27 @@ NPNR_PACKED_STRUCT(struct MacroExpansionPOD {
RelSlice<MacroParamMapRulePOD> param_rules;
});
+NPNR_PACKED_STRUCT(struct ClusterCellPortPOD {
+ uint32_t cell;
+ uint32_t port;
+});
+
+NPNR_PACKED_STRUCT(struct ChainablePortPOD {
+ uint32_t cell_source;
+ uint32_t cell_sink;
+ uint32_t bel_source;
+ uint32_t bel_sink;
+ int16_t avg_x_offset;
+ int16_t avg_y_offset;
+});
+
+NPNR_PACKED_STRUCT(struct ClusterPOD {
+ uint32_t name;
+ RelSlice<uint32_t> root_cell_types;
+ RelSlice<ChainablePortPOD> chainable_ports;
+ RelSlice<ClusterCellPortPOD> cluster_cells_map;
+});
+
NPNR_PACKED_STRUCT(struct ChipInfoPOD {
RelPtr<char> name;
RelPtr<char> generator;
@@ -421,6 +442,8 @@ NPNR_PACKED_STRUCT(struct ChipInfoPOD {
RelSlice<MacroPOD> macros;
RelSlice<MacroExpansionPOD> macro_rules;
+ RelSlice<ClusterPOD> clusters;
+
// BEL bucket constids.
RelSlice<int32_t> bel_buckets;
@@ -460,6 +483,11 @@ inline const SiteInstInfoPOD &site_inst_info(const ChipInfoPOD *chip_info, int32
return chip_info->sites[chip_info->tiles[tile].sites[site]];
}
+inline const ClusterPOD &cluster_info(const ChipInfoPOD *chip_info, int32_t cluster)
+{
+ return chip_info->clusters[cluster];
+}
+
enum SyntheticType
{
NOT_SYNTH = 0,