From 51956eb9617300a892d78619234f0f9f36c2cfb4 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 31 Jul 2018 16:23:35 -0700 Subject: Fix tns computation --- common/place_common.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/place_common.cc') diff --git a/common/place_common.cc b/common/place_common.cc index 3c19a733..31f15721 100644 --- a/common/place_common.cc +++ b/common/place_common.cc @@ -39,6 +39,7 @@ 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::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 +52,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 +71,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; } -- cgit v1.2.3