From 200fb3f6646a20fb5b3bca6d66964417f477689c Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Sat, 10 Nov 2018 20:05:36 -0800 Subject: [placer1] Ignore timing of TMG_IGNORE nets --- common/place_common.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/place_common.cc b/common/place_common.cc index da8ab37d..4810697c 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 driver_tmg_ignore = ctx->getPortTimingClass(driver_cell, net->driver.port, clock_port); delay_t negative_slack = 0; delay_t worst_slack = std::numeric_limits::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 (!driver_tmg_ignore && ctx->timing_driven && type == MetricType::COST) { delay_t net_delay = ctx->predictDelay(net, load); auto slack = load.budget - net_delay; if (slack < 0) -- cgit v1.2.3 From 78b684bcf88b52282fe06b01e0961b67984df847 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Sat, 10 Nov 2018 22:30:35 -0800 Subject: [placer1] Actually check for TMG_IGNORE! --- common/place_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/place_common.cc b/common/place_common.cc index 4810697c..95343dc0 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); + bool driver_tmg_ignore = ctx->getPortTimingClass(driver_cell, net->driver.port, clock_port) == TMG_IGNORE; delay_t negative_slack = 0; delay_t worst_slack = std::numeric_limits::max(); Loc driver_loc = ctx->getBelLocation(driver_cell->bel); -- cgit v1.2.3 From 7402a4b95547bc802b6fa3e76844b35097d7e33d Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 13 Nov 2018 09:26:28 -0800 Subject: [placer1] Tidy up logic --- common/place_common.cc | 6 +++--- 1 file 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::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 { -- cgit v1.2.3