aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/site_lut_mapping_cache.cc
diff options
context:
space:
mode:
authorAlessandro Comodi <acomodi@antmicro.com>2022-03-04 16:53:03 +0100
committerAlessandro Comodi <acomodi@antmicro.com>2022-03-04 16:53:24 +0100
commitb5d6fc8ed7bc446b1d810c82029e7b327bea5049 (patch)
tree1ea2dc8c8037d46c22cc72dad0a8f2272621ee75 /fpga_interchange/site_lut_mapping_cache.cc
parent2c6ca4836fd30faa5cdbd931a352866e5a04104d (diff)
downloadnextpnr-b5d6fc8ed7bc446b1d810c82029e7b327bea5049.tar.gz
nextpnr-b5d6fc8ed7bc446b1d810c82029e7b327bea5049.tar.bz2
nextpnr-b5d6fc8ed7bc446b1d810c82029e7b327bea5049.zip
interchange: lut map cache: remove hardcoded values
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Diffstat (limited to 'fpga_interchange/site_lut_mapping_cache.cc')
-rw-r--r--fpga_interchange/site_lut_mapping_cache.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/fpga_interchange/site_lut_mapping_cache.cc b/fpga_interchange/site_lut_mapping_cache.cc
index 0cf741f2..b7a71397 100644
--- a/fpga_interchange/site_lut_mapping_cache.cc
+++ b/fpga_interchange/site_lut_mapping_cache.cc
@@ -58,6 +58,7 @@ SiteLutMappingKey SiteLutMappingKey::create(const SiteInformation &siteInfo)
key.tileType = siteInfo.tile_type;
key.siteType = ctx->chip_info->sites[siteInfo.site].site_type;
key.numCells = 0;
+ key.cells.resize(ctx->max_lut_cells);
// Get bound nets. Store localized (to the LUT cluster) net indices only
// to get always the same key for the same LUT port configuration even
@@ -65,13 +66,13 @@ SiteLutMappingKey SiteLutMappingKey::create(const SiteInformation &siteInfo)
dict<IdString, int32_t> netMap;
for (CellInfo *cellInfo : lutCells) {
- NPNR_ASSERT(key.numCells < SiteLutMappingKey::MAX_LUT_CELLS);
+ NPNR_ASSERT(key.numCells < key.cells.size());
auto &cell = key.cells[key.numCells++];
cell.type = cellInfo->type;
cell.belIndex = cellInfo->bel.index;
- cell.conns.fill(0);
+ cell.conns.resize(ctx->max_lut_pins, 0);
size_t portId = 0;
for (const auto &port : cellInfo->ports) {
@@ -96,7 +97,7 @@ SiteLutMappingKey SiteLutMappingKey::create(const SiteInformation &siteInfo)
}
}
- NPNR_ASSERT(portId < SiteLutMappingKey::MAX_LUT_INPUTS);
+ NPNR_ASSERT(portId < cell.conns.size());
cell.conns[portId++] = netId;
}
}