aboutsummaryrefslogtreecommitdiffstats
path: root/common/placer1.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-01-30 16:36:01 +0000
committerDavid Shah <dave@ds0.me>2019-03-22 10:31:54 +0000
commit70a6379bf65352a62053a70ccfaa6c73898103ed (patch)
tree7374c922b6a53475fcd364829229a7215796f8c8 /common/placer1.cc
parent87edf6305f1e5e2553e239346877a9aa030d3afe (diff)
downloadnextpnr-70a6379bf65352a62053a70ccfaa6c73898103ed.tar.gz
nextpnr-70a6379bf65352a62053a70ccfaa6c73898103ed.tar.bz2
nextpnr-70a6379bf65352a62053a70ccfaa6c73898103ed.zip
HeAP: Chain support
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common/placer1.cc')
-rw-r--r--common/placer1.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/placer1.cc b/common/placer1.cc
index 368d9dde..9b4b066e 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -475,9 +475,11 @@ class SAPlacer
{
static const double epsilon = 1e-20;
moveChange.reset();
+ if (is_constrained(cell))
+ return false;
BelId oldBel = cell->bel;
CellInfo *other_cell = ctx->getBoundBelCell(newBel);
- if (other_cell != nullptr && other_cell->belStrength > STRENGTH_WEAK) {
+ if (other_cell != nullptr && (is_constrained(other_cell) || other_cell->belStrength > STRENGTH_WEAK)) {
return false;
}
int old_dist = get_constraints_distance(ctx, cell);
@@ -529,6 +531,11 @@ class SAPlacer
goto swap_fail;
}
commit_cost_changes(moveChange);
+#if 0
+ log_info("swap %s -> %s\n", cell->name.c_str(ctx), ctx->getBelName(newBel).c_str(ctx));
+ if (other_cell != nullptr)
+ log_info("swap %s -> %s\n", other_cell->name.c_str(ctx), ctx->getBelName(oldBel).c_str(ctx));
+#endif
return true;
swap_fail:
ctx->bindBel(oldBel, cell, STRENGTH_WEAK);
@@ -547,6 +554,9 @@ class SAPlacer
BelId swap_cell_bels(CellInfo *cell, BelId newBel)
{
BelId oldBel = cell->bel;
+#if 0
+ log_info("%s old: %s new: %s\n", cell->name.c_str(ctx), ctx->getBelName(cell->bel).c_str(ctx), ctx->getBelName(newBel).c_str(ctx));
+#endif
CellInfo *bound = ctx->getBoundBelCell(newBel);
if (bound != nullptr)
ctx->unbindBel(newBel);