diff options
author | gatecat <gatecat@ds0.me> | 2022-03-04 18:17:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-04 18:17:08 +0000 |
commit | 285325ad5bf60b5230789b9e64b4dc76a406c04d (patch) | |
tree | 4b65cf1e01ca5657bc2625ad252292648d67f64f /fpga_interchange/site_lut_mapping_cache.cc | |
parent | 2c8062bdb396682a558ecbdc574620e4121b7faf (diff) | |
parent | b5d6fc8ed7bc446b1d810c82029e7b327bea5049 (diff) | |
download | nextpnr-285325ad5bf60b5230789b9e64b4dc76a406c04d.tar.gz nextpnr-285325ad5bf60b5230789b9e64b4dc76a406c04d.tar.bz2 nextpnr-285325ad5bf60b5230789b9e64b4dc76a406c04d.zip |
Merge pull request #932 from antmicro/remove-hardcoded-values-from-lut-mapping-cache
interchange: lut map cache: remove hardcoded values
Diffstat (limited to 'fpga_interchange/site_lut_mapping_cache.cc')
-rw-r--r-- | fpga_interchange/site_lut_mapping_cache.cc | 7 |
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; } } |