aboutsummaryrefslogtreecommitdiffstats
path: root/common/router2.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-30 09:14:46 +0100
committergatecat <gatecat@ds0.me>2021-07-30 09:14:46 +0100
commitb5a31d2e4e1d9097db543faf4374f5f0c10e6855 (patch)
tree4dd486ad92717e6f4837e5977380a1c1ae87cbe5 /common/router2.cc
parent42f48b6dc0042d56a896514fe2421486ffdc359e (diff)
downloadnextpnr-b5a31d2e4e1d9097db543faf4374f5f0c10e6855.tar.gz
nextpnr-b5a31d2e4e1d9097db543faf4374f5f0c10e6855.tar.bz2
nextpnr-b5a31d2e4e1d9097db543faf4374f5f0c10e6855.zip
router2: Mark dest as visited during backwards routing
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/router2.cc')
-rw-r--r--common/router2.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/router2.cc b/common/router2.cc
index 667d906e..9264903d 100644
--- a/common/router2.cc
+++ b/common/router2.cc
@@ -579,6 +579,7 @@ struct Router2
int backwards_limit =
ctx->getBelGlobalBuf(net->driver.cell->bel) ? cfg.global_backwards_max_iter : cfg.backwards_max_iter;
t.backwards_queue.push(wire_to_idx.at(dst_wire));
+ set_visited(t, wire_to_idx.at(dst_wire), PipId(), WireScore());
while (!t.backwards_queue.empty() && backwards_iter < backwards_limit) {
int cursor = t.backwards_queue.front();
t.backwards_queue.pop();
@@ -645,6 +646,9 @@ struct Router2
bind_pip_internal(net, i, src_wire_idx, PipId());
while (was_visited(cursor_fwd)) {
auto &v = flat_wires.at(cursor_fwd).visit;
+ if (v.pip == PipId()) {
+ break;
+ }
cursor_fwd = wire_to_idx.at(ctx->getPipDstWire(v.pip));
bind_pip_internal(net, i, cursor_fwd, v.pip);
if (ctx->debug) {