From c65ba121e00a17c344f154e0335d1c2358a1393d Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Thu, 25 Feb 2021 09:19:09 -0800 Subject: Prevent trival misplacements in placer1. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- common/placer1.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/placer1.cc b/common/placer1.cc index 837010fe..619bfbc8 100644 --- a/common/placer1.cc +++ b/common/placer1.cc @@ -518,6 +518,13 @@ class SAPlacer old_dist += get_constraints_distance(ctx, other_cell); double delta = 0; + if (!ctx->isValidBelForCellType(cell->type, newBel)) { + return false; + } + if (other_cell != nullptr && !ctx->isValidBelForCellType(other_cell->type, oldBel)) { + return false; + } + int net_delta_score = 0; if (cfg.netShareWeight > 0) net_delta_score += update_nets_by_tile(cell, ctx->getBelLocation(cell->bel), ctx->getBelLocation(newBel)); @@ -655,6 +662,11 @@ class SAPlacer if (bound != nullptr && !cells.count(bound->name) && (bound->belStrength >= STRENGTH_STRONG || bound->isConstrained(false))) return false; + + if (bound != nullptr) + if (!ctx->isValidBelForCellType(bound->type, cr.first->bel)) + return false; + dest_bels.emplace_back(std::make_pair(cr.first, targetBel)); } #if 0 -- cgit v1.2.3