aboutsummaryrefslogtreecommitdiffstats
path: root/common/router2.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-06 10:21:31 +0100
committergatecat <gatecat@ds0.me>2021-07-06 10:21:31 +0100
commit6fe071ad1d47c363f665995ae774edcd547e022d (patch)
treea26017e0a1d9a7e2cb6ffece651a960da4fb5d49 /common/router2.cc
parentf64d06fa0287cede913942380ddf84c380b2e79b (diff)
downloadnextpnr-6fe071ad1d47c363f665995ae774edcd547e022d.tar.gz
nextpnr-6fe071ad1d47c363f665995ae774edcd547e022d.tar.bz2
nextpnr-6fe071ad1d47c363f665995ae774edcd547e022d.zip
router2: Dump pre-bound routes when routing fails in debug mode
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/router2.cc')
-rw-r--r--common/router2.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/router2.cc b/common/router2.cc
index a8eea5f9..a1fd8bef 100644
--- a/common/router2.cc
+++ b/common/router2.cc
@@ -856,10 +856,20 @@ struct Router2
int(a.first), int(a.second), ctx->nameOf(net));
auto res2 = route_arc(t, net, a.first, a.second, is_mt, false);
// If this also fails, no choice but to give up
- if (res2 != ARC_SUCCESS)
+ if (res2 != ARC_SUCCESS) {
+ if (ctx->debug) {
+ log_info("Pre-bound routing: \n");
+ for (auto &wire_pair : net->wires) {
+ log(" %s", ctx->nameOfWire(wire_pair.first));
+ if (wire_pair.second.pip != PipId())
+ log(" %s", ctx->nameOfPip(wire_pair.second.pip));
+ log("\n");
+ }
+ }
log_error("Failed to route arc %d.%d of net '%s', from %s to %s.\n", int(a.first),
int(a.second), ctx->nameOf(net), ctx->nameOfWire(ctx->getNetinfoSourceWire(net)),
ctx->nameOfWire(ctx->getNetinfoSinkWire(net, net->users.at(a.first), a.second)));
+ }
}
}
}