aboutsummaryrefslogtreecommitdiffstats
path: root/common/placer1.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-12-07 20:54:41 +0000
committerDavid Shah <dave@ds0.me>2019-03-22 10:31:28 +0000
commit3938ea41fc00afc441c411c3de0403d4652d08c4 (patch)
treef3d63148f9b44465ea9302f341175a86154ec021 /common/placer1.cc
parent2ef2d2b2cb7cb2e54f8a0d8d5476e361ec5e68ea (diff)
downloadnextpnr-3938ea41fc00afc441c411c3de0403d4652d08c4.tar.gz
nextpnr-3938ea41fc00afc441c411c3de0403d4652d08c4.tar.bz2
nextpnr-3938ea41fc00afc441c411c3de0403d4652d08c4.zip
placer1: Fix cost delta calculation
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common/placer1.cc')
-rw-r--r--common/placer1.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/placer1.cc b/common/placer1.cc
index baddf4eb..fe56b4af 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -431,7 +431,7 @@ class SAPlacer
new_dist += get_constraints_distance(ctx, other_cell);
delta = lambda * (moveChange.timing_delta / last_timing_cost) +
(1 - lambda) * (double(moveChange.wirelen_delta) / last_wirelen_cost);
- delta += (cfg.constraintWeight / temp) * (new_dist - old_dist);
+ delta += (cfg.constraintWeight / temp) * (new_dist - old_dist) / last_wirelen_cost;
n_move++;
// SA acceptance criterea
if (delta < 0 || (temp > 1e-6 && (ctx->rng() / float(0x0fffffff)) <= std::exp(-delta / temp))) {
@@ -578,6 +578,8 @@ class SAPlacer
changed_arcs.clear();
new_net_bounds.clear();
new_arc_costs.clear();
+ wirelen_delta = 0;
+ timing_delta = 0;
}
} moveChange;