aboutsummaryrefslogtreecommitdiffstats
path: root/common/placer1.cc
diff options
context:
space:
mode:
authorEddie Hung <e.hung@imperial.ac.uk>2018-07-21 01:59:16 -0700
committerEddie Hung <e.hung@imperial.ac.uk>2018-07-21 01:59:16 -0700
commit3eecccc6f7f8c36994e9227adfc8ab1067ea287f (patch)
treec2bbc73959116a0572f75937d89aa84a394e8378 /common/placer1.cc
parentf89115c3e31012859a0981d6bccc8290d35b2d96 (diff)
downloadnextpnr-3eecccc6f7f8c36994e9227adfc8ab1067ea287f.tar.gz
nextpnr-3eecccc6f7f8c36994e9227adfc8ab1067ea287f.tar.bz2
nextpnr-3eecccc6f7f8c36994e9227adfc8ab1067ea287f.zip
Avoid hysteresis preventing placer from stopping
Diffstat (limited to 'common/placer1.cc')
-rw-r--r--common/placer1.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/common/placer1.cc b/common/placer1.cc
index 74a11040..be20c072 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -145,6 +145,7 @@ class SAPlacer
}
int n_no_progress = 0;
+ wirelen_t min_metric = curr_metric;
double avg_metric = curr_metric;
temp = 10000;
@@ -169,6 +170,12 @@ class SAPlacer
try_swap_position(cell, try_bel);
}
}
+
+ if (curr_metric < min_metric) {
+ min_metric = curr_metric;
+ improved = true;
+ }
+
// Heuristic to improve placement on the 8k
if (improved)
n_no_progress = 0;
@@ -222,6 +229,9 @@ class SAPlacer
ctx->shuffle(autoplaced);
assign_budget(ctx);
}
+ else {
+ update_budget(ctx);
+ }
// Recalculate total metric entirely to avoid rounding errors
// accumulating over time
@@ -365,8 +375,8 @@ class SAPlacer
// SA acceptance criterea
if (delta < 0 || (temp > 1e-6 && (ctx->rng() / float(0x3fffffff)) <= std::exp(-delta / temp))) {
n_accept++;
- if (delta < 2)
- improved = true;
+ //if (delta < 2)
+ // improved = true;
} else {
if (other != IdString())
ctx->unbindBel(oldBel);