diff options
Diffstat (limited to 'common/place_common.cc')
-rw-r--r-- | common/place_common.cc | 9 |
1 files changed, 4 insertions, 5 deletions
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; } |