diff options
author | David Shah <dave@ds0.me> | 2019-04-08 18:08:26 +0100 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2019-04-08 18:08:26 +0100 |
commit | ad9bc627e670392e52d5e1f1e24106deada6eb8c (patch) | |
tree | 87ddb178db6dc17b11e53ca2a09063b8a319ef13 | |
parent | 65b2a76159ac96a9e89915aca630abfce942482a (diff) | |
download | nextpnr-ad9bc627e670392e52d5e1f1e24106deada6eb8c.tar.gz nextpnr-ad9bc627e670392e52d5e1f1e24106deada6eb8c.tar.bz2 nextpnr-ad9bc627e670392e52d5e1f1e24106deada6eb8c.zip |
placer1: Check correctness of incremental updates with --debug
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r-- | common/placer1.cc | 18 |
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; |