From 48a1d8b98d19b23417f4f3d55a97522f03ab5f42 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 20 Nov 2024 15:49:20 -0800 Subject: [PATCH] [CUFR] CUFR and PartialCUFR to default to --hus Emit warning if not enabled Signed-off-by: Eddie Hung --- src/com/xilinx/rapidwright/rwroute/CUFR.java | 28 +++++++++- .../rapidwright/rwroute/PartialCUFR.java | 51 +++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/src/com/xilinx/rapidwright/rwroute/CUFR.java b/src/com/xilinx/rapidwright/rwroute/CUFR.java index 208776f7b..6bc362292 100644 --- a/src/com/xilinx/rapidwright/rwroute/CUFR.java +++ b/src/com/xilinx/rapidwright/rwroute/CUFR.java @@ -163,7 +163,28 @@ protected void routeIndirectConnections(Collection connections) { } /** - * Routes a {@link Design} instance. + * Routes a design in the full timing-driven routing mode using CUFR. + * @param design The {@link Design} instance to be routed. + */ + public static Design routeDesignFullTimingDriven(Design design) { + return routeDesignWithUserDefinedArguments(design, new String[] { + "--hus" + }); + } + + /** + * Routes a design in the full non-timing-driven routing mode using CUFR. + * @param design The {@link Design} instance to be routed. + */ + public static Design routeDesignFullNonTimingDriven(Design design) { + return routeDesignWithUserDefinedArguments(design, new String[] { + "--hus", + "--nonTimingDriven" + }); + } + + /** + * Routes a {@link Design} instance using CUFR. * @param design The {@link Design} instance to be routed. * @param args An array of string arguments, can be null. * If null, the design will be routed in the full timing-driven routing mode with default a {@link RWRouteConfig} instance. @@ -174,6 +195,11 @@ public static Design routeDesignWithUserDefinedArguments(Design design, String[] // Instantiates a RWRouteConfig Object and parses the arguments. // Uses the default configuration if basic usage only. RWRouteConfig config = new RWRouteConfig(args); + + if (!config.isHus()) { + System.err.println("WARNING: Hybrid Updating Strategy (HUS) is not enabled."); + } + return routeDesign(design, new CUFR(design, config)); } diff --git a/src/com/xilinx/rapidwright/rwroute/PartialCUFR.java b/src/com/xilinx/rapidwright/rwroute/PartialCUFR.java index 0d70a3965..2f435d0f9 100644 --- a/src/com/xilinx/rapidwright/rwroute/PartialCUFR.java +++ b/src/com/xilinx/rapidwright/rwroute/PartialCUFR.java @@ -151,6 +151,53 @@ protected void printRoutingStatistics() { super.printRoutingStatistics(); } + /** + * Routes a design in the partial non-timing-driven routing mode. + * @param design The {@link Design} instance to be routed. + * @param pinsToRoute Collection of {@link SitePinInst}-s to be routed. If null, route all unrouted pins in the design. + */ + public static Design routeDesignPartialNonTimingDriven(Design design, Collection pinsToRoute) { + boolean softPreserve = false; + return routeDesignPartialNonTimingDriven(design, pinsToRoute, softPreserve); + } + + /** + * Routes a design in the partial non-timing-driven routing mode using CUFR. + * @param design The {@link Design} instance to be routed. + * @param pinsToRoute Collection of {@link SitePinInst}-s to be routed. If null, route all unrouted pins in the design. + * @param softPreserve Allow routed nets to be unrouted and subsequently rerouted in order to improve routability. + */ + public static Design routeDesignPartialNonTimingDriven(Design design, Collection pinsToRoute, boolean softPreserve) { + return routeDesignWithUserDefinedArguments(design, new String[] { + "--hus", + "--fixBoundingBox", + // use U-turn nodes and no masking of nodes cross RCLK + // Pros: maximum routability + // Con: might result in delay optimism and a slight increase in runtime + "--useUTurnNodes", + "--nonTimingDriven", + "--verbose"}, + pinsToRoute, softPreserve); + } + + /** + * Routes a design in the partial timing-driven routing mode using CUFR. + * @param design The {@link Design} instance to be routed. + * @param pinsToRoute Collection of {@link SitePinInst}-s to be routed. If null, route all unrouted pins in the design. + * @param softPreserve Allow routed nets to be unrouted and subsequently rerouted in order to improve routability. + */ + public static Design routeDesignPartialTimingDriven(Design design, Collection pinsToRoute, boolean softPreserve) { + return routeDesignWithUserDefinedArguments(design, new String[] { + "--hus", + "--fixBoundingBox", + // use U-turn nodes and no masking of nodes cross RCLK + // Pros: maximum routability + // Con: might result in delay optimism and a slight increase in runtime + "--useUTurnNodes", + "--verbose"}, + pinsToRoute, softPreserve); + } + /** * Partially routes a {@link Design} instance; specifically, all nets with no routing PIPs already present. * @param design The {@link Design} instance to be routed. @@ -194,6 +241,10 @@ public static Design routeDesignWithUserDefinedArguments(Design design, System.out.println("WARNING: Masking nodes across RCLK for partial routing could result in routability problems."); } + if (!config.isHus()) { + System.err.println("WARNING: Hybrid Updating Strategy (HUS) is not enabled."); + } + return routeDesign(design, new PartialCUFR(design, config, pinsToRoute, softPreserve)); }