aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/placer1.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/placer1.cc b/common/placer1.cc
index d1e315eb..1fbd2a6e 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -291,6 +291,24 @@ class SAPlacer
}
}
+ if (ctx->debug) {
+ // Verify correctness of incremental wirelen updates
+ for (size_t i = 0; i < net_bounds.size(); i++) {
+ auto net = net_by_udata[i];
+ if (ignore_net(net))
+ continue;
+ auto &incr = net_bounds.at(i), gold = get_net_bounds(net);
+ NPNR_ASSERT(incr.x0 == gold.x0);
+ NPNR_ASSERT(incr.x1 == gold.x1);
+ NPNR_ASSERT(incr.y0 == gold.y0);
+ NPNR_ASSERT(incr.y1 == gold.y1);
+ NPNR_ASSERT(incr.nx0 == gold.nx0);
+ NPNR_ASSERT(incr.nx1 == gold.nx1);
+ NPNR_ASSERT(incr.ny0 == gold.ny0);
+ NPNR_ASSERT(incr.ny1 == gold.ny1);
+ }
+ }
+
if (curr_wirelen_cost < min_wirelen) {
min_wirelen = curr_wirelen_cost;
improved = true;