diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2018-07-31 19:31:54 -0700 |
---|---|---|
committer | Eddie Hung <eddieh@ece.ubc.ca> | 2018-07-31 19:31:54 -0700 |
commit | f646ec790a79f29d6964f3b7e30088f044b4a4e9 (patch) | |
tree | 5bcbcf52c0a4ee1b0c3aa52cfb829a455be3f368 /common/nextpnr.cc | |
parent | 720e81586502f527cba7b9052b6bfed719c0b165 (diff) | |
download | nextpnr-f646ec790a79f29d6964f3b7e30088f044b4a4e9.tar.gz nextpnr-f646ec790a79f29d6964f3b7e30088f044b4a4e9.tar.bz2 nextpnr-f646ec790a79f29d6964f3b7e30088f044b4a4e9.zip |
Modify the getNetinfo*() functions and getBudgetOverride() to not use
user_idx and to take a PortRef& instead
Diffstat (limited to 'common/nextpnr.cc')
-rw-r--r-- | common/nextpnr.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 4a97bd93..4e15a594 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,13 +87,13 @@ 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 dst_wire = getNetinfoSinkWire(net_info, user_idx); + WireId dst_wire = getNetinfoSinkWire(net_info, user_info); WireId cursor = dst_wire; delay_t delay = 0; @@ -111,7 +110,7 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const if (cursor == src_wire) return delay + getWireDelay(src_wire).maxDelay(); - return predictDelay(net_info, net_info->users[user_idx]); + return predictDelay(net_info, user_info); } static uint32_t xorshift32(uint32_t x) |