diff --git a/src/com/xilinx/rapidwright/rwroute/Connection.java b/src/com/xilinx/rapidwright/rwroute/Connection.java index 95a7f87e0..1202b46a8 100644 --- a/src/com/xilinx/rapidwright/rwroute/Connection.java +++ b/src/com/xilinx/rapidwright/rwroute/Connection.java @@ -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); @@ -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); } diff --git a/src/com/xilinx/rapidwright/rwroute/RWRoute.java b/src/com/xilinx/rapidwright/rwroute/RWRoute.java index 288dd485e..64095bd11 100644 --- a/src/com/xilinx/rapidwright/rwroute/RWRoute.java +++ b/src/com/xilinx/rapidwright/rwroute/RWRoute.java @@ -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; @@ -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); @@ -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); } @@ -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)) { @@ -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)) { @@ -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) @@ -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()) { diff --git a/src/com/xilinx/rapidwright/rwroute/RouteNode.java b/src/com/xilinx/rapidwright/rwroute/RouteNode.java index a5a7501d3..c8e35d909 100644 --- a/src/com/xilinx/rapidwright/rwroute/RouteNode.java +++ b/src/com/xilinx/rapidwright/rwroute/RouteNode.java @@ -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: @@ -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; } diff --git a/src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java b/src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java index 0e0a388e9..8b0e45f65 100644 --- a/src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java +++ b/src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java @@ -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 @@ -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; } @@ -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) { @@ -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; } } @@ -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(); diff --git a/src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java b/src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java index 76e180715..50b223b3c 100644 --- a/src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java +++ b/src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java @@ -141,7 +141,7 @@ 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; } @@ -149,7 +149,7 @@ private static RouteNodeType getType(Node node, Tile endTile, RouteNodeGraph rou 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()); @@ -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); diff --git a/src/com/xilinx/rapidwright/rwroute/RouteNodeType.java b/src/com/xilinx/rapidwright/rwroute/RouteNodeType.java index eba37caf9..7df6c3bfe 100644 --- a/src/com/xilinx/rapidwright/rwroute/RouteNodeType.java +++ b/src/com/xilinx/rapidwright/rwroute/RouteNodeType.java @@ -28,7 +28,7 @@ public enum RouteNodeType { EXCLUSIVE_SOURCE, - EXCLUSIVE_SINK, + EXCLUSIVE_SINK_BOTH, EXCLUSIVE_SINK_EAST, EXCLUSIVE_SINK_WEST, @@ -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; } } diff --git a/src/com/xilinx/rapidwright/rwroute/TimingAndWirelengthReport.java b/src/com/xilinx/rapidwright/rwroute/TimingAndWirelengthReport.java index c51cc6789..d57747c92 100644 --- a/src/com/xilinx/rapidwright/rwroute/TimingAndWirelengthReport.java +++ b/src/com/xilinx/rapidwright/rwroute/TimingAndWirelengthReport.java @@ -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); }