Skip to content

Commit

Permalink
RWRoute to not push previous connection routing onto queue
Browse files Browse the repository at this point in the history
  • Loading branch information
eddieh-xlnx committed Nov 24, 2022
1 parent c200ca4 commit 44c7913
Showing 1 changed file with 3 additions and 66 deletions.
69 changes: 3 additions & 66 deletions src/com/xilinx/rapidwright/rwroute/RWRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import com.xilinx.rapidwright.timing.TimingVertex;
import com.xilinx.rapidwright.timing.delayestimator.DelayEstimatorBase;
import com.xilinx.rapidwright.timing.delayestimator.InterconnectInfo;
import org.python.google.common.collect.Lists;

/**
* RWRoute class provides the main methods for routing a design.
Expand Down Expand Up @@ -1448,9 +1447,9 @@ protected boolean isAccessible(RouteNode child, Connection connection) {
* @param rnodeDelayWeight The weight of childRnode's exact delay.
* @param rnodeEstDlyWeight The weight of estimated delay from childRnode to the target.
*/
private void evaluateCostAndPush(RouteNode rnode, boolean longParent, RouteNode childRnode, Connection connection, float sharingWeight, float rnodeCostWeight,
float rnodeLengthWeight, float rnodeEstWlWeight,
float rnodeDelayWeight, float rnodeEstDlyWeight) {
protected void evaluateCostAndPush(RouteNode rnode, boolean longParent, RouteNode childRnode, Connection connection, float sharingWeight, float rnodeCostWeight,
float rnodeLengthWeight, float rnodeEstWlWeight,
float rnodeDelayWeight, float rnodeEstDlyWeight) {
int countSourceUses = childRnode.countConnectionsOfUser(connection.getNetWrapper());
float sharingFactor = 1 + sharingWeight* countSourceUses;

Expand Down Expand Up @@ -1588,72 +1587,10 @@ protected void prepareRouteConnection(Connection connectionToRoute, float shareW
// Sets the sink rnode(s) of the connection as the target(s)
connectionToRoute.setTarget(true);

NetWrapper netWrapper = connectionToRoute.getNetWrapper();

// Adds the source rnode to the queue
RouteNode sourceRnode = connectionToRoute.getSourceRnode();
assert(sourceRnode.getPrev() == null);
push(sourceRnode, 0, 0);

// Push all nodes from the previous iteration's routing onto the queue
if (connectionToRoute.getSink().isRouted()) {
assert(!connectionToRoute.getRnodes().isEmpty());

RouteNode parentRnode = null;
boolean parentRnodeWillOveruse = false;

// Go forwards from source
for (RouteNode childRnode : Lists.reverse(connectionToRoute.getRnodes())) {
if (parentRnode != null) {
assert(isAccessible(childRnode, connectionToRoute));

// Place child onto queue
assert(!childRnode.isVisited());
boolean longParent = config.isTimingDriven() && DelayEstimatorBase.isLong(parentRnode.getNode());
evaluateCostAndPush(parentRnode, longParent, childRnode, connectionToRoute, shareWeight, rnodeCostWeight,
rnodeLengthWeight, rnodeEstWlWeight, rnodeDelayWeight, rnodeEstDlyWeight);
assert(childRnode.getPrev() == parentRnode);
}

parentRnode = childRnode;

parentRnodeWillOveruse = parentRnode.willOverUse(netWrapper);
// Skip all downstream nodes after the first would-be-overused node
if (parentRnodeWillOveruse)
break;

assert(!parentRnode.isTarget());
}

// If non-timing driven, there must be at least one over-used node on the
// connection-to-be-routed (otherwise we wouldn't expect it to need
// re-routing)
assert(config.isTimingDriven() ||
parentRnodeWillOveruse);
}

RouteNode childRnode = null;

// For the connectionToRoute only, go backwards from sink
for (RouteNode parentRnode : connectionToRoute.getRnodes()) {
// Skip all nodes upstream of first over used node
// (or would-be-overused if we were to start using it)
if (parentRnode.willOverUse(netWrapper)) {
break;
}

assert(!parentRnode.isVisited());

// Mark nodes upstream of the sink as targets also
if (childRnode != null) {
assert(childRnode.isTarget());
assert(!parentRnode.isTarget());
parentRnode.setTarget(true);
childRnode.setPrev(parentRnode);
}

childRnode = parentRnode;
}
}

/**
Expand Down

0 comments on commit 44c7913

Please sign in to comment.