Skip to content

Commit

Permalink
Add and use Connection.getNet()
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Hung <eddie.hung@amd.com>
  • Loading branch information
eddieh-xlnx committed Sep 26, 2024
1 parent bcd7176 commit 3d43e5c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/com/xilinx/rapidwright/rwroute/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ public NetWrapper getNetWrapper() {
return this.netWrapper;
}

public Net getNet() {
return netWrapper.getNet();
}

public SitePinInst getSource() {
return source;
}
Expand Down
10 changes: 5 additions & 5 deletions src/com/xilinx/rapidwright/rwroute/PartialRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -263,7 +263,7 @@ protected void determineRoutingTargets() {
// now check sink routability
Set<Net> 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) {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/com/xilinx/rapidwright/rwroute/RWRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3d43e5c

Please sign in to comment.