aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-07-21 16:45:46 +0200
committerDavid Shah <davey1576@gmail.com>2018-07-21 16:45:46 +0200
commit80097526eef823a475d3cc0955721ffe13d995be (patch)
tree7df520b826bbba98a3e7d1843faa9496868c027d /common
parent13339c035542e717428d870d1ba5c2be05b32f5d (diff)
downloadnextpnr-80097526eef823a475d3cc0955721ffe13d995be.tar.gz
nextpnr-80097526eef823a475d3cc0955721ffe13d995be.tar.bz2
nextpnr-80097526eef823a475d3cc0955721ffe13d995be.zip
Fix placement bug with VexRiscV reported by John McMaster
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/place_common.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/place_common.cc b/common/place_common.cc
index b2f0e849..370eff23 100644
--- a/common/place_common.cc
+++ b/common/place_common.cc
@@ -130,10 +130,11 @@ bool place_single_cell(Context *ctx, CellInfo *cell, bool require_legality)
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) {
+ CellInfo *curr_cell = ctx->cells.at(ctx->getBoundBelCell(bel)).get();
+ if (curr_cell->belStrength < STRENGTH_STRONG) {
best_ripup_wirelen = wirelen;
ripup_bel = bel;
+ ripup_target = curr_cell;
}
}
}