diff options
author | David Shah <davey1576@gmail.com> | 2018-08-03 17:07:26 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-08-03 17:07:26 +0200 |
commit | 03c2d22ffff6943e072c8a95d454917d5dab4b0d (patch) | |
tree | db0e9021bf34f85447d67fd5543bdc24833b518c | |
parent | dc4ab55b27a2ada341b060bfe12dade99bf94daf (diff) | |
download | nextpnr-03c2d22ffff6943e072c8a95d454917d5dab4b0d.tar.gz nextpnr-03c2d22ffff6943e072c8a95d454917d5dab4b0d.tar.bz2 nextpnr-03c2d22ffff6943e072c8a95d454917d5dab4b0d.zip |
place_common: Fixing accidental chain breakage
Signed-off-by: David Shah <davey1576@gmail.com>
-rw-r--r-- | common/place_common.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/common/place_common.cc b/common/place_common.cc index 11823360..c41f0b4e 100644 --- a/common/place_common.cc +++ b/common/place_common.cc @@ -155,6 +155,8 @@ bool place_single_cell(Context *ctx, CellInfo *cell, bool require_legality) } else { all_placed = true; } + if (ctx->verbose) + log_info(" placed single cell '%s' at '%s'\n", cell->name.c_str(ctx), ctx->getBelName(best_bel).c_str(ctx)); ctx->bindBel(best_bel, cell->name, STRENGTH_WEAK); cell = ripup_target; @@ -166,7 +168,7 @@ class ConstraintLegaliseWorker { private: Context *ctx; - std::vector<CellInfo *> rippedCells; + std::set<IdString> rippedCells; std::unordered_map<IdString, Loc> oldLocations; class IncreasingDiameterSearch { @@ -380,10 +382,11 @@ class ConstraintLegaliseWorker ctx->getBelName(confl_cell->bel).c_str(ctx)); NPNR_ASSERT(confl_cell->belStrength < STRENGTH_STRONG); ctx->unbindBel(target); - rippedCells.push_back(confl_cell); + rippedCells.insert(conflicting); } } ctx->bindBel(target, cp.first, STRENGTH_LOCKED); + rippedCells.erase(cp.first); } NPNR_ASSERT(constraints_satisfied(cell)); return true; @@ -438,10 +441,10 @@ class ConstraintLegaliseWorker } } for (auto rippedCell : rippedCells) { - bool res = place_single_cell(ctx, rippedCell, true); + bool res = place_single_cell(ctx, ctx->cells.at(rippedCell).get(), true); if (!res) { log_error("failed to place cell '%s' after relative constraint legalisation\n", - rippedCell->name.c_str(ctx)); + rippedCell.c_str(ctx)); return false; } } |