diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-11-11 00:29:25 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-11-11 00:29:25 +0100 |
commit | e7ae28cafeb72b6e427431c28868516fae170216 (patch) | |
tree | 15bdde9bdda019d5604a729df8beb5459226fd8a /common/router1.cc | |
parent | 5b8c8bb966f7d4d2e7fe97137834a75b4e141d2e (diff) | |
download | nextpnr-e7ae28cafeb72b6e427431c28868516fae170216.tar.gz nextpnr-e7ae28cafeb72b6e427431c28868516fae170216.tar.bz2 nextpnr-e7ae28cafeb72b6e427431c28868516fae170216.zip |
Minor improvements in router1
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'common/router1.cc')
-rw-r--r-- | common/router1.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/common/router1.cc b/common/router1.cc index cac60104..ed9ac39a 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -247,6 +247,8 @@ remove_wire_arcs: if (skip_net(net_info)) continue; + // log("[check] net: %s\n", net_info->name.c_str(ctx)); + auto src_wire = ctx->getNetinfoSourceWire(net_info); log_assert(src_wire != WireId()); @@ -259,8 +261,10 @@ remove_wire_arcs: arc.user_idx = user_idx; valid_arcs.insert(arc); + // log("[check] arc: %s %s\n", ctx->getWireName(src_wire).c_str(ctx), ctx->getWireName(dst_wire).c_str(ctx)); for (WireId wire : arc_to_wires[arc]) { + // log("[check] wire: %s\n", ctx->getWireName(wire).c_str(ctx)); valid_wires_for_net.insert(wire); log_assert(wire_to_arcs[wire].count(arc)); log_assert(net_info->wires.count(wire)); @@ -567,14 +571,14 @@ remove_wire_arcs: } } - if (ctx->checkWireAvail(cursor)) { + if (net_info->wires.count(cursor) == 0 || net_info->wires.at(cursor).pip != pip) { if (pip == PipId()) { if (ctx->debug) - log(" bind %s\n", ctx->getWireName(cursor).c_str(ctx)); + log(" bind wire %s\n", ctx->getWireName(cursor).c_str(ctx)); ctx->bindWire(cursor, net_info, STRENGTH_WEAK); - } else if (ctx->checkPipAvail(pip)) { + } else { if (ctx->debug) - log(" bind %s\n", ctx->getPipName(pip).c_str(ctx)); + log(" bind pip %s\n", ctx->getPipName(pip).c_str(ctx)); ctx->bindPip(pip, net_info, STRENGTH_WEAK); } } @@ -660,6 +664,7 @@ bool router1(Context *ctx, const Router1Cfg &cfg) log_warning("Failed to find a route for arc %d of net %s.\n", arc.user_idx, arc.net_info->name.c_str(ctx)); #ifndef NDEBUG + router.check(); ctx->check(); #endif ctx->unlock(); |