aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-04-06 19:35:55 +0100
committerGitHub <noreply@github.com>2021-04-06 19:35:55 +0100
commit8501098c165a68d725a8267653a48860e3909347 (patch)
tree1876c8f114de8d5279cb7a8847f2490601070e8f
parentff449ca997d23a9fc8d9924a469d10932c536355 (diff)
parenta519341112e86ae63df2c54e8b1f556f4f486aeb (diff)
downloadnextpnr-8501098c165a68d725a8267653a48860e3909347.tar.gz
nextpnr-8501098c165a68d725a8267653a48860e3909347.tar.bz2
nextpnr-8501098c165a68d725a8267653a48860e3909347.zip
Merge pull request #663 from litghost/fix_router2_without_bb
Fix bug in router2 where router may give up too early.
-rw-r--r--common/router2.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/common/router2.cc b/common/router2.cc
index a233cdc5..1e53d1fc 100644
--- a/common/router2.cc
+++ b/common/router2.cc
@@ -654,7 +654,18 @@ struct Router2
bool debug_arc = /*usr.cell->type.str(ctx).find("RAMB") != std::string::npos && (usr.port ==
ctx->id("ADDRATIEHIGH0") || usr.port == ctx->id("ADDRARDADDRL0"))*/
false;
- while (!t.queue.empty() && iter < toexplore) {
+
+ // When running without a bounding box, the toexplore limit should be
+ // suspended until a solution is reached. Once a solution is found,
+ // the toexplore limit should be used again to prevent requiring the
+ // router to drain the routing queue.
+ //
+ // Note that is it important that the must_drain_queue be set to true
+ // when running without a bb to ensure that a routing failure is
+ // because there is not route, rather than just because the toexplore
+ // heuristic is incorrect.
+ bool must_drain_queue = !is_bb;
+ while (!t.queue.empty() && (must_drain_queue || iter < toexplore)) {
auto curr = t.queue.top();
auto &d = flat_wires.at(curr.wire);
t.queue.pop();
@@ -728,6 +739,7 @@ struct Router2
set_visited(t, next_idx, dh, next_score);
if (next == dst_wire) {
toexplore = std::min(toexplore, iter + 5);
+ must_drain_queue = false;
}
}
}