diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2018-07-30 19:19:30 -0700 |
---|---|---|
committer | Eddie Hung <eddieh@ece.ubc.ca> | 2018-07-30 21:51:30 -0700 |
commit | a82f6f410595de26e82eaf4818e41036f0bc2f9c (patch) | |
tree | 22620c1be70ce79387d8309ccb46aceb295db0fa /generic | |
parent | e4b044da52ce7d8fed2e461bec09c86cb293566d (diff) | |
download | nextpnr-a82f6f410595de26e82eaf4818e41036f0bc2f9c.tar.gz nextpnr-a82f6f410595de26e82eaf4818e41036f0bc2f9c.tar.bz2 nextpnr-a82f6f410595de26e82eaf4818e41036f0bc2f9c.zip |
Modify predictDelay signature
Diffstat (limited to 'generic')
-rw-r--r-- | generic/arch.cc | 12 | ||||
-rw-r--r-- | generic/arch.h | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/generic/arch.cc b/generic/arch.cc index 8ef37716..4469a828 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -403,12 +403,14 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return (dx + dy) * grid_distance_to_delay; } -delay_t Arch::predictDelay(WireId src, WireId dst) const +delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const; { - const WireInfo &s = wires.at(src); - const WireInfo &d = wires.at(dst); - int dx = abs(s.x - d.x); - int dy = abs(s.y - d.y); + const auto& driver = net_info->driver; + auto driver_loc = getBelLocation(driver.cell->bel); + auto sink_loc = getBelLocation(sink.cell->bel); + + int dx = abs(driver_loc.x - driver_loc.x); + int dy = abs(sink_loc.y - sink_locy); return (dx + dy) * grid_distance_to_delay; } diff --git a/generic/arch.h b/generic/arch.h index 60220fbe..f02649f6 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -194,7 +194,7 @@ struct Arch : BaseCtx const std::vector<GroupId> &getGroupGroups(GroupId group) const; delay_t estimateDelay(WireId src, WireId dst) const; - delay_t predictDelay(WireId src, WireId dst) const; + delay_t predictDelay(const NetInfo *net_info, const PortRef &sink) const; delay_t getDelayEpsilon() const { return 0.01; } delay_t getRipupDelayPenalty() const { return 1.0; } float getDelayNS(delay_t v) const { return v; } |