aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-09-18 11:11:16 +0100
committergatecat <gatecat@ds0.me>2021-09-18 11:11:24 +0100
commite926cddca274423ea414e61a07deb785ee63c92d (patch)
tree625cce74b394d7da5a0662d2be4f285143737c92
parent4730a4f33987e9bd522a1231e3908dabf389a68d (diff)
downloadnextpnr-e926cddca274423ea414e61a07deb785ee63c92d.tar.gz
nextpnr-e926cddca274423ea414e61a07deb785ee63c92d.tar.bz2
nextpnr-e926cddca274423ea414e61a07deb785ee63c92d.zip
placer1: Fix cluster swap cost updates
Signed-off-by: gatecat <gatecat@ds0.me>
-rw-r--r--common/placer1.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/common/placer1.cc b/common/placer1.cc
index 323d0f95..efa8a674 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -687,10 +687,6 @@ class SAPlacer
#endif
ctx->unbindBel(bound->bel);
ctx->bindBel(old_bel, bound, STRENGTH_WEAK);
- add_move_cell(moveChange, bound, moved_cells.at(bound->name));
- if (cfg.netShareWeight > 0)
- update_nets_by_tile(bound, ctx->getBelLocation(moved_cells.at(bound->name)),
- ctx->getBelLocation(old_bel));
}
} else if (!ctx->checkBelAvail(db.second)) {
goto swap_fail;
@@ -700,15 +696,15 @@ class SAPlacer
log_info("%d bind %s %s\n", __LINE__, ctx->nameOfBel(db.second), ctx->nameOf(db.first));
#endif
ctx->bindBel(db.second, db.first, STRENGTH_WEAK);
- add_move_cell(moveChange, db.first, moved_cells.at(db.first->name));
- if (cfg.netShareWeight > 0)
- update_nets_by_tile(db.first, ctx->getBelLocation(moved_cells.at(db.first->name)),
- ctx->getBelLocation(db.second));
}
}
for (const auto &mm : moved_cells) {
CellInfo *cell = ctx->cells.at(mm.first).get();
+ add_move_cell(moveChange, cell, moved_cells.at(cell->name));
+ if (cfg.netShareWeight > 0)
+ update_nets_by_tile(cell, ctx->getBelLocation(moved_cells.at(cell->name)),
+ ctx->getBelLocation(cell->bel));
if (!ctx->isBelLocationValid(cell->bel) || !cell->testRegion(cell->bel))
goto swap_fail;
}