diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2018-11-13 12:12:11 -0800 |
---|---|---|
committer | Eddie Hung <eddieh@ece.ubc.ca> | 2018-11-13 12:12:11 -0800 |
commit | 2d39cde17be718d76e6f5c06c8f06c70d44c7918 (patch) | |
tree | 8b0e0f98125b2ec7fdb55c9644c524753a7a1cd5 /common/place_common.cc | |
parent | ba7a7a3733c493fc950d5bedbc49b4c78b451b3d (diff) | |
parent | 3b2b15dc4a6cdf9cadab96b1db5483d4f7082dff (diff) | |
download | nextpnr-2d39cde17be718d76e6f5c06c8f06c70d44c7918.tar.gz nextpnr-2d39cde17be718d76e6f5c06c8f06c70d44c7918.tar.bz2 nextpnr-2d39cde17be718d76e6f5c06c8f06c70d44c7918.zip |
Merge remote-tracking branch 'origin/master' into timingapi
Diffstat (limited to 'common/place_common.cc')
-rw-r--r-- | common/place_common.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/place_common.cc b/common/place_common.cc index da8ab37d..1c262c6f 100644 --- a/common/place_common.cc +++ b/common/place_common.cc @@ -28,19 +28,19 @@ NEXTPNR_NAMESPACE_BEGIN wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type, float &tns) { wirelen_t wirelength = 0; - Loc driver_loc; - bool driver_gb; CellInfo *driver_cell = net->driver.cell; if (!driver_cell) return 0; if (driver_cell->bel == BelId()) return 0; - driver_gb = ctx->getBelGlobalBuf(driver_cell->bel); - driver_loc = ctx->getBelLocation(driver_cell->bel); + bool driver_gb = ctx->getBelGlobalBuf(driver_cell->bel); if (driver_gb) return 0; + IdString clock_port; + 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); 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) @@ -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 (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 { |