Skip to content

Commit

Permalink
Clearer names
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 Nov 13, 2024
1 parent 5414206 commit 57ed051
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/com/xilinx/rapidwright/rwroute/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public void addAltSinkRnode(RouteNode sinkRnode) {
} else {
assert(!altSinkRnodes.contains(sinkRnode));
}
assert(sinkRnode.getType().isExclusiveSink() ||
assert(sinkRnode.getType().isAnyExclusiveSink() ||
// Can be a WIRE if node is not exclusive a sink
sinkRnode.getType() == RouteNodeType.NON_LOCAL);
altSinkRnodes.add(sinkRnode);
Expand Down Expand Up @@ -487,7 +487,7 @@ public void setAllTargets(RWRoute.ConnectionState state) {
// where the same physical pin services more than one logical pin
if (rnode.countConnectionsOfUser(netWrapper) == 0 ||
// Except if it is not an EXCLUSIVE_SINK
rnode.getType().isExclusiveSink()) {
rnode.getType().isAnyExclusiveSink()) {
assert(rnode.getIntentCode() != IntentCode.NODE_PINBOUNCE);
rnode.markTarget(state);
}
Expand Down
22 changes: 11 additions & 11 deletions src/com/xilinx/rapidwright/rwroute/RWRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ protected void determineRoutingTargets() {
if (routingGraph.isVersal) {
for (Connection connection : indirectConnections) {
RouteNode sinkRnode = connection.getSinkRnode();
if (sinkRnode.getType() == RouteNodeType.EXCLUSIVE_SINK) {
if (sinkRnode.getType() == RouteNodeType.EXCLUSIVE_SINK_BOTH) {
for (Node uphill : sinkRnode.getAllUphillNodes()) {
if (uphill.isTiedToVcc()) {
continue;
Expand Down Expand Up @@ -637,8 +637,8 @@ protected NetWrapper createNetWrapperAndConnections(Net net) {
sinkRnode = routingGraph.getOrCreate(sinkINTNode, RouteNodeType.EXCLUSIVE_SINK_WEST);
sinkRnode.setType(RouteNodeType.EXCLUSIVE_SINK_WEST);
} else {
sinkRnode = routingGraph.getOrCreate(sinkINTNode, RouteNodeType.EXCLUSIVE_SINK);
sinkRnode.setType(RouteNodeType.EXCLUSIVE_SINK);
sinkRnode = routingGraph.getOrCreate(sinkINTNode, RouteNodeType.EXCLUSIVE_SINK_BOTH);
sinkRnode.setType(RouteNodeType.EXCLUSIVE_SINK_BOTH);
}
connection.setSinkRnode(sinkRnode);

Expand Down Expand Up @@ -691,7 +691,7 @@ protected NetWrapper createNetWrapperAndConnections(Net net) {
continue;
}
RouteNode altSinkRnode = routingGraph.getOrCreate(node, sinkRnode.getType());
assert(altSinkRnode.getType().isExclusiveSink());
assert(altSinkRnode.getType().isAnyExclusiveSink());
connection.addAltSinkRnode(altSinkRnode);
}

Expand Down Expand Up @@ -1838,7 +1838,7 @@ private void exploreAndExpand(ConnectionState state, RouteNode rnode) {
}
switch (childRNode.getType()) {
case LOCAL_RESERVED:
case LOCAL:
case LOCAL_BOTH:
case LOCAL_EAST:
case LOCAL_WEST:
if (!routingGraph.isAccessible(childRNode, connection)) {
Expand All @@ -1847,13 +1847,13 @@ private void exploreAndExpand(ConnectionState state, RouteNode rnode) {
// Verify invariant that east/west wires stay east/west ...
assert(rnode.getType() != RouteNodeType.LOCAL_EAST || childRNode.getType() == RouteNodeType.LOCAL_EAST ||
// ... unless it's an exclusive sink using a LOCAL_RESERVED node
(childRNode.getType() == RouteNodeType.LOCAL_RESERVED && connection.getSinkRnode().getType() == RouteNodeType.EXCLUSIVE_SINK));
(childRNode.getType() == RouteNodeType.LOCAL_RESERVED && connection.getSinkRnode().getType() == RouteNodeType.EXCLUSIVE_SINK_BOTH));
assert(rnode.getType() != RouteNodeType.LOCAL_WEST || childRNode.getType() == RouteNodeType.LOCAL_WEST ||
(childRNode.getType() == RouteNodeType.LOCAL_RESERVED && connection.getSinkRnode().getType() == RouteNodeType.EXCLUSIVE_SINK));
(childRNode.getType() == RouteNodeType.LOCAL_RESERVED && connection.getSinkRnode().getType() == RouteNodeType.EXCLUSIVE_SINK_BOTH));
break;
case NON_LOCAL:
// LOCALs cannot connect to NON_LOCALs except via a LUT routethru
assert(!rnode.getType().isLocal() ||
assert(!rnode.getType().isAnyLocal() ||
routingGraph.lutRoutethru && rnode.getIntentCode() == IntentCode.NODE_PINFEED);

if (!routingGraph.isAccessible(childRNode, connection)) {
Expand All @@ -1865,12 +1865,12 @@ private void exploreAndExpand(ConnectionState state, RouteNode rnode) {
continue;
}
break;
case EXCLUSIVE_SINK:
case EXCLUSIVE_SINK_BOTH:
case EXCLUSIVE_SINK_EAST:
case EXCLUSIVE_SINK_WEST:
assert(childRNode.getType() != RouteNodeType.EXCLUSIVE_SINK_EAST || rnode.getType() == RouteNodeType.LOCAL_EAST);
assert(childRNode.getType() != RouteNodeType.EXCLUSIVE_SINK_WEST || rnode.getType() == RouteNodeType.LOCAL_WEST);
assert(childRNode.getType() != RouteNodeType.EXCLUSIVE_SINK || rnode.getType() == RouteNodeType.LOCAL ||
assert(childRNode.getType() != RouteNodeType.EXCLUSIVE_SINK_BOTH || rnode.getType() == RouteNodeType.LOCAL_BOTH ||
// [BC]NODEs are LOCAL_{EAST,WEST} since they connect to INODEs, but also service CTRL sinks
(routingGraph.isVersal && EnumSet.of(IntentCode.NODE_CLE_BNODE, IntentCode.NODE_CLE_CNODE,
IntentCode.NODE_INTF_BNODE, IntentCode.NODE_INTF_CNODE)
Expand Down Expand Up @@ -1919,7 +1919,7 @@ protected boolean isAccessibleSink(RouteNode child, Connection connection) {
}

protected boolean isAccessibleSink(RouteNode child, Connection connection, boolean assertOnOveruse) {
assert(child.getType().isExclusiveSink());
assert(child.getType().isAnyExclusiveSink());
assert(!assertOnOveruse || !child.isOverUsed());

if (child.isTarget()) {
Expand Down
10 changes: 5 additions & 5 deletions src/com/xilinx/rapidwright/rwroute/RouteNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ private void setBaseCost(Series series) {
assert(length == 0 ||
(length <= 3 && series == Series.Versal));
break;
case EXCLUSIVE_SINK:
case EXCLUSIVE_SINK_BOTH:
case EXCLUSIVE_SINK_EAST:
case EXCLUSIVE_SINK_WEST:
assert(length == 0 ||
(length == 1 && (series == Series.UltraScalePlus || series == Series.UltraScale) && getIntentCode() == IntentCode.NODE_PINBOUNCE));
break;
case LOCAL:
case LOCAL_BOTH:
assert(length == 0);
break;
case LOCAL_EAST:
Expand Down Expand Up @@ -356,13 +356,13 @@ public RouteNodeType getType() {
public void setType(RouteNodeType type) {
assert(this.type == type ||
// Support demotion from EXCLUSIVE_SINK to LOCAL since they have the same base cost
(this.type.isExclusiveSink() && type == RouteNodeType.LOCAL) ||
(this.type.isAnyExclusiveSink() && type == RouteNodeType.LOCAL_BOTH) ||
// Or promotion from LOCAL to EXCLUSIVE_SINK (by PartialRouter when NODE_PINBOUNCE on
// a newly unpreserved net becomes a sink)
(this.type == RouteNodeType.LOCAL && type.isExclusiveSink()) ||
(this.type == RouteNodeType.LOCAL_BOTH && type.isAnyExclusiveSink()) ||
// Or promotion for any LOCAL to a LOCAL_RESERVED (by determineRoutingTargets()
// for uphills of CTRL sinks)
(this.type.isLocal() && type == RouteNodeType.LOCAL_RESERVED));
(this.type.isAnyLocal() && type == RouteNodeType.LOCAL_RESERVED));
this.type = type;
}

Expand Down
12 changes: 6 additions & 6 deletions src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,9 @@ protected boolean isExcluded(RouteNode parent, Node child) {
// PINFEEDs can lead to a site pin, or into a Laguna tile
RouteNode childRnode = getNode(child);
if (childRnode != null) {
assert(childRnode.getType().isExclusiveSink() ||
assert(childRnode.getType().isAnyExclusiveSink() ||
childRnode.getType() == RouteNodeType.LAGUNA_PINFEED ||
(lutRoutethru && childRnode.getType().isLocal()));
(lutRoutethru && childRnode.getType().isAnyLocal()));
} else if (!lutRoutethru) {
// child does not already exist in our routing graph, meaning it's not a used site pin
// in our design, but it could be a LAGUNA_I
Expand Down Expand Up @@ -680,7 +680,7 @@ public boolean isAccessible(RouteNode childRnode, Connection connection) {
// Only consider LOCAL nodes when:
// (a) considering LUT routethrus
RouteNodeType type = childRnode.getType();
if (!type.isLocal() || lutRoutethru) {
if (!type.isAnyLocal() || lutRoutethru) {
return true;
}

Expand Down Expand Up @@ -709,7 +709,7 @@ public boolean isAccessible(RouteNode childRnode, Connection connection) {
return false;
}
break;
case EXCLUSIVE_SINK:
case EXCLUSIVE_SINK_BOTH:
// This must be a CTRL sink that can be accessed from both east/west sides

if (isVersal) {
Expand Down Expand Up @@ -744,7 +744,7 @@ public boolean isAccessible(RouteNode childRnode, Connection connection) {
}

// Only both-sided wires (e.g. INT_NODE_GLOBAL_*) can reach a both-sided sink (CTRL_*)
if (type != RouteNodeType.LOCAL) {
if (type != RouteNodeType.LOCAL_BOTH) {
return false;
}
}
Expand All @@ -760,7 +760,7 @@ public boolean isAccessible(RouteNode childRnode, Connection connection) {
}

if (isVersal) {
assert(sinkRnode.getType() != RouteNodeType.EXCLUSIVE_SINK);
assert(sinkRnode.getType() != RouteNodeType.EXCLUSIVE_SINK_BOTH);
assert(sinkRnode.getIntentCode() == IntentCode.NODE_IMUX || sinkRnode.getIntentCode() == IntentCode.NODE_PINBOUNCE);

IntentCode childIntentCode = childRnode.getIntentCode();
Expand Down
8 changes: 4 additions & 4 deletions src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ private static RouteNodeType getType(Node node, Tile endTile, RouteNodeGraph rou
} else if (eastWestWires[1].get(node.getWireIndex())) {
return RouteNodeType.LOCAL_WEST;
}
return RouteNodeType.LOCAL;
return RouteNodeType.LOCAL_BOTH;
}
break;
}
}

case NODE_PINFEED:
if (routingGraph == null || routingGraph.isVersal) {
return RouteNodeType.LOCAL;
return RouteNodeType.LOCAL_BOTH;
}
if (routingGraph.lagunaI != null) {
BitSet bs = routingGraph.lagunaI.get(node.getTile());
Expand All @@ -174,12 +174,12 @@ private static RouteNodeType getType(Node node, Tile endTile, RouteNodeGraph rou
}
assert(!routingGraph.isVersal && node.getWireName().startsWith("CTRL_"));
}
return RouteNodeType.LOCAL;
return RouteNodeType.LOCAL_BOTH;

// Versal only
case NODE_CLE_CTRL: // CLE_BC_CORE*.CTRL_[LR]_B*
case NODE_INTF_CTRL: // INTF_[LR]OCF_[TB][LR]_TILE.INTF_IRI*
return RouteNodeType.LOCAL;
return RouteNodeType.LOCAL_BOTH;

case NODE_LAGUNA_OUTPUT: // UltraScale+ only
assert(tileTypeEnum == TileTypeEnum.LAG_LAG);
Expand Down
12 changes: 6 additions & 6 deletions src/com/xilinx/rapidwright/rwroute/RouteNodeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

public enum RouteNodeType {
EXCLUSIVE_SOURCE,
EXCLUSIVE_SINK,
EXCLUSIVE_SINK_BOTH,
EXCLUSIVE_SINK_EAST,
EXCLUSIVE_SINK_WEST,

Expand All @@ -46,17 +46,17 @@ public enum RouteNodeType {

NON_LOCAL,

LOCAL,
LOCAL_BOTH,
LOCAL_EAST,
LOCAL_WEST,

LOCAL_RESERVED;

public boolean isExclusiveSink() {
return this == EXCLUSIVE_SINK || this == EXCLUSIVE_SINK_EAST || this == EXCLUSIVE_SINK_WEST;
public boolean isAnyExclusiveSink() {
return this == EXCLUSIVE_SINK_BOTH || this == EXCLUSIVE_SINK_EAST || this == EXCLUSIVE_SINK_WEST;
}

public boolean isLocal() {
return this == LOCAL || this == LOCAL_EAST || this == LOCAL_WEST || this == LOCAL_RESERVED;
public boolean isAnyLocal() {
return this == LOCAL_BOTH || this == LOCAL_EAST || this == LOCAL_WEST || this == LOCAL_RESERVED;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private NetWrapper createNetWrapper(Net net) {
if (sinkINTNode == null) {
connection.setDirect(true);
} else {
connection.setSinkRnode(routingGraph.getOrCreate(sinkINTNode, RouteNodeType.EXCLUSIVE_SINK));
connection.setSinkRnode(routingGraph.getOrCreate(sinkINTNode, RouteNodeType.EXCLUSIVE_SINK_BOTH));
if (sourceINTNode == null) {
sourceINTNode = RouterHelper.projectOutputPinToINTNode(source);
}
Expand Down

0 comments on commit 57ed051

Please sign in to comment.