diff --git a/common/router1.cc b/common/router1.cc index ed9ac39a..a4b37daf 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -544,21 +544,22 @@ remove_wire_arcs: WireId cursor = dst_wire; while (1) { + auto pip = visited[cursor].pip; + if (ctx->debug) log(" node %s\n", ctx->getWireName(cursor).c_str(ctx)); if (!ctx->checkWireAvail(cursor)) { NetInfo *ripupWireNet = ctx->getConflictingWireNet(cursor); NPNR_ASSERT(ripupWireNet != nullptr); + NPNR_ASSERT(ripupWireNet->wires.count(cursor)); - if (ripupWireNet != net_info) { + if (ripupWireNet != net_info || net_info->wires.at(cursor).pip != pip) { ripup_wire(cursor); NPNR_ASSERT(ctx->checkWireAvail(cursor)); } } - auto pip = visited[cursor].pip; - if (pip == PipId()) { NPNR_ASSERT(cursor == src_wire); } else { @@ -658,6 +659,9 @@ bool router1(Context *ctx, const Router1Cfg &cfg) #endif } + if (ctx->debug) + log("-- %d --\n", iter_cnt); + arc_key arc = router.arc_queue_pop(); if (!router.route_arc(arc, true)) {