diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md
index 9bd08318bc..ad45bbdcac 100644
--- a/docs/user/FlowVariables.md
+++ b/docs/user/FlowVariables.md
@@ -196,6 +196,7 @@ configuration file.
| MIN_ROUTING_LAYER| The lowest metal layer name to be used in routing.| |
| NUM_CORES| Passed to `openroad -threads $(NUM_CORES)`, defaults to numbers of cores in system as determined by system specific code in Makefile, `nproc` is tried first. OpenROAD does not limit itself to this number of cores across OpenROAD running instances, which can lead to overprovisioning in contexts such as bazel-orfs where there could be many routing, or place jobs running at the same time.| |
| OPENROAD_HIERARCHICAL| Feature toggle to enable to run OpenROAD in hierarchical mode, otherwise considered flat. Will eventually be the default and this option will be retired.| 0|
+| OPT_POST_GRT_WNS| Optimize WNS after global routing by additional repair_timing that uses VT swap and wire rerouting only to minimize placement and routing disturbance| 1|
| OR_K| Passed as -or_k to detailed routing.| |
| OR_SEED| Passed as -or_seed to detailed routing.| |
| PDN_TCL| File path which has a set of power grid policies used by pdn to be applied to the design, such as layers to use, stripe width and spacing to generate the actual metal straps.| |
@@ -543,6 +544,7 @@ configuration file.
- [MAX_REPAIR_TIMING_ITER](#MAX_REPAIR_TIMING_ITER)
- [MAX_ROUTING_LAYER](#MAX_ROUTING_LAYER)
- [MIN_ROUTING_LAYER](#MIN_ROUTING_LAYER)
+- [OPT_POST_GRT_WNS](#OPT_POST_GRT_WNS)
- [POST_GLOBAL_ROUTE_TCL](#POST_GLOBAL_ROUTE_TCL)
- [PRE_GLOBAL_ROUTE_TCL](#PRE_GLOBAL_ROUTE_TCL)
- [REPORT_CLOCK_SKEW](#REPORT_CLOCK_SKEW)
diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl
index d8e75580b5..187b7497cf 100644
--- a/flow/scripts/global_route.tcl
+++ b/flow/scripts/global_route.tcl
@@ -87,6 +87,29 @@ proc global_route_helper { } {
report_metrics 5 "global route post repair timing"
}
+ if { $::env(OPT_POST_GRT_WNS) } {
+ log_cmd global_route -start_incremental
+ log_cmd detailed_placement {*}$dpl_args
+ check_placement -verbose
+ # Route only the modified net by DPL
+ log_cmd global_route -end_incremental {*}$res_aware \
+ -congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing_opt_wns.rpt
+
+ set repair_timing_args \
+ [list -setup -sequence "vt_swap reroute" -skip_last_gasp -repair_tns 0 -verbose]
+ if { [env_var_exists_and_non_empty MATCH_CELL_FOOTPRINT] } {
+ lappend repair_timing_args -match_cell_footprint
+ }
+ if { $::env(SETUP_SLACK_MARGIN) != 0 } {
+ lappend repair_timing_args -setup_margin $::env(SETUP_SLACK_MARGIN)
+ }
+ repair_timing {*}$repair_timing_args
+
+ if { $::env(DETAILED_METRICS) } {
+ report_metrics 5 "global route post repair timing_opt_wns"
+ }
+ }
+
# Running DPL to fix overlapped instances
# Run to get modified net by DPL
log_cmd global_route -start_incremental
@@ -97,12 +120,13 @@ proc global_route_helper { } {
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing.rpt
}
-
- log_cmd global_route -start_incremental
- recover_power_helper
- # Route the modified nets by rsz journal restore
- log_cmd global_route -end_incremental {*}$res_aware \
- -congestion_report_file $::env(REPORTS_DIR)/congestion_post_recover_power.rpt
+ if { !$::env(OPT_POST_GRT_WNS) } {
+ log_cmd global_route -start_incremental
+ recover_power_helper
+ # Route the modified nets by rsz journal restore
+ log_cmd global_route -end_incremental {*}$res_aware \
+ -congestion_report_file $::env(REPORTS_DIR)/congestion_post_recover_power.rpt
+ }
if {
!$::env(SKIP_ANTENNA_REPAIR) &&
diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json
index 815de49e82..9be9385526 100644
--- a/flow/scripts/variables.json
+++ b/flow/scripts/variables.json
@@ -639,6 +639,13 @@
"All stages"
]
},
+ "OPT_POST_GRT_WNS": {
+ "default": 1,
+ "description": "Optimize WNS after global routing by additional repair_timing that uses VT swap and wire rerouting only to minimize placement and routing disturbance\n",
+ "stages": [
+ "grt"
+ ]
+ },
"OR_K": {
"description": "Passed as -or_k to detailed routing.\n",
"stages": [
diff --git a/flow/scripts/variables.mk b/flow/scripts/variables.mk
index 6567737158..de0d5c143c 100644
--- a/flow/scripts/variables.mk
+++ b/flow/scripts/variables.mk
@@ -221,6 +221,8 @@ ifeq ($(origin ABC_CLOCK_PERIOD_IN_PS), undefined)
endif
endif
+export OPT_POST_GRT_WNS ?= 1
+
.PHONY: vars
vars:
mkdir -p $(OBJECTS_DIR)
diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml
index 5110b25df5..7e63e2a7e2 100644
--- a/flow/scripts/variables.yaml
+++ b/flow/scripts/variables.yaml
@@ -1617,3 +1617,10 @@ CDL_FILE:
for generating Circuit Description Language output.
stages:
- final
+OPT_POST_GRT_WNS:
+ default: 1
+ description: >
+ Optimize WNS after global routing by additional repair_timing that uses
+ VT swap and wire rerouting only to minimize placement and routing disturbance
+ stages:
+ - grt
diff --git a/tools/OpenROAD b/tools/OpenROAD
index 7304ba78ad..a9147cf3ae 160000
--- a/tools/OpenROAD
+++ b/tools/OpenROAD
@@ -1 +1 @@
-Subproject commit 7304ba78ade7cb9f78466c6d0231432d72dadd3b
+Subproject commit a9147cf3aebe65e058bb3fa89c1f9e524488dbb8