Skip to content

Commit

Permalink
Resolve FIXMEs
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 f4df052 commit 003a051
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 15 deletions.
8 changes: 2 additions & 6 deletions src/com/xilinx/rapidwright/rwroute/RWRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -1817,12 +1817,8 @@ private void exploreAndExpand(ConnectionState state, RouteNode rnode) {
if (!routingGraph.isAccessible(childRNode, connection)) {
continue;
}
assert(rnode.getType() != RouteNodeType.LOCAL_EAST || childRNode.getType() == RouteNodeType.LOCAL_EAST
// FIXME:
|| childRNode.getTile().getName().matches("INTF_[LR]OCF_[TB]R_TILE_.*"));
assert(rnode.getType() != RouteNodeType.LOCAL_WEST || childRNode.getType() == RouteNodeType.LOCAL_WEST
// FIXME:
|| childRNode.getTile().getName().matches("INTF_[LR]OCF_[TB]L_TILE_.*"));
assert(rnode.getType() != RouteNodeType.LOCAL_EAST || childRNode.getType() == RouteNodeType.LOCAL_EAST);
assert(rnode.getType() != RouteNodeType.LOCAL_WEST || childRNode.getType() == RouteNodeType.LOCAL_WEST);
break;
case NON_LOCAL:
// LOCALs cannot connect to NON_LOCALs except via a LUT routethru
Expand Down
38 changes: 37 additions & 1 deletion src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,38 @@ protected RouteNodeGraph(Design design, RWRouteConfig config, Map<Tile, RouteNod
}
}

if (isVersal) {
for (TileTypeEnum tte : Arrays.asList(TileTypeEnum.INTF_LOCF_TL_TILE,
TileTypeEnum.INTF_LOCF_BL_TILE,
TileTypeEnum.INTF_ROCF_TL_TILE,
TileTypeEnum.INTF_ROCF_BL_TILE,
TileTypeEnum.INTF_LOCF_TR_TILE,
TileTypeEnum.INTF_LOCF_BR_TILE,
TileTypeEnum.INTF_ROCF_TR_TILE,
TileTypeEnum.INTF_ROCF_BR_TILE)) {
Tile intfTile = device.getArbitraryTileOfType(tte);
BitSet[] eastWestWires = this.eastWestWires.computeIfAbsent(tte,
k -> new BitSet[]{new BitSet(), new BitSet()});
BitSet eastWires = eastWestWires[0];
BitSet westWires = eastWestWires[1];
for (int wireIndex = 0; wireIndex < intfTile.getWireCount(); wireIndex++) {
IntentCode baseIntentCode = intfTile.getWireIntentCode(wireIndex);
if (baseIntentCode != IntentCode.NODE_INTF_BNODE) {
continue;
}

if (EnumSet.of(TileTypeEnum.INTF_LOCF_TR_TILE,
TileTypeEnum.INTF_LOCF_BR_TILE,
TileTypeEnum.INTF_ROCF_TR_TILE,
TileTypeEnum.INTF_ROCF_BR_TILE).contains(tte)) {
eastWires.set(wireIndex);
} else {
westWires.set(wireIndex);
}
}
}
}

if (lutRoutethru) {
assert(isUltraScalePlus || isUltraScale);

Expand Down Expand Up @@ -684,8 +716,12 @@ public boolean isAccessible(RouteNode childRnode, Connection connection) {
return false;
}
if (isVersal) {
// CLE_CTRL can be reached by NODE_CLE_[BC]NODE which have type LOCAL_{EAST,WEST}
assert((sinkRnode.getIntentCode() == IntentCode.NODE_CLE_CTRL && type != RouteNodeType.LOCAL) ||
(sinkRnode.getIntentCode() == IntentCode.NODE_INTF_CTRL && type == RouteNodeType.LOCAL));
// INTF_CTRL can be reached by NODE_INTF_BNODE which have type LOCAL_{EAST,WEST},
// but also NODE_INTF_CNODE which are currently LOCAL
(sinkRnode.getIntentCode() == IntentCode.NODE_INTF_CTRL && (type != RouteNodeType.LOCAL ||
childRnode.getIntentCode() == IntentCode.NODE_INTF_CNODE)));
} else {
assert(design.getSeries() == Series.UltraScale || design.getSeries() == Series.UltraScalePlus);
assert(sinkRnode.getWireName().startsWith("CTRL_"));
Expand Down
14 changes: 6 additions & 8 deletions src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import com.xilinx.rapidwright.device.IntentCode;
import com.xilinx.rapidwright.device.Node;
import com.xilinx.rapidwright.device.Series;
import com.xilinx.rapidwright.device.Tile;
import com.xilinx.rapidwright.device.TileTypeEnum;
import com.xilinx.rapidwright.device.Wire;
Expand Down Expand Up @@ -157,26 +156,25 @@ private static RouteNodeType getType(Node node, Tile endTile, RouteNodeGraph rou
}
// Fall through
case NODE_PINBOUNCE:
case NODE_INODE: // INT.INT_NODE_IMUX_ATOM_*_INT_OUT[01] (Versal only)
case NODE_IMUX: // INT.IMUX_B_[EW]* (Versal only)
case NODE_CLE_CNODE: // CLE_BC_CORE*.CNODE_OUTS_[EW]* (Versal only)
case NODE_CLE_BNODE: // CLE_BC_CORE*.BNODE_OUTS_[EW]* (Versal only)
case NODE_INODE: // INT.INT_NODE_IMUX_ATOM_*_INT_OUT[01] (Versal only)
case NODE_IMUX: // INT.IMUX_B_[EW]* (Versal only)
case NODE_CLE_CNODE: // CLE_BC_CORE*.CNODE_OUTS_[EW]* (Versal only)
case NODE_CLE_BNODE: // CLE_BC_CORE*.BNODE_OUTS_[EW]* (Versal only)
case NODE_INTF_BNODE: // INTF_[LR]OCF_[TB][LR]_TILE.IF_INT_BNODE_OUTS* (Versal only)
if (routingGraph != null && routingGraph.eastWestWires != null) {
BitSet[] eastWestWires = routingGraph.eastWestWires.get(tileTypeEnum);
if (eastWestWires[0].get(node.getWireIndex())) {
return RouteNodeType.LOCAL_EAST;
} else if (eastWestWires[1].get(node.getWireIndex())) {
return RouteNodeType.LOCAL_WEST;
}
assert((!routingGraph.isVersal && node.getWireName().startsWith("CTRL_") ||
routingGraph.isVersal && ic == IntentCode.NODE_CLE_CNODE));
assert(!routingGraph.isVersal && node.getWireName().startsWith("CTRL_"));
}
return RouteNodeType.LOCAL;

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

Expand Down

0 comments on commit 003a051

Please sign in to comment.