From 19eac4d558e945b99d281dd189989350bafdf5d4 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Sat, 27 Jun 2026 15:04:14 +0000 Subject: [PATCH 1/6] validate post GRT WNS opto Signed-off-by: Cho Moon --- flow/scripts/global_route.tcl | 29 +++++++++++++++++++++++------ flow/scripts/variables.mk | 2 ++ flow/scripts/variables.yaml | 7 +++++++ tools/OpenROAD | 2 +- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index 3534fde65f..bd573a9123 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -79,6 +79,22 @@ 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 + + repair_timing -setup -sequence "vt_swap reroute" -skip_last_gasp -repair_tns 0 -verbose + + 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 @@ -89,12 +105,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.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 4fdafd2d98..889bde5b8a 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -1607,3 +1607,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 4c26918f5a..b442cabf87 160000 --- a/tools/OpenROAD +++ b/tools/OpenROAD @@ -1 +1 @@ -Subproject commit 4c26918f5a77392910939b51b9c2490b7e7e3201 +Subproject commit b442cabf870c083c7b57cccd90b38c236a4ea6b6 From ef20f12234610da9da5882502c74315164eca7b3 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Tue, 30 Jun 2026 23:27:42 +0000 Subject: [PATCH 2/6] Tcl lint fix Signed-off-by: Cho Moon --- flow/scripts/global_route.tcl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index bd573a9123..657beeaa3f 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -80,14 +80,13 @@ proc global_route_helper { } { } 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 - + repair_timing -setup -sequence "vt_swap reroute" -skip_last_gasp -repair_tns 0 -verbose if { $::env(DETAILED_METRICS) } { @@ -105,7 +104,7 @@ proc global_route_helper { } { -congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing.rpt } - if { !$::env(OPT_POST_GRT_WNS) } { + if { !$::env(OPT_POST_GRT_WNS) } { log_cmd global_route -start_incremental recover_power_helper # Route the modified nets by rsz journal restore From 3d76797c4db882c0d2f3c04326bb127043a5f283 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Wed, 1 Jul 2026 00:10:47 +0000 Subject: [PATCH 3/6] updated OR Signed-off-by: Cho Moon --- tools/OpenROAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/OpenROAD b/tools/OpenROAD index b442cabf87..a9147cf3ae 160000 --- a/tools/OpenROAD +++ b/tools/OpenROAD @@ -1 +1 @@ -Subproject commit b442cabf870c083c7b57cccd90b38c236a4ea6b6 +Subproject commit a9147cf3aebe65e058bb3fa89c1f9e524488dbb8 From 5d566708fcd712c5592c87061a52c3643676e1f3 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Wed, 1 Jul 2026 00:45:51 +0000 Subject: [PATCH 4/6] gemini code review fix Signed-off-by: Cho Moon --- docs/user/FlowVariables.md | 2 ++ flow/scripts/global_route.tcl | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 48346f3133..b60605b48d 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -95,7 +95,14 @@ proc global_route_helper { } { log_cmd global_route -end_incremental {*}$res_aware \ -congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing_opt_wns.rpt - repair_timing -setup -sequence "vt_swap reroute" -skip_last_gasp -repair_tns 0 -verbose + set repair_timing_args [list -setup -sequence "vt_swap reroute" -skip_last_gasp -repair_tns 0 -verbose] + if { $::env(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" From 07278a6cf9be1acc2e52461267de4f166cb697f9 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Wed, 1 Jul 2026 01:37:50 +0000 Subject: [PATCH 5/6] fix for Tcl lint and variables.json Signed-off-by: Cho Moon --- flow/scripts/global_route.tcl | 3 ++- flow/scripts/variables.json | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index b60605b48d..a1872f6915 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -95,7 +95,8 @@ proc global_route_helper { } { 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] + set repair_timing_args \ + [list -setup -sequence "vt_swap reroute" -skip_last_gasp -repair_tns 0 -verbose] if { $::env(MATCH_CELL_FOOTPRINT) } { lappend repair_timing_args -match_cell_footprint } 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": [ From 106213bbaa82079d3be0cefc0a4d795c63459b90 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Wed, 1 Jul 2026 02:29:14 +0000 Subject: [PATCH 6/6] fixed match_footprint env var Signed-off-by: Cho Moon --- flow/scripts/global_route.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index a1872f6915..187b7497cf 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -97,7 +97,7 @@ proc global_route_helper { } { set repair_timing_args \ [list -setup -sequence "vt_swap reroute" -skip_last_gasp -repair_tns 0 -verbose] - if { $::env(MATCH_CELL_FOOTPRINT) } { + if { [env_var_exists_and_non_empty MATCH_CELL_FOOTPRINT] } { lappend repair_timing_args -match_cell_footprint } if { $::env(SETUP_SLACK_MARGIN) != 0 } {