aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-08-07 11:01:48 +0200
committerDavid Shah <davey1576@gmail.com>2018-08-07 11:01:48 +0200
commit8553573d2485ac2ec60d1c49949c254e02d35490 (patch)
tree4e511aaa8d0c0999408489f78eedaa890ab546d8 /common
parent4f79b32c96497c107ee6838bcf8a25f65b7c359c (diff)
downloadnextpnr-8553573d2485ac2ec60d1c49949c254e02d35490.tar.gz
nextpnr-8553573d2485ac2ec60d1c49949c254e02d35490.tar.bz2
nextpnr-8553573d2485ac2ec60d1c49949c254e02d35490.zip
place_common: Fix illegal cells left after relative constraint legalisation
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/place_common.cc12
1 files changed, 12 insertions, 0 deletions
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;
}