diff --git a/src/com/xilinx/rapidwright/router/VersalClockRouting.java b/src/com/xilinx/rapidwright/router/VersalClockRouting.java index 9d8c8706f..0046e341d 100644 --- a/src/com/xilinx/rapidwright/router/VersalClockRouting.java +++ b/src/com/xilinx/rapidwright/router/VersalClockRouting.java @@ -360,9 +360,6 @@ public static void routeToLCBs(Net clk, Map> lcbMappings, - Function getNodeStatus) { - Set used = new HashSet<>(); - Set visited = new HashSet<>(); - Queue q = new ArrayDeque<>(); - - Predicate isNodeUnavailable = (node) -> getNodeStatus.apply(node) == NodeStatus.UNAVAILABLE; - Set allowedIntentCodes = EnumSet.of( - IntentCode.NODE_CLE_CNODE, - IntentCode.NODE_INTF_CNODE, - IntentCode.NODE_CLE_CTRL, - IntentCode.NODE_INTF_CTRL, - IntentCode.NODE_IRI, - IntentCode.NODE_INODE, - IntentCode.NODE_PINBOUNCE, - IntentCode.NODE_CLE_BNODE, - IntentCode.NODE_IMUX, - IntentCode.NODE_PINFEED - ); - - RouteThruHelper routeThruHelper = new RouteThruHelper(clk.getDesign().getDevice()); - - for (Entry> e : lcbMappings.entrySet()) { - Set currPIPs = new HashSet<>(); - Node lcb = e.getKey(); - - nextPin: for (SitePinInst sink : e.getValue()) { - Node target = sink.getConnectedNode(); - q.clear(); - q.add(new NodeWithPrev(lcb)); - - while (!q.isEmpty()) { - NodeWithPrev curr = q.poll(); - if (target.equals(curr)) { - boolean inuse = false; - List path = curr.getPrevPath(); - for (int i = 1; i < path.size(); i++) { - Node node = path.get(i); - if (inuse) { - assert(getNodeStatus.apply(node) == NodeStatus.INUSE); - continue; - } - if (i > 1) { - currPIPs.add(PIP.getArbitraryPIP(node, path.get(i - 1))); - } - NodeStatus status = getNodeStatus.apply(node); - if (status == NodeStatus.INUSE) { - inuse = true; - continue; - } - assert(status == NodeStatus.AVAILABLE); - } - sink.setRouted(true); - visited.clear(); - continue nextPin; - } - - for (Node downhill : curr.getAllDownhillNodes()) { - IntentCode downhillIntentCode = downhill.getIntentCode(); - if (!allowedIntentCodes.contains(downhillIntentCode)) { - continue; - } - if (!visited.add(downhill)) { - continue; - } - if (used.contains(downhill)) { - continue; - } - // have to allow those routethru-s NODE_IRI -> * - if (routeThruHelper.isRouteThru(curr, downhill) && downhillIntentCode != IntentCode.NODE_IRI) { - continue; - } - if (isNodeUnavailable.test(downhill)) { - continue; - } - q.add(new NodeWithPrev(downhill, curr)); - } - } - throw new RuntimeException("ERROR: Couldn't route LCB " + e.getKey() + " to Pin " + sink); - } - - List clkPIPs = clk.getPIPs(); - for (PIP p : currPIPs) { - used.add(p.getStartNode()); - used.add(p.getEndNode()); - clkPIPs.add(p); - } - } - } - /** * Routes from a GLOBAL_VERTICAL_ROUTE to horizontal distribution lines. * @param clk The clock net to be routed. @@ -506,7 +407,7 @@ public static void incrementalClockRouter(Design design, Net clkNet, Function getNodeStatus) { // TODO: - throw new RuntimeException("ERROR: incrementalClockRouter not yet support on Versal devices."); + throw new RuntimeException("ERROR: Incremental clock routing not yet supported for Versal devices."); } /** @@ -520,7 +421,7 @@ public static void incrementalClockRouter(Net clkNet, List clkPins, Function getNodeStatus) { // TODO: - throw new RuntimeException("ERROR: incrementalClockRouter not yet support on Versal devices."); + throw new RuntimeException("ERROR: Incremental clock routing not yet supported for Versal devices."); } public static Map> routeLCBsToSinks(Net clk, @@ -586,7 +487,7 @@ public static Map> routeLCBsToSinks(Net clk, q.add(node); } } - throw new RuntimeException("ERROR: Couldn't map Pin " + p + " to LCB."); + throw new RuntimeException("ERROR: Couldn't route pin " + sink + " to any LCB"); } return lcbMappings;