Skip to content

Commit

Permalink
[RWRoute] Small cleanup; enable CUFR by default (#1126)
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Hung <[email protected]>
  • Loading branch information
eddieh-xlnx authored Dec 17, 2024
1 parent f803bdc commit 077802a
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 21 deletions.
7 changes: 5 additions & 2 deletions src/com/xilinx/rapidwright/rwroute/CUFR.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public static Design routeDesignWithUserDefinedArguments(Design design, String[]
System.err.println("WARNING: Hybrid Updating Strategy (HUS) is not enabled.");
}

return routeDesign(design, new CUFR(design, config));
return routeDesign(new CUFR(design, config));
}

/**
Expand Down Expand Up @@ -229,7 +229,10 @@ public static void main(String[] args) {
} else {
input = Design.readCheckpoint(args[0]);
}
Design routed = routeDesignWithUserDefinedArguments(input, rwrouteArgs);

RWRouteConfig config = new RWRouteConfig(rwrouteArgs);
config.setHus(true);
Design routed = routeDesign(new CUFR(input, config));

// Writes out the routed design checkpoint
routed.writeCheckpoint(routedDCPfileName,t);
Expand Down
41 changes: 31 additions & 10 deletions src/com/xilinx/rapidwright/rwroute/PartialCUFR.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,37 +201,35 @@ public static Design routeDesignPartialTimingDriven(Design design, Collection<Si
/**
* Partially routes a {@link Design} instance; specifically, all nets with no routing PIPs already present.
* @param design The {@link Design} instance to be routed.
* @param args An array of string arguments, can be null.
* @param config The {@link RWRouteConfig} instance to use.
* If null, the design will be routed in the full timing-driven routing mode with default a {@link RWRouteConfig} instance.
* For more options of the configuration, please refer to the {@link RWRouteConfig} class.
* @return Routed design.
*/
public static Design routeDesignWithUserDefinedArguments(Design design, String[] args) {
public static Design routeDesignWithUserDefinedArguments(Design design, RWRouteConfig config) {
boolean softPreserve = false;
List<SitePinInst> pinsToRoute = null;

// Instantiates a RWRouteConfig Object and parses the arguments.
// Uses the default configuration if basic usage only.
return routeDesignWithUserDefinedArguments(design, args, pinsToRoute, softPreserve);
return routeDesignWithUserDefinedArguments(design, config, 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.
* @param args An array of string arguments, can be null.
* @param config The {@link RWRouteConfig} instance to use.
* If null, the design will be routed in the full timing-driven routing mode with default a {@link RWRouteConfig} instance.
* For more options of the configuration, please refer to the {@link RWRouteConfig} class.
* @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.
* @return Routed design.
*/
public static Design routeDesignWithUserDefinedArguments(Design design,
String[] args,
RWRouteConfig config,
Collection<SitePinInst> pinsToRoute,
boolean softPreserve) {
// Instantiates a RWRouteConfig Object and parses the arguments.
// Uses the default configuration if basic usage only.
RWRouteConfig config = new RWRouteConfig(args);
if (pinsToRoute == null) {
preprocess(design);
pinsToRoute = getUnroutedPins(design);
Expand All @@ -245,7 +243,27 @@ public static Design routeDesignWithUserDefinedArguments(Design design,
System.err.println("WARNING: Hybrid Updating Strategy (HUS) is not enabled.");
}

return routeDesign(design, new PartialCUFR(design, config, pinsToRoute, softPreserve));
return routeDesign(new PartialCUFR(design, config, 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.
* @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.
* For more options of the configuration, please refer to the {@link RWRouteConfig} class.
* @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.
* @return Routed design.
*/
public static Design routeDesignWithUserDefinedArguments(Design design,
String[] args,
Collection<SitePinInst> pinsToRoute,
boolean softPreserve) {
// Instantiates a RWRouteConfig Object and parses the arguments.
// Uses the default configuration if basic usage only.
RWRouteConfig config = new RWRouteConfig(args);
return routeDesignWithUserDefinedArguments(design, config, pinsToRoute, softPreserve);
}

/**
Expand All @@ -268,13 +286,16 @@ public static void main(String[] args) {

// Reads in a design and routes it
String[] rwrouteArgs = Arrays.copyOfRange(args, 2, args.length);
Design input = null;
Design input;
if (Interchange.isInterchangeFile(args[0])) {
input = Interchange.readInterchangeDesign(args[0]);
} else {
input = Design.readCheckpoint(args[0]);
}
Design routed = routeDesignWithUserDefinedArguments(input, rwrouteArgs);

RWRouteConfig config = new RWRouteConfig(rwrouteArgs);
config.setHus(true);
Design routed = routeDesignWithUserDefinedArguments(input, config);

// Writes out the routed design checkpoint
routed.writeCheckpoint(routedDCPfileName,t);
Expand Down
8 changes: 4 additions & 4 deletions src/com/xilinx/rapidwright/rwroute/PartialRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ protected void addNetConnectionToRoutingTargets(Net net) {

// Do not include arcs that the router wouldn't explore
// e.g. those that leave the INT tile, since we project pins to their INT tile
if (routingGraph.isExcludedTile(end)) {
if (RouteNodeGraph.isExcludedTile(end)) {
continue;
}

Expand Down Expand Up @@ -554,7 +554,7 @@ protected NetWrapper unpreserveNet(Net net) {

// Do not include arcs that the router wouldn't explore
// e.g. those that leave the INT tile, since we project pins to their INT tile
if (routingGraph.isExcludedTile(end))
if (RouteNodeGraph.isExcludedTile(end))
continue;

// Since net already exists, all the nodes it uses must already
Expand Down Expand Up @@ -585,7 +585,7 @@ protected NetWrapper unpreserveNet(Net net) {

// Do not include arcs that the router wouldn't explore
// e.g. those that leave the INT tile, since we project pins to their INT tile
if (routingGraph.isExcludedTile(end))
if (RouteNodeGraph.isExcludedTile(end))
continue;

boolean startPreserved = routingGraph.unpreserve(start);
Expand Down Expand Up @@ -712,7 +712,7 @@ public static Design routeDesignWithUserDefinedArguments(Design design,
System.out.println("WARNING: Masking nodes across RCLK for partial routing could result in routability problems.");
}

return routeDesign(design, new PartialRouter(design, config, pinsToRoute, softPreserve));
return routeDesign(new PartialRouter(design, config, pinsToRoute, softPreserve));
}

/**
Expand Down
7 changes: 3 additions & 4 deletions src/com/xilinx/rapidwright/rwroute/RWRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -2285,15 +2285,14 @@ private static Design routeDesign(Design design, RWRouteConfig config) {
System.out.println("WARNING: Not masking nodes across RCLK could result in delay optimism.");
}

return routeDesign(design, new RWRoute(design, config));
return routeDesign(new RWRoute(design, config));
}

/**
* Routes a design after pre-processing.
* @param design The {@link Design} instance to be routed.
* @param router A {@link RWRoute} object to be used to route the design.
*/
protected static Design routeDesign(Design design, RWRoute router) {
protected static Design routeDesign(RWRoute router) {
router.preprocess();

// Initialize router object
Expand Down Expand Up @@ -2325,7 +2324,7 @@ public static void main(String[] args) {

// Reads in a design and routes it
String[] rwrouteArgs = Arrays.copyOfRange(args, 2, args.length);
Design input = null;
Design input;
if (Interchange.isInterchangeFile(args[0])) {
input = Interchange.readInterchangeDesign(args[0]);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/com/xilinx/rapidwright/rwroute/RapidStreamRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,6 @@ public static Design routeDesignRapidStream(Design design, String anchorNameKeyw
"--enlargeBoundingBox",
"--useUTurnNodes",
"--verbose"});
return routeDesign(design, new RapidStreamRoute(design, config, pinsToRoute));
return routeDesign(new RapidStreamRoute(design, config, pinsToRoute));
}
}

0 comments on commit 077802a

Please sign in to comment.