aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-02-27 11:57:36 +0000
committerDavid Shah <dave@ds0.me>2019-03-22 10:31:54 +0000
commitfcc3bb14959e96073f736050f4085b42589ea9a7 (patch)
tree164d50383fadcbda408a49340dfef1e85add54a3 /ecp5/arch.cc
parentf8a38c59f89b5f432dbd968ac577a4190cec7358 (diff)
downloadnextpnr-fcc3bb14959e96073f736050f4085b42589ea9a7.tar.gz
nextpnr-fcc3bb14959e96073f736050f4085b42589ea9a7.tar.bz2
nextpnr-fcc3bb14959e96073f736050f4085b42589ea9a7.zip
ecp5: Speedup cell delay lookups
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/arch.cc')
-rw-r--r--ecp5/arch.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index 938b5f8e..d4b53f47 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -620,6 +620,11 @@ DecalXY Arch::getGroupDecal(GroupId pip) const { return {}; };
bool Arch::getDelayFromTimingDatabase(IdString tctype, IdString from, IdString to, DelayInfo &delay) const
{
+ auto fnd_dk = celldelay_cache.find({tctype, from, to});
+ if (fnd_dk != celldelay_cache.end()) {
+ delay = fnd_dk->second.second;
+ return fnd_dk->second.first;
+ }
for (int i = 0; i < speed_grade->num_cell_timings; i++) {
const auto &tc = speed_grade->cell_timings[i];
if (tc.cell_type == tctype.index) {
@@ -628,9 +633,11 @@ bool Arch::getDelayFromTimingDatabase(IdString tctype, IdString from, IdString t
if (dly.from_port == from.index && dly.to_port == to.index) {
delay.max_delay = dly.max_delay;
delay.min_delay = dly.min_delay;
+ celldelay_cache[{tctype, from, to}] = std::make_pair(true, delay);
return true;
}
}
+ celldelay_cache[{tctype, from, to}] = std::make_pair(false, DelayInfo());
return false;
}
}
@@ -660,7 +667,6 @@ void Arch::getSetupHoldFromTimingDatabase(IdString tctype, IdString clock, IdStr
bool Arch::getCellDelay(const CellInfo *cell, IdString fromPort, IdString toPort, DelayInfo &delay) const
{
-
// Data for -8 grade
if (cell->type == id_TRELLIS_SLICE) {
bool has_carry = cell->sliceInfo.is_carry;