aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-07-30 19:19:30 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2018-07-30 21:51:30 -0700
commita82f6f410595de26e82eaf4818e41036f0bc2f9c (patch)
tree22620c1be70ce79387d8309ccb46aceb295db0fa /common
parente4b044da52ce7d8fed2e461bec09c86cb293566d (diff)
downloadnextpnr-a82f6f410595de26e82eaf4818e41036f0bc2f9c.tar.gz
nextpnr-a82f6f410595de26e82eaf4818e41036f0bc2f9c.tar.bz2
nextpnr-a82f6f410595de26e82eaf4818e41036f0bc2f9c.zip
Modify predictDelay signature
Diffstat (limited to 'common')
-rw-r--r--common/nextpnr.cc2
-rw-r--r--common/place_common.cc8
2 files changed, 4 insertions, 6 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc
index 5b0a45ed..4a97bd93 100644
--- a/common/nextpnr.cc
+++ b/common/nextpnr.cc
@@ -111,7 +111,7 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const
if (cursor == src_wire)
return delay + getWireDelay(src_wire).maxDelay();
- return predictDelay(src_wire, dst_wire);
+ return predictDelay(net_info, net_info->users[user_idx]);
}
static uint32_t xorshift32(uint32_t x)
diff --git a/common/place_common.cc b/common/place_common.cc
index b7ea84f8..3c19a733 100644
--- a/common/place_common.cc
+++ b/common/place_common.cc
@@ -37,10 +37,9 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type
return 0;
driver_gb = ctx->getBelGlobalBuf(driver_cell->bel);
driver_loc = ctx->getBelLocation(driver_cell->bel);
- WireId drv_wire = ctx->getBelPinWire(driver_cell->bel, ctx->portPinFromId(net->driver.port));
if (driver_gb)
return 0;
- float worst_slack = 1000;
+ delay_t worst_slack = std::numeric_limits<delay_t>::max();
int xmin = driver_loc.x, xmax = driver_loc.x, ymin = driver_loc.y, ymax = driver_loc.y;
for (auto load : net->users) {
if (load.cell == nullptr)
@@ -49,9 +48,8 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type
if (load_cell->bel == BelId())
continue;
if (ctx->timing_driven && type == MetricType::COST) {
- WireId user_wire = ctx->getBelPinWire(load_cell->bel, ctx->portPinFromId(load.port));
- delay_t raw_wl = ctx->estimateDelay(drv_wire, user_wire);
- float slack = ctx->getDelayNS(load.budget) - ctx->getDelayNS(raw_wl);
+ delay_t net_delay = ctx->predictDelay(net, load);
+ auto slack = load.budget - net_delay;
if (slack < 0)
tns += slack;
worst_slack = std::min(slack, worst_slack);