From 3938ea41fc00afc441c411c3de0403d4652d08c4 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 7 Dec 2018 20:54:41 +0000 Subject: [PATCH] placer1: Fix cost delta calculation Signed-off-by: David Shah --- common/placer1.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;