aboutsummaryrefslogtreecommitdiffstats
path: root/common/place_common.cc
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-11-13 09:26:28 -0800
committerEddie Hung <eddieh@ece.ubc.ca>2018-11-13 09:26:28 -0800
commit7402a4b95547bc802b6fa3e76844b35097d7e33d (patch)
treec750d6af853e1a44eec9df7c9bcfbc389895cae0 /common/place_common.cc
parent78b684bcf88b52282fe06b01e0961b67984df847 (diff)
downloadnextpnr-7402a4b95547bc802b6fa3e76844b35097d7e33d.tar.gz
nextpnr-7402a4b95547bc802b6fa3e76844b35097d7e33d.tar.bz2
nextpnr-7402a4b95547bc802b6fa3e76844b35097d7e33d.zip
[placer1] Tidy up logic
Diffstat (limited to 'common/place_common.cc')
-rw-r--r--common/place_common.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/place_common.cc b/common/place_common.cc
index 95343dc0..1c262c6f 100644
--- a/common/place_common.cc
+++ b/common/place_common.cc
@@ -37,7 +37,7 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type
if (driver_gb)
return 0;
IdString clock_port;
- bool driver_tmg_ignore = ctx->getPortTimingClass(driver_cell, net->driver.port, clock_port) == TMG_IGNORE;
+ bool timing_driven = ctx->timing_driven && type == MetricType::COST && ctx->getPortTimingClass(driver_cell, net->driver.port, clock_port) != TMG_IGNORE;
delay_t negative_slack = 0;
delay_t worst_slack = std::numeric_limits<delay_t>::max();
Loc driver_loc = ctx->getBelLocation(driver_cell->bel);
@@ -48,7 +48,7 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type
CellInfo *load_cell = load.cell;
if (load_cell->bel == BelId())
continue;
- if (!driver_tmg_ignore && ctx->timing_driven && type == MetricType::COST) {
+ if (timing_driven) {
delay_t net_delay = ctx->predictDelay(net, load);
auto slack = load.budget - net_delay;
if (slack < 0)
@@ -65,7 +65,7 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type
xmax = std::max(xmax, load_loc.x);
ymax = std::max(ymax, load_loc.y);
}
- if (ctx->timing_driven && type == MetricType::COST) {
+ if (timing_driven) {
wirelength = wirelen_t(
(((ymax - ymin) + (xmax - xmin)) * std::min(5.0, (1.0 + std::exp(-ctx->getDelayNS(worst_slack) / 5)))));
} else {