place_common: Fix illegal cells left after relative constraint legalisation

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-08-07 11:01:48 +02:00
parent 4f79b32c96
commit 8553573d24

View File

@ -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;
}