From 3d43e5c63dec3fe5e96706e9fde247e9d910ba16 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 25 Sep 2024 20:47:20 -0700 Subject: [PATCH] Add and use Connection.getNet() Signed-off-by: Eddie Hung --- src/com/xilinx/rapidwright/rwroute/Connection.java | 4 ++++ src/com/xilinx/rapidwright/rwroute/PartialRouter.java | 10 +++++----- src/com/xilinx/rapidwright/rwroute/RWRoute.java | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/com/xilinx/rapidwright/rwroute/Connection.java b/src/com/xilinx/rapidwright/rwroute/Connection.java index 77c946099..d5677c73e 100644 --- a/src/com/xilinx/rapidwright/rwroute/Connection.java +++ b/src/com/xilinx/rapidwright/rwroute/Connection.java @@ -334,6 +334,10 @@ public NetWrapper getNetWrapper() { return this.netWrapper; } + public Net getNet() { + return netWrapper.getNet(); + } + public SitePinInst getSource() { return source; } diff --git a/src/com/xilinx/rapidwright/rwroute/PartialRouter.java b/src/com/xilinx/rapidwright/rwroute/PartialRouter.java index cde920586..aa14d21a8 100644 --- a/src/com/xilinx/rapidwright/rwroute/PartialRouter.java +++ b/src/com/xilinx/rapidwright/rwroute/PartialRouter.java @@ -88,7 +88,7 @@ protected boolean isExcluded(RouteNode parent, Node child) { @Override public boolean isAccessible(RouteNode childRnode, Connection connection) { Net preservedNet = getPreservedNet(childRnode); - if (preservedNet == connection.getNetWrapper().getNet()) { + if (preservedNet == connection.getNet()) { // Always allow nodes preserved for this connection's net return true; } @@ -121,7 +121,7 @@ protected boolean isExcluded(RouteNode parent, Node child) { @Override public boolean isAccessible(RouteNode childRnode, Connection connection) { Net preservedNet = getPreservedNet(childRnode); - if (preservedNet == connection.getNetWrapper().getNet()) { + if (preservedNet == connection.getNet()) { // Always allow nodes preserved for this connection's net return true; } @@ -263,7 +263,7 @@ protected void determineRoutingTargets() { // now check sink routability Set unpreserveNets = new HashSet<>(); for (Connection connection : indirectConnections) { - Net net = connection.getNetWrapper().getNet(); + Net net = connection.getNet(); RouteNode sinkRnode = connection.getSinkRnode(); Net unpreserveNet = routingGraph.getPreservedNet(sinkRnode); if (unpreserveNet != null && unpreserveNet != net) { @@ -607,9 +607,9 @@ protected boolean handleUnroutableConnection(Connection connection) { } if (softPreserve && ( // First iteration, without alternate source - (routeIteration == 1 && connection.getNetWrapper().getNet().getAlternateSource() == null) || + (routeIteration == 1 && connection.getNet().getAlternateSource() == null) || // Second iteration, with alternate source - (routeIteration == 2 && connection.getNetWrapper().getNet().getAlternateSource() != null)) + (routeIteration == 2 && connection.getNet().getAlternateSource() != null)) ) { int netsUnpreserved = unpreserveNetsAndReleaseResources(connection); if (netsUnpreserved > 0) { diff --git a/src/com/xilinx/rapidwright/rwroute/RWRoute.java b/src/com/xilinx/rapidwright/rwroute/RWRoute.java index bb25cac81..9eb447a72 100644 --- a/src/com/xilinx/rapidwright/rwroute/RWRoute.java +++ b/src/com/xilinx/rapidwright/rwroute/RWRoute.java @@ -1695,7 +1695,7 @@ private void exploreAndExpand(ConnectionState state, RouteNode rnode, float upst // If childRnode is preserved, then it must be preserved for the current net we're routing Net preservedNet; assert((preservedNet = routingGraph.getPreservedNet(childRNode)) == null || - preservedNet == connection.getNetWrapper().getNet()); + preservedNet == connection.getNet()); if (childRNode.isVisited(sequence)) { // Node must be in queue already.