From 7878561970d27ff2fed73fe0909fa64320e34bc8 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Fri, 26 Feb 2021 11:26:52 -0800 Subject: Add placement sanity check in placer_heap. Also check return of placer1_refine. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- common/placer_heap.cc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'common') 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; } -- cgit v1.2.3