aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-30 11:10:21 +0100
committerGitHub <noreply@github.com>2021-07-30 11:10:21 +0100
commit8466985bc709d6c2e0e6f5f030abec119ae2305a (patch)
tree4dd486ad92717e6f4837e5977380a1c1ae87cbe5
parent0991003de9f3aa8870728ce70e5a247747eb302e (diff)
parentb5a31d2e4e1d9097db543faf4374f5f0c10e6855 (diff)
downloadnextpnr-8466985bc709d6c2e0e6f5f030abec119ae2305a.tar.gz
nextpnr-8466985bc709d6c2e0e6f5f030abec119ae2305a.tar.bz2
nextpnr-8466985bc709d6c2e0e6f5f030abec119ae2305a.zip
Merge pull request #788 from YosysHQ/gatecat/router2-ice40
router2: Mark the destination as visited during backwards routing
-rw-r--r--common/router2.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/router2.cc b/common/router2.cc
index 2994038c..9264903d 100644
--- a/common/router2.cc
+++ b/common/router2.cc
@@ -329,7 +329,11 @@ struct Router2
if (b.first == 1) {
b.second = pip;
} else {
- NPNR_ASSERT(b.second == pip);
+ if (b.second != pip)
+ log_error("internal inconsistency: attempting to bind pip %s to net %s, but wire %s is already driven "
+ "by pip %s\n",
+ ctx->nameOfPip(pip), ctx->nameOf(net), ctx->nameOfWire(flat_wires.at(wire).w),
+ ctx->nameOfPip(b.second));
}
}
@@ -575,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();
@@ -641,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) {