aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-29 13:28:06 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-29 13:28:06 +0200
commit1aa4be770cf2162a617551bfbf76e371657cc8fe (patch)
tree13df224e1ea836d2ae0935f576edb3c9aae80a82 /common
parentb5f473cd7a7412eb41e39cdf0b06dbcb6e4c137b (diff)
downloadnextpnr-1aa4be770cf2162a617551bfbf76e371657cc8fe.tar.gz
nextpnr-1aa4be770cf2162a617551bfbf76e371657cc8fe.tar.bz2
nextpnr-1aa4be770cf2162a617551bfbf76e371657cc8fe.zip
Make single-cell placer less likely to get stuck
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/place_common.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/place_common.cc b/common/place_common.cc
index 12345a89..95faf67f 100644
--- a/common/place_common.cc
+++ b/common/place_common.cc
@@ -119,16 +119,16 @@ bool place_single_cell(Context *ctx, CellInfo *cell, bool require_legality)
if (ctx->getBelType(bel) == targetType && (!require_legality || ctx->isValidBelForCell(cell, bel))) {
if (ctx->checkBelAvail(bel)) {
wirelen_t wirelen = get_cell_wirelength_at_bel(ctx, cell, bel);
- if (wirelen == 0)
- wirelen = ctx->rng(100);
+ if (iters >= 4)
+ wirelen += ctx->rng(25);
if (wirelen <= best_wirelen) {
best_wirelen = wirelen;
best_bel = bel;
}
} else {
wirelen_t wirelen = get_cell_wirelength_at_bel(ctx, cell, bel);
- if (wirelen == 0)
- wirelen = ctx->rng(100);
+ if (iters >= 4)
+ wirelen += ctx->rng(25);
if (wirelen <= best_ripup_wirelen) {
ripup_target = ctx->cells.at(ctx->getBoundBelCell(bel)).get();
if (ripup_target->belStrength < STRENGTH_STRONG) {