diff options
author | David Shah <davey1576@gmail.com> | 2018-08-03 15:40:01 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-08-03 15:40:01 +0200 |
commit | 8c518cb8388df5b50b3c263d5a36d27851764fe4 (patch) | |
tree | 8807ade618751d1b0adcfb5382ef92662f87d810 | |
parent | 60757a2dd74bdaae6c20f59417a7a2597eb6d3bc (diff) | |
download | nextpnr-8c518cb8388df5b50b3c263d5a36d27851764fe4.tar.gz nextpnr-8c518cb8388df5b50b3c263d5a36d27851764fe4.tar.bz2 nextpnr-8c518cb8388df5b50b3c263d5a36d27851764fe4.zip |
Fixing relative constraint implementation
Signed-off-by: David Shah <davey1576@gmail.com>
-rw-r--r-- | common/place_common.cc | 9 | ||||
-rw-r--r-- | ice40/chains.cc | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/common/place_common.cc b/common/place_common.cc index 9522624e..1d4427ac 100644 --- a/common/place_common.cc +++ b/common/place_common.cc @@ -306,10 +306,18 @@ class ConstraintLegaliseWorker currentLoc = ctx->getBelLocation(cell->bel); if (cell->constr_x == cell->UNCONSTR) xRootSearch = IncreasingDiameterSearch(currentLoc.x, 0, ctx->getGridDimX() - 1); + else + xRootSearch = IncreasingDiameterSearch(cell->constr_x); + if (cell->constr_y == cell->UNCONSTR) yRootSearch = IncreasingDiameterSearch(currentLoc.y, 0, ctx->getGridDimY() - 1); + else + yRootSearch = IncreasingDiameterSearch(cell->constr_y); + if (cell->constr_z == cell->UNCONSTR) zRootSearch = IncreasingDiameterSearch(currentLoc.z, 0, ctx->getTileDimZ(currentLoc.x, currentLoc.y)); + else + zRootSearch = IncreasingDiameterSearch(cell->constr_z); while (!xRootSearch.done()) { Loc rootLoc; rootLoc.x = xRootSearch.get(); @@ -352,6 +360,7 @@ class ConstraintLegaliseWorker } ctx->bindBel(target, cp.first, STRENGTH_LOCKED); } + NPNR_ASSERT(constraints_satisfied(cell)); return true; } } diff --git a/ice40/chains.cc b/ice40/chains.cc index b1ad1007..54e284af 100644 --- a/ice40/chains.cc +++ b/ice40/chains.cc @@ -260,7 +260,8 @@ class ChainConstrainer log_info("Placing carry chain starting at '%s'\n", chain.cells.front()->name.c_str(ctx)); // Place carry chain - chain.cells.at(0)->constr_abs_z = 0; + chain.cells.at(0)->constr_abs_z = true; + chain.cells.at(0)->constr_z = 0; for (int i = 1; i < int(chain.cells.size()); i++) { chain.cells.at(i)->constr_x = 0; chain.cells.at(i)->constr_y = (i / 8); |