aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-08-18 19:04:32 +0100
committerDavid Shah <davey1576@gmail.com>2018-08-18 19:04:32 +0100
commit0b35cb4e60c114b3d84ae39d0462a20085ef2bd4 (patch)
tree90223b0b15e6ced4f73dc2ae0a9b2425f36d2c42 /ecp5/arch.cc
parent72a9a475fad693dd6e96c5fa55d02a8869e97120 (diff)
downloadnextpnr-0b35cb4e60c114b3d84ae39d0462a20085ef2bd4.tar.gz
nextpnr-0b35cb4e60c114b3d84ae39d0462a20085ef2bd4.tar.bz2
nextpnr-0b35cb4e60c114b3d84ae39d0462a20085ef2bd4.zip
ecp5: Flatten bel_to_cell for performance
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5/arch.cc')
-rw-r--r--ecp5/arch.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index fec1011c..d6152e95 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -92,6 +92,8 @@ Arch::Arch(ArchArgs args) : args(args)
if (!package_info)
log_error("Unsupported package '%s' for '%s'.\n", args.package.c_str(), getChipName().c_str());
+
+ bel_to_cell.resize(chip_info->height * chip_info->width * max_loc_bels, nullptr);
}
// -----------------------------------------------------------------------
@@ -436,7 +438,7 @@ DecalXY Arch::getBelDecal(BelId bel) const
decalxy.decal.type = DecalId::TYPE_BEL;
decalxy.decal.location = bel.location;
decalxy.decal.z = bel.index;
- decalxy.decal.active = bel_to_cell.count(bel) && (bel_to_cell.at(bel) != nullptr);
+ decalxy.decal.active = (bel_to_cell.at(getBelFlatIndex(bel)) != nullptr);
return decalxy;
}