diff options
author | David Shah <davey1576@gmail.com> | 2018-08-03 17:42:07 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-08-03 17:42:07 +0200 |
commit | aa8435df218de50825bdcbcfe4ee88f26c3ff836 (patch) | |
tree | 63722a17286b18c838416f4325b20b78a04eb533 /common | |
parent | 03c2d22ffff6943e072c8a95d454917d5dab4b0d (diff) | |
download | nextpnr-aa8435df218de50825bdcbcfe4ee88f26c3ff836.tar.gz nextpnr-aa8435df218de50825bdcbcfe4ee88f26c3ff836.tar.bz2 nextpnr-aa8435df218de50825bdcbcfe4ee88f26c3ff836.zip |
placer1: Experiment with adding 'constraint distance' metric
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/placer1.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/common/placer1.cc b/common/placer1.cc index 601a0245..673e304f 100644 --- a/common/placer1.cc +++ b/common/placer1.cc @@ -348,6 +348,10 @@ private: if (other_cell->belStrength > STRENGTH_WEAK) return false; } + int old_dist = get_constraints_distance(ctx, cell); + int new_dist; + if (other != IdString()) + old_dist += get_constraints_distance(ctx, other_cell); wirelen_t new_metric = 0, delta; ctx->unbindBel(oldBel); if (other != IdString()) { @@ -386,7 +390,12 @@ private: new_metric += net_new_wl; new_lengths.push_back(std::make_pair(net->name, net_new_wl)); } + + new_dist = get_constraints_distance(ctx, cell); + if (other != IdString()) + new_dist += get_constraints_distance(ctx, other_cell); delta = new_metric - curr_metric; + delta += (1 / temp) * (new_dist - old_dist); n_move++; // SA acceptance criterea if (delta < 0 || (temp > 1e-6 && (ctx->rng() / float(0x3fffffff)) <= std::exp(-delta / temp))) { @@ -447,8 +456,8 @@ private: std::unordered_set<BelId> locked_bels; bool require_legal = false; const float legalise_temp = 1; - const float post_legalise_temp = 20; - const float post_legalise_dia_scale = 2; + const float post_legalise_temp = 10; + const float post_legalise_dia_scale = 1.5; }; bool placer1(Context *ctx) |