From e926cddca274423ea414e61a07deb785ee63c92d Mon Sep 17 00:00:00 2001 From: gatecat Date: Sat, 18 Sep 2021 11:11:16 +0100 Subject: placer1: Fix cluster swap cost updates Signed-off-by: gatecat --- common/placer1.cc | 12 ++++-------- 1 file 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; } -- cgit v1.2.3