From 003a051b284a169f13751b761362b642e15433a0 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 12 Nov 2024 17:08:23 -0800 Subject: [PATCH] Resolve FIXMEs Signed-off-by: Eddie Hung --- .../xilinx/rapidwright/rwroute/RWRoute.java | 8 +--- .../rapidwright/rwroute/RouteNodeGraph.java | 38 ++++++++++++++++++- .../rapidwright/rwroute/RouteNodeInfo.java | 14 +++---- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/com/xilinx/rapidwright/rwroute/RWRoute.java b/src/com/xilinx/rapidwright/rwroute/RWRoute.java index 11742bf4f..98967952d 100644 --- a/src/com/xilinx/rapidwright/rwroute/RWRoute.java +++ b/src/com/xilinx/rapidwright/rwroute/RWRoute.java @@ -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 diff --git a/src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java b/src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java index 1c00f2a5c..9afeb80ae 100644 --- a/src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java +++ b/src/com/xilinx/rapidwright/rwroute/RouteNodeGraph.java @@ -263,6 +263,38 @@ protected RouteNodeGraph(Design design, RWRouteConfig config, Map 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); @@ -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_")); diff --git a/src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java b/src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java index 9f92d1d6e..7ef02b910 100644 --- a/src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java +++ b/src/com/xilinx/rapidwright/rwroute/RouteNodeInfo.java @@ -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; @@ -157,10 +156,11 @@ 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())) { @@ -168,15 +168,13 @@ private static RouteNodeType getType(Node node, Tile endTile, RouteNodeGraph rou } 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;