diff options
author | gatecat <gatecat@ds0.me> | 2021-02-10 12:28:40 +0000 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-02-10 14:18:12 +0000 |
commit | 535723f414a77eb4aa43b794627bbd4aca56f6f0 (patch) | |
tree | ad130cb32c2b6ff29de73d88d12bdbfe0ed2fd66 /common/router2.cc | |
parent | 85bb108ba40f9573571de0a785f9fbc91c4e1dd0 (diff) | |
download | nextpnr-535723f414a77eb4aa43b794627bbd4aca56f6f0.tar.gz nextpnr-535723f414a77eb4aa43b794627bbd4aca56f6f0.tar.bz2 nextpnr-535723f414a77eb4aa43b794627bbd4aca56f6f0.zip |
Start making use of getBelPinsForCellPin API
This replaces getNetinfoSinkWire with 3 new functions for different use
cases.
At the moment all existing code has been moved to getNetinfoSinkWire
with phys_idx=0 so the build doesn't break; but this won't yet function
properly with more than one sink. But it provides a base on which to
work on refactoring the routers to support this case.
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/router2.cc')
-rw-r--r-- | common/router2.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/router2.cc b/common/router2.cc index 49d5fdec..d1e4e347 100644 --- a/common/router2.cc +++ b/common/router2.cc @@ -150,7 +150,7 @@ struct Router2 for (size_t j = 0; j < ni->users.size(); j++) { auto &usr = ni->users.at(j); - WireId src_wire = ctx->getNetinfoSourceWire(ni), dst_wire = ctx->getNetinfoSinkWire(ni, usr); + WireId src_wire = ctx->getNetinfoSourceWire(ni), dst_wire = ctx->getNetinfoSinkWire(ni, usr, 0); nets.at(i).src_wire = src_wire; if (ni->driver.cell == nullptr) src_wire = dst_wire; @@ -405,7 +405,7 @@ struct Router2 void reserve_wires_for_arc(NetInfo *net, size_t i) { WireId src = ctx->getNetinfoSourceWire(net); - WireId sink = ctx->getNetinfoSinkWire(net, net->users.at(i)); + WireId sink = ctx->getNetinfoSinkWire(net, net->users.at(i), 0); if (sink == WireId()) return; std::unordered_set<WireId> rsv; @@ -479,7 +479,7 @@ struct Router2 auto &usr = net->users.at(i); ROUTE_LOG_DBG("Routing arc %d of net '%s' (%d, %d) -> (%d, %d)\n", int(i), ctx->nameOf(net), ad.bb.x0, ad.bb.y0, ad.bb.x1, ad.bb.y1); - WireId src_wire = ctx->getNetinfoSourceWire(net), dst_wire = ctx->getNetinfoSinkWire(net, usr); + WireId src_wire = ctx->getNetinfoSourceWire(net), dst_wire = ctx->getNetinfoSinkWire(net, usr, 0); if (src_wire == WireId()) ARC_LOG_ERR("No wire found for port %s on source cell %s.\n", ctx->nameOf(net->driver.port), ctx->nameOf(net->driver.cell)); @@ -726,7 +726,7 @@ struct Router2 if (check_arc_routing(net, i)) continue; auto &usr = net->users.at(i); - WireId dst_wire = ctx->getNetinfoSinkWire(net, usr); + WireId dst_wire = ctx->getNetinfoSinkWire(net, usr, 0); // Case of arcs that were pre-routed strongly (e.g. clocks) if (net->wires.count(dst_wire) && net->wires.at(dst_wire).strength > STRENGTH_STRONG) return ARC_SUCCESS; @@ -751,7 +751,7 @@ struct Router2 if (res2 != ARC_SUCCESS) log_error("Failed to route arc %d of net '%s', from %s to %s.\n", int(i), ctx->nameOf(net), ctx->nameOfWire(ctx->getNetinfoSourceWire(net)), - ctx->nameOfWire(ctx->getNetinfoSinkWire(net, net->users.at(i)))); + ctx->nameOfWire(ctx->getNetinfoSinkWire(net, net->users.at(i), 0))); } } } @@ -803,7 +803,7 @@ struct Router2 // Skip routes with no source if (src == WireId()) return true; - WireId dst = ctx->getNetinfoSinkWire(net, usr); + WireId dst = ctx->getNetinfoSinkWire(net, usr, 0); // Skip routes where the destination is already bound if (dst == WireId() || ctx->getBoundWireNet(dst) == net) return true; |