diff options
author | David Shah <davey1576@gmail.com> | 2018-08-01 05:59:34 +0000 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-08-01 05:59:34 +0000 |
commit | b1a99789224774f640558b7b26fd2385b4f249db (patch) | |
tree | 5fb3aa360c2d0e4e625e4deafcc10f36d6420f9f /common/nextpnr.cc | |
parent | 474aa3470abb9a9bbbae137574542a6e5ac190a0 (diff) | |
parent | 94161e646d0384bde9401d3dbd1a76244abd9d23 (diff) | |
download | nextpnr-b1a99789224774f640558b7b26fd2385b4f249db.tar.gz nextpnr-b1a99789224774f640558b7b26fd2385b4f249db.tar.bz2 nextpnr-b1a99789224774f640558b7b26fd2385b4f249db.zip |
Merge branch 'redist_slack' into 'master'
Update budgets throughout placement and routing
See merge request SymbioticEDA/nextpnr!16
Diffstat (limited to 'common/nextpnr.cc')
-rw-r--r-- | common/nextpnr.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc index cf1b5982..dbea26d8 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -51,7 +51,7 @@ void IdString::initialize_add(const BaseCtx *ctx, const char *s, int idx) ctx->idstring_idx_to_str->push_back(&insert_rc.first->first); } -WireId Context::getNetinfoSourceWire(NetInfo *net_info) const +WireId Context::getNetinfoSourceWire(const NetInfo *net_info) const { if (net_info->driver.cell == nullptr) return WireId(); @@ -70,9 +70,8 @@ WireId Context::getNetinfoSourceWire(NetInfo *net_info) const return getBelPinWire(src_bel, portPinFromId(driver_port)); } -WireId Context::getNetinfoSinkWire(NetInfo *net_info, int user_idx) const +WireId Context::getNetinfoSinkWire(const NetInfo *net_info, const PortRef &user_info) const { - auto &user_info = net_info->users[user_idx]; auto dst_bel = user_info.cell->bel; if (dst_bel == BelId()) @@ -88,12 +87,14 @@ WireId Context::getNetinfoSinkWire(NetInfo *net_info, int user_idx) const return getBelPinWire(dst_bel, portPinFromId(user_port)); } -delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const +delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef &user_info) const { WireId src_wire = getNetinfoSourceWire(net_info); if (src_wire == WireId()) return 0; - WireId cursor = getNetinfoSinkWire(net_info, user_idx); + + WireId dst_wire = getNetinfoSinkWire(net_info, user_info); + WireId cursor = dst_wire; delay_t delay = 0; while (cursor != WireId() && cursor != src_wire) { @@ -107,11 +108,9 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const } if (cursor == src_wire) - delay += getWireDelay(src_wire).maxDelay(); - else - delay += estimateDelay(src_wire, cursor); + return delay + getWireDelay(src_wire).maxDelay(); - return delay; + return predictDelay(net_info, user_info); } static uint32_t xorshift32(uint32_t x) |