Add placement sanity check in placer_heap.

Also check return of placer1_refine.

Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
Keith Rothman 2021-02-26 11:26:52 -08:00
parent 396af7470b
commit 7878561970

View File

@ -321,7 +321,27 @@ class HeAPPlacer
ctx->check(); 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; return true;
} }