Skip to content

Commit

Permalink
[RWRoute] Yet more cleanup (#1107)
Browse files Browse the repository at this point in the history
* Tighten TestRWRoute.testSLRCrossingNonTimingDriven()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [RWRoute] Tidy up, no functional change

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [RWRoute] Fix SLR crossing distance estimation

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Remove unused RouteNode.driverCounts; down from 80 -> 72 bytes

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Update another test

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Remove unused import

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [RouteNodeGraph] Limit size of preservedMap/nodesMap value array

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [PartialRouter] unpreserveNet() to return new NetWrapper

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [PartialRouter] When overused sinks found, unroute on top of unpreserving

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add asserts, remove ripUp()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

Conflicts:
	src/com/xilinx/rapidwright/rwroute/PartialRouter.java

* [RWRoute] ripUp() to not release exclusive sink nodes

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

Conflicts:
	src/com/xilinx/rapidwright/rwroute/PartialRouter.java
	src/com/xilinx/rapidwright/rwroute/RWRoute.java

* Fix spacing

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix broken cherry-pick

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Remove commented out code

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Sink is only exclusive if no alt sinks

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* RouteNode from 72 bytes to 64; use array/AtomicReferenceArray for ...

preservedMap and nodesMap

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add and use Connection.hasAltSinks()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix sink rip up, tidy

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix assertions for alternate sinks

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Use Net.addPIP() for trackChanges()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [DesignTools] Cleanup createCeSrRstPinsToVCC()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [RouteNode] setBaseCost() to be more robust

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Mark zero-length nodes with downhill PIP as being inaccessible

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Only warn about RCLKs if timing-driven

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Do not add as child if INACCESSIBLE

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Update golden values

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [DesignTools] Fix createCeSrRstPinsToVCC() for US BRAMs

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Apply suggestions from code review

Signed-off-by: eddieh-xlnx <eddie.hung@amd.com>

* [DesignTools] Add LDCE/LDPE to flop types that need site pins

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Ignore rnodes created before iteration 0, make abandoning message clearer

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* RouteNodeGraph.allowRoutethru() to ignore NODE_PINFEED targets

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add comment

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add optimization of signal routing

Signed-off-by: Wenhao Lin <wenhao.lin@amd.com>

* Merge new method into RoutingGraph.isAccessible()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix typo

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add TestNode.testNodeReachabilityVersal() to check assumptions

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add NODE_CLE_OUTPUT too

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Expand TestNode.testNodeReachabilityUltraScale()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* More

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add and use RouteNodeType.LOCAL

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Merge RouteNodeType.PINBOUNCE into LOCAL; rename WIRE, PINFEED_{I,O}

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* LUT routethru fixes

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add testNodeReachabilityVersal()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Support UltraScale

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Extend RouteNodeType.LOCAL to Versal

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Exclude Versal's NODE_IMUX/NODE_{CLE,INTF}_CTRL if not in RRG

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* More explanatory approach; no difference

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Improvement?

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Cleanup

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Update comments

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add NODE_INTF_{CNODE,BNODE}

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [TestNode] Expand testNodeReachabilityUltraScale

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Expand testNodeReachabilityVersal too

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* UltraScale+: Sub-divide LOCALs into _EAST/_WEST and stick to sink's side

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Re-add EXCLUSIVE_SINK (non-sided) for CTRL sinks

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Support UltraScale

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Print

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Expand testNodeReachabilityVersal

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Do not error out for Versal

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix failing assertions

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Remove unused import

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix another typo

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix SLR crossings

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* More Versal fixes

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Update testSLRCrossingNonTimingDriven golden values

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Tidy up and comments

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add a few more testcases

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* [RWRoute] Non-verbose mode to print out nodes popped

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Update comments/asserts

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Clean up RouteNodeGraph.isAccessible()

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fixes for UltraScale

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Skip another assert for Versal

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix Versal assertion

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix assertion

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Expand test

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Apply #1098 to Versal too

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Assign CNODEs to be LOCAL_{EAST,WEST} (opposite to name)

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix merge

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Resolve FIXMEs

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Restore comment

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix continue

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* On Versal, make all NODE_PINFEEDs RouteNodeType.LOCAL

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Handle NODE_INTF_CNODE too

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Add comment

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Simplify if

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Introduce LOCAL_RESERVED

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Allow INODE and PINBOUNCE either side of CTRL sink to be used

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Update comment

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Clearer names

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Fix

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Tidy up

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Cleanup

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Reduce SLR crossing goldens

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Reduce one more

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* More accurate message

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Simplify and comment

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

* Update src/com/xilinx/rapidwright/rwroute/PartialRouter.java

Signed-off-by: eddieh-xlnx <eddie.hung@amd.com>

* Add two testcases that needed fixing (requires Vivado)

Signed-off-by: Eddie Hung <eddie.hung@amd.com>

---------

Signed-off-by: Eddie Hung <eddie.hung@amd.com>
Signed-off-by: eddieh-xlnx <eddie.hung@amd.com>
Signed-off-by: Wenhao Lin <wenhao.lin@amd.com>
Co-authored-by: Wenhao Lin <wenhao.lin@amd.com>
  • Loading branch information
eddieh-xlnx and WenhaoLin-AMD authored Nov 19, 2024
1 parent 9cd25a6 commit 4f38f60
Show file tree
Hide file tree
Showing 14 changed files with 547 additions and 442 deletions.
4 changes: 2 additions & 2 deletions src/com/xilinx/rapidwright/rwroute/CUFR.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public CUFR(Design design, RWRouteConfig config) {

public static class RouteNodeGraphCUFR extends RouteNodeGraph {
public RouteNodeGraphCUFR(Design design, RWRouteConfig config) {
super(design, config, new ConcurrentHashMap<>());
super(design, config);
}

// Do not track createRnodeTime since it is meaningless when multithreading
Expand All @@ -92,7 +92,7 @@ protected void addCreateRnodeTime(long time) {}

public static class RouteNodeGraphCUFRTimingDriven extends RouteNodeGraphTimingDriven {
public RouteNodeGraphCUFRTimingDriven(Design design, RWRouteConfig config, DelayEstimatorBase delayEstimator) {
super(design, config, delayEstimator, new ConcurrentHashMap<>());
super(design, config, delayEstimator);
}

// Do not track createRnodeTime since it is meaningless when multithreading
Expand Down
31 changes: 17 additions & 14 deletions src/com/xilinx/rapidwright/rwroute/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,6 @@ public boolean isCongested() {
return false;
}

/**
* Checks if a connection is routed through any rnodes that have multiple drivers.
* @return
*/
public boolean useRnodesWithMultiDrivers() {
for (RouteNode rn : getRnodes()) {
if (rn.hasMultiDrivers()) {
return true;
}
}
return false;
}

/**
* Add the give RouteNode to the list of those used by this Connection.
* Expand the bounding box accordingly, since this node could describe an
Expand Down Expand Up @@ -299,6 +286,10 @@ public List<RouteNode> getAltSinkRnodes() {
return altSinkRnodes == null ? Collections.emptyList() : altSinkRnodes;
}

public boolean hasAltSinks() {
return altSinkRnodes != null && !altSinkRnodes.isEmpty();
}

public void addAltSinkRnode(RouteNode sinkRnode) {
if (altSinkRnodes == null) {
altSinkRnodes = new ArrayList<>(1);
Expand Down Expand Up @@ -351,6 +342,10 @@ public NetWrapper getNetWrapper() {
return this.netWrapper;
}

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

public SitePinInst getSource() {
return source;
}
Expand Down Expand Up @@ -469,7 +464,7 @@ public String toString() {
}

public void setAllTargets(RWRoute.ConnectionState state) {
if (sinkRnode.countConnectionsOfUser(netWrapper) == 0 ||
if (sinkRnode.countConnectionsOfUser(netWrapper) == 1 ||
sinkRnode.getIntentCode() == IntentCode.NODE_PINBOUNCE) {
// Since this connection will have been ripped up, only mark a node
// as a target if it's not already used by this net.
Expand Down Expand Up @@ -515,4 +510,12 @@ protected Pair<SitePinInst,RouteNode> getOrCreateAlternateSource(RouteNodeGraph
assert(altSourceRnode != null);
return new Pair<>(altSource, altSourceRnode);
}

public boolean isRouted() {
return sink.isRouted();
}

public void setRouted(boolean isRouted) {
sink.setRouted(isRouted);
}
}
30 changes: 30 additions & 0 deletions src/com/xilinx/rapidwright/rwroute/NetWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,34 @@ public SitePinInst getOrCreateAlternateSource(RouteNodeGraph routingGraph) {
public RouteNode getAltSourceRnode() {
return altSourceRnode;
}

public boolean hasMultipleDrivers(int sequence) {
for (Connection connection : connections) {
List<RouteNode> rnodes = connection.getRnodes();
if (rnodes.isEmpty()) {
continue;
}

RouteNode driver = rnodes.get(rnodes.size() - 2);
for (int i = rnodes.size() - 1; i >= 0; i--) {
assert(driver != null);
RouteNode rnode = rnodes.get(i);
if (rnode.isVisited(sequence)) {
// Rnode has already been visited by a prior connection;
// check if driver is same as this connection
RouteNode prev = rnode.getPrev();
if (prev != driver) {
return true;
}
} else {
// Rnode has not been visited by this net yet,
// set initial prev
rnode.setVisited(sequence);
rnode.setPrev(driver);
}
driver = rnode;
}
}
return false;
}
}
9 changes: 5 additions & 4 deletions src/com/xilinx/rapidwright/rwroute/PartialCUFR.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public PartialCUFR(Design design, RWRouteConfig config, Collection<SitePinInst>

public static class RouteNodeGraphPartialCUFR extends RouteNodeGraphPartial {
public RouteNodeGraphPartialCUFR(Design design, RWRouteConfig config) {
super(design, config, new ConcurrentHashMap<>());
super(design, config);
}

// Do not track createRnodeTime since it is meaningless when multithreading
Expand All @@ -72,7 +72,7 @@ protected void addCreateRnodeTime(long time) {}

public static class RouteNodeGraphPartialCUFRTimingDriven extends RouteNodeGraphPartialTimingDriven {
public RouteNodeGraphPartialCUFRTimingDriven(Design design, RWRouteConfig config, DelayEstimatorBase delayEstimator) {
super(design, config, delayEstimator, new ConcurrentHashMap<>());
super(design, config, delayEstimator);
}

// Do not track createRnodeTime since it is meaningless when multithreading
Expand Down Expand Up @@ -137,9 +137,10 @@ protected void routeIndirectConnections(Collection<Connection> connections) {
}

@Override
protected void unpreserveNet(Net net) {
super.unpreserveNet(net);
protected NetWrapper unpreserveNet(Net net) {
NetWrapper netWrapper = super.unpreserveNet(net);
needsRepartitioning = true;
return netWrapper;
}

@Override
Expand Down
81 changes: 36 additions & 45 deletions src/com/xilinx/rapidwright/rwroute/PartialRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand All @@ -44,7 +43,6 @@
import com.xilinx.rapidwright.device.Node;
import com.xilinx.rapidwright.device.PIP;
import com.xilinx.rapidwright.device.Series;
import com.xilinx.rapidwright.device.Tile;
import com.xilinx.rapidwright.router.UltraScaleClockRouting;
import com.xilinx.rapidwright.tests.CodePerfTracker;
import com.xilinx.rapidwright.timing.ClkRouteTiming;
Expand All @@ -71,12 +69,8 @@ public class PartialRouter extends RWRoute {

protected static class RouteNodeGraphPartial extends RouteNodeGraph {

public RouteNodeGraphPartial(Design design, RWRouteConfig config, Map<Tile, RouteNode[]> nodesMap) {
super(design, config, nodesMap);
}

public RouteNodeGraphPartial(Design design, RWRouteConfig config) {
this(design, config, new HashMap<>());
super(design, config);
}

@Override
Expand All @@ -90,17 +84,10 @@ protected boolean isExcluded(RouteNode parent, Node child) {
}

protected static class RouteNodeGraphPartialTimingDriven extends RouteNodeGraphTimingDriven {
public RouteNodeGraphPartialTimingDriven(Design design,
RWRouteConfig config,
DelayEstimatorBase delayEstimator,
Map<Tile, RouteNode[]> nodesMap) {
super(design, config, delayEstimator, nodesMap);
}

public RouteNodeGraphPartialTimingDriven(Design design,
RWRouteConfig config,
DelayEstimatorBase delayEstimator) {
this(design, config, delayEstimator, new HashMap<>());
super(design, config, delayEstimator);
}

@Override
Expand Down Expand Up @@ -168,7 +155,7 @@ protected static boolean isPartOfExistingRoute(RouteNodeGraph routingGraph, Rout
return false;
}

if (prev.equals(start) && routingGraph.isPreserved(end)) {
if (prev == start && routingGraph.isPreserved(end)) {
// Arc matches start node and end node is preserved
// This implies that both start and end nodes must be preserved for the same net
// (which assumedly is the net we're currently routing, and is asserted upstream)
Expand Down Expand Up @@ -202,7 +189,7 @@ protected TimingManager createTimingManager(ClkRouteTiming clkTiming, Collection
protected int getNumIndirectConnectionPins() {
int totalSitePins = 0;
for (Connection connection : indirectConnections) {
totalSitePins += (connection.getSink().isRouted() && !connection.isCongested()) ? 0 : 1;
totalSitePins += (connection.isRouted() && !connection.isCongested()) ? 0 : 1;
}
return totalSitePins;
}
Expand All @@ -211,7 +198,7 @@ protected int getNumIndirectConnectionPins() {
protected int getNumConnectionsCrossingSLRs() {
int numCrossingSLRs = 0;
for (Connection c : indirectConnections) {
numCrossingSLRs += (!c.isCrossSLR() || (c.getSink().isRouted() && !c.isCongested())) ? 0 : 1;
numCrossingSLRs += (!c.isCrossSLR() || (c.isRouted() && !c.isCongested())) ? 0 : 1;
}
return numCrossingSLRs;
}
Expand Down Expand Up @@ -249,7 +236,7 @@ protected void determineRoutingTargets() {
// if so, unpreserve that blocking net
Set<Net> unpreserveNets = new HashSet<>();
for (Connection connection : indirectConnections) {
Net net = connection.getNetWrapper().getNet();
Net net = connection.getNet();
Net preservedNet;
assert((preservedNet = routingGraph.getPreservedNet(connection.getSourceRnode())) == null || preservedNet == net);
RouteNode sinkRnode = connection.getSinkRnode();
Expand All @@ -261,11 +248,33 @@ protected void determineRoutingTargets() {
}

if (!unpreserveNets.isEmpty()) {
System.out.println("INFO: Unpreserving " + unpreserveNets.size() + " nets to improve sink routability");
System.out.println("INFO: Unpreserving " + unpreserveNets.size() + " nets to ensure sink routability");
for (Net net : unpreserveNets) {
System.out.println("\t" + net);
assert(!net.isStaticNet());
unpreserveNet(net);
NetWrapper netWrapper = unpreserveNet(net);
for (Connection connection : netWrapper.getConnections()) {
List<RouteNode> rnodes = connection.getRnodes();
if (rnodes.size() < 3) {
continue;
}
// Look for overused exclusive sinks within
// this connection's used nodes (except for the first and last used node,
// corresponding to source and sink)
for (RouteNode rnode : rnodes.subList(1, rnodes.size() - 1)) {
if (!rnode.getType().isAnyExclusiveSink() || !rnode.isOverUsed()) {
continue;
}

// If an overused exclusive sink is found -- it must also be used
// by the net to which that sink belongs to, so rip up this connection's
// routing
ripUp(connection);
connection.resetRoute();
connection.setRouted(false);
break;
}
}
}
}
}
Expand Down Expand Up @@ -407,13 +416,6 @@ protected void addNetConnectionToRoutingTargets(Net net) {
continue;
}

// Even though this connection is not expected to have any routing yet,
// perform a rip up anyway in order to release any exclusive sinks
// ahead of finishRouteConnection()
assert(connection.getRnodes().isEmpty());
connection.getSink().setRouted(false);
ripUp(connection);

RouteNode sinkRnode = connection.getSinkRnode();
finishRouteConnection(connection, sinkRnode);
}
Expand Down Expand Up @@ -444,7 +446,7 @@ protected boolean saveRouting(Connection connection, RouteNode rnode) {
assert(rnodes.size() > 1);

// Check if alternate source exists (without creating one if it doesn't)
if (connection.getNetWrapper().getNet().getAlternateSource() != null) {
if (connection.getNet().getAlternateSource() != null) {
Pair<SitePinInst,RouteNode> altSourceAndRnode = connection.getOrCreateAlternateSource(routingGraph);
assert(altSourceAndRnode != null);
RouteNode altSourceRnode = altSourceAndRnode.getSecond();
Expand All @@ -463,13 +465,8 @@ protected boolean saveRouting(Connection connection, RouteNode rnode) {
protected void finishRouteConnection(Connection connection, RouteNode rnode) {
super.finishRouteConnection(connection, rnode);

if (!connection.getSink().isRouted()) {
if (!connection.isRouted()) {
connection.resetRoute();
if (connection.getAltSinkRnodes().isEmpty()) {
// Undo what ripUp() would have done for this connection which has a single exclusive sink
rnode.incrementUser(connection.getNetWrapper());
rnode.updatePresentCongestionCost(presentCongestionFactor);
}
}
}

Expand Down Expand Up @@ -537,7 +534,7 @@ protected int unpreserveNetsAndReleaseResources(Connection connection) {
return unpreserveNets.size();
}

protected void unpreserveNet(Net net) {
protected NetWrapper unpreserveNet(Net net) {
assert(!net.getName().equals(Net.Z_NET));

Set<RouteNode> rnodes = new HashSet<>();
Expand Down Expand Up @@ -614,13 +611,6 @@ protected void unpreserveNet(Net net) {
assert(sourceRnode.getType() == RouteNodeType.EXCLUSIVE_SOURCE);
assert(sinkRnode.getType().isAnyExclusiveSink());

// Even though this connection is not expected to have any routing yet,
// perform a rip up anyway in order to release any exclusive sinks
// ahead of finishRouteConnection()
assert(connection.getRnodes().isEmpty());
connection.getSink().setRouted(false);
ripUp(connection);

finishRouteConnection(connection, sinkRnode);
}

Expand Down Expand Up @@ -655,6 +645,7 @@ protected void unpreserveNet(Net net) {

numPreservedWire--;
numPreservedRoutableNets--;
return netWrapper;
}

@Override
Expand All @@ -665,9 +656,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
Loading

0 comments on commit 4f38f60

Please sign in to comment.