aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-26 11:26:52 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-26 11:27:43 -0800
commit7878561970d27ff2fed73fe0909fa64320e34bc8 (patch)
treeca0d64bd3496f8b59d791b273c05eb8e898c61a9
parent396af7470b3e6728f88dcc690cac3886ea9101e2 (diff)
downloadnextpnr-7878561970d27ff2fed73fe0909fa64320e34bc8.tar.gz
nextpnr-7878561970d27ff2fed73fe0909fa64320e34bc8.tar.bz2
nextpnr-7878561970d27ff2fed73fe0909fa64320e34bc8.zip
Add placement sanity check in placer_heap.
Also check return of placer1_refine. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
-rw-r--r--common/placer_heap.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/common/placer_heap.cc b/common/placer_heap.cc
index 8a3b427f..df1454e8 100644
--- a/common/placer_heap.cc
+++ b/common/placer_heap.cc
@@ -321,7 +321,27 @@ class HeAPPlacer
ctx->check();
- placer1_refine(ctx, Placer1Cfg(ctx));
+ bool any_bad_placements = false;
+ for (auto bel : ctx->getBels()) {
+ CellInfo *cell = ctx->getBoundBelCell(bel);
+ if (!ctx->isBelLocationValid(bel)) {
+ std::string cell_text = "no cell";
+ if (cell != nullptr)
+ cell_text = std::string("cell '") + ctx->nameOf(cell) + "'";
+ log_warning("post-placement validity check failed for Bel '%s' "
+ "(%s)\n",
+ ctx->nameOfBel(bel), cell_text.c_str());
+ any_bad_placements = true;
+ }
+ }
+
+ if (any_bad_placements) {
+ return false;
+ }
+
+ if (!placer1_refine(ctx, Placer1Cfg(ctx))) {
+ return false;
+ }
return true;
}