aboutsummaryrefslogtreecommitdiffstats
path: root/common/place_common.cc
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-07-31 18:26:39 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2018-07-31 18:26:39 -0700
commit5d58d6ad1b473ed7e3eb59a393a685b7ef219621 (patch)
tree7ea550e34111502879c803f2107bd8a4ecb211bc /common/place_common.cc
parent87438542e51c91fd6bf838d4f2aceb3c79303a72 (diff)
parent8131921e998eda144c85984710ec421f67f18658 (diff)
downloadnextpnr-5d58d6ad1b473ed7e3eb59a393a685b7ef219621.tar.gz
nextpnr-5d58d6ad1b473ed7e3eb59a393a685b7ef219621.tar.bz2
nextpnr-5d58d6ad1b473ed7e3eb59a393a685b7ef219621.zip
Merge branch 'redist_slack' of gitlab.com:SymbioticEDA/nextpnr into redist_slack
Diffstat (limited to 'common/place_common.cc')
-rw-r--r--common/place_common.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/place_common.cc b/common/place_common.cc
index d9d40714..9bc24303 100644
--- a/common/place_common.cc
+++ b/common/place_common.cc
@@ -39,6 +39,8 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type
driver_loc = ctx->getBelLocation(driver_cell->bel);
if (driver_gb)
return 0;
+
+ delay_t negative_slack = 0;
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) {
@@ -51,7 +53,7 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type
delay_t net_delay = ctx->predictDelay(net, load);
auto slack = load.budget - net_delay;
if (slack < 0)
- tns += slack;
+ negative_slack += slack;
worst_slack = std::min(slack, worst_slack);
}
@@ -70,7 +72,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);
+ tns += ctx->getDelayNS(negative_slack);
return wirelength;
}