Skip to content

Commit

Permalink
[CUFR] CUFR and PartialCUFR to default to --hus
Browse files Browse the repository at this point in the history
Emit warning if not enabled

Signed-off-by: Eddie Hung <eddie.hung@amd.com>
  • Loading branch information
eddieh-xlnx committed Nov 21, 2024
1 parent 4f38f60 commit 48a1d8b
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/com/xilinx/rapidwright/rwroute/CUFR.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,28 @@ protected void routeIndirectConnections(Collection<Connection> 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.
Expand All @@ -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));
}

Expand Down
51 changes: 51 additions & 0 deletions src/com/xilinx/rapidwright/rwroute/PartialCUFR.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<SitePinInst> 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<SitePinInst> 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<SitePinInst> 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.
Expand Down Expand Up @@ -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));
}

Expand Down

0 comments on commit 48a1d8b

Please sign in to comment.