From 8553573d2485ac2ec60d1c49949c254e02d35490 Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 7 Aug 2018 11:01:48 +0200 Subject: place_common: Fix illegal cells left after relative constraint legalisation Signed-off-by: David Shah --- common/place_common.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'common') diff --git a/common/place_common.cc b/common/place_common.cc index 6e513aef..fe9cf03d 100644 --- a/common/place_common.cc +++ b/common/place_common.cc @@ -375,6 +375,18 @@ class ConstraintLegaliseWorker ctx->bindBel(target, ctx->cells.at(cp.first).get(), STRENGTH_LOCKED); rippedCells.erase(cp.first); } + for (auto cp : solution) { + for (auto bel : ctx->getBelsByTile(cp.second.x, cp.second.y)) { + CellInfo *belCell = ctx->getBoundBelCell(bel); + if (belCell != nullptr && !solution.count(belCell->name)) { + if (!ctx->isValidBelForCell(belCell, bel)) { + NPNR_ASSERT(belCell->belStrength < STRENGTH_STRONG); + ctx->unbindBel(bel); + rippedCells.insert(belCell->name); + } + } + } + } NPNR_ASSERT(constraints_satisfied(cell)); return true; } -- cgit v1.2.3