aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-07-31 16:18:08 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2018-07-31 16:18:08 -0700
commit2d750537441b91a6e8bc5bf757279afc89265fb2 (patch)
treefd3316769be53f9828eed36d7098e7bfaf7025ee /common
parent2a91aea0a6d17f6d00edb391cc543ec9409e96e5 (diff)
parenta82f6f410595de26e82eaf4818e41036f0bc2f9c (diff)
downloadnextpnr-2d750537441b91a6e8bc5bf757279afc89265fb2.tar.gz
nextpnr-2d750537441b91a6e8bc5bf757279afc89265fb2.tar.bz2
nextpnr-2d750537441b91a6e8bc5bf757279afc89265fb2.zip
Merge remote-tracking branch 'origin/estdelay' into redist_slack
Conflicts: ecp5/arch.cc generic/arch.cc ice40/arch.cc
Diffstat (limited to 'common')
-rw-r--r--common/nextpnr.cc10
-rw-r--r--common/place_common.cc9
2 files changed, 9 insertions, 10 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc
index cf1b5982..4a97bd93 100644
--- a/common/nextpnr.cc
+++ b/common/nextpnr.cc
@@ -93,7 +93,9 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) 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_idx);
+ WireId cursor = dst_wire;
delay_t delay = 0;
while (cursor != WireId() && cursor != src_wire) {
@@ -107,11 +109,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, 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 5673c847..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);
@@ -72,6 +70,7 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type
wirelength = wirelen_t((ymax - ymin) + (xmax - xmin));
}
+ tns = ctx->getDelayNS(tns);
return wirelength;
}