From e4dbcf40e17369888aeb504416ce46bf9528aef0 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Sat, 27 Jun 2026 15:04:14 +0000 Subject: [PATCH 1/7] 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 d8e75580b5..a4ef02e180 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -87,6 +87,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 @@ -97,12 +113,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 e40baa4593..8bca003947 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -1622,3 +1622,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 5c5380c49a..b65c274cad 160000 --- a/tools/OpenROAD +++ b/tools/OpenROAD @@ -1 +1 @@ -Subproject commit 5c5380c49a63466536b20ddf5c7e4e151ff40daa +Subproject commit b65c274cadefe2151aa7eee32e1be9026e8ff14a From 2cec131395835d7724b655dc6cbb469336cd79d1 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Tue, 30 Jun 2026 23:27:42 +0000 Subject: [PATCH 2/7] Tcl lint fix Signed-off-by: Cho Moon Signed-off-by: Matt Liberty --- 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 a4ef02e180..48346f3133 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -88,14 +88,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) } { @@ -113,7 +112,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 f35c12e2ba1b56462c04e494a1750ee47691b627 Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Wed, 1 Jul 2026 00:45:51 +0000 Subject: [PATCH 3/7] gemini code review fix Signed-off-by: Cho Moon Signed-off-by: Matt Liberty --- 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 ab5dc406d4..78871f1552 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -197,6 +197,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.| | @@ -545,6 +546,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 438aee850152374698c9550d4976dc3da344dc7d Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Wed, 1 Jul 2026 01:37:50 +0000 Subject: [PATCH 4/7] fix for Tcl lint and variables.json Signed-off-by: Cho Moon Signed-off-by: Matt Liberty --- 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 6f45eaa945..3a2db59d7f 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -645,6 +645,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 3b129edf8cfc606085239054b09071714ffbc22d Mon Sep 17 00:00:00 2001 From: Cho Moon Date: Wed, 1 Jul 2026 02:29:14 +0000 Subject: [PATCH 5/7] fixed match_footprint env var Signed-off-by: Cho Moon Signed-off-by: Matt Liberty --- 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 } { From 9c8a92e8bcc420a53d96c68d4c763a87940fbc27 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 2 Jul 2026 21:40:50 +0000 Subject: [PATCH 6/7] Update uW and ariane133 for OPT_POST_GRT_WNS designs/sky130hd/microwatt/rules-base.json updates: | Metric | Old | New | Type | | ------ | --- | --- | ---- | | globalroute__antenna_diodes_count | 1909 | 1931 | Failing | | detailedroute__antenna__violating__nets | 0 | 1 | Failing | | detailedroute__antenna_diodes_count | 1267 | 1274 | Failing | designs/nangate45/ariane133/rules-base.json updates: | Metric | Old | New | Type | | ------ | --- | --- | ---- | | globalroute__timing__setup__tns | -880.0 | -994.0 | Failing | | finish__timing__setup__tns | -964.0 | -1010.0 | Failing | Signed-off-by: Matt Liberty --- flow/designs/nangate45/ariane133/rules-base.json | 4 ++-- flow/designs/sky130hd/microwatt/rules-base.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flow/designs/nangate45/ariane133/rules-base.json b/flow/designs/nangate45/ariane133/rules-base.json index 2a9ee15a69..8cde2d298a 100644 --- a/flow/designs/nangate45/ariane133/rules-base.json +++ b/flow/designs/nangate45/ariane133/rules-base.json @@ -62,7 +62,7 @@ "compare": ">=" }, "globalroute__timing__setup__tns": { - "value": -880.0, + "value": -994.0, "compare": ">=" }, "globalroute__timing__hold__ws": { @@ -94,7 +94,7 @@ "compare": ">=" }, "finish__timing__setup__tns": { - "value": -964.0, + "value": -1010.0, "compare": ">=" }, "finish__timing__hold__ws": { diff --git a/flow/designs/sky130hd/microwatt/rules-base.json b/flow/designs/sky130hd/microwatt/rules-base.json index e4b5d7beba..f511144e80 100644 --- a/flow/designs/sky130hd/microwatt/rules-base.json +++ b/flow/designs/sky130hd/microwatt/rules-base.json @@ -54,7 +54,7 @@ "compare": ">=" }, "globalroute__antenna_diodes_count": { - "value": 1909, + "value": 1931, "compare": "<=" }, "globalroute__timing__setup__ws": { @@ -82,11 +82,11 @@ "compare": "<=" }, "detailedroute__antenna__violating__nets": { - "value": 0, + "value": 1, "compare": "<=" }, "detailedroute__antenna_diodes_count": { - "value": 1267, + "value": 1274, "compare": "<=" }, "finish__timing__setup__ws": { From a931548476834b24ec8794020ae94b23ba19c255 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 2 Jul 2026 22:04:33 +0000 Subject: [PATCH 7/7] Add missing log_cmd and rm unneeded variable set Signed-off-by: Matt Liberty --- flow/scripts/global_route.tcl | 6 +++--- flow/scripts/variables.mk | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index 187b7497cf..9f427cf1ef 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -90,7 +90,7 @@ 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 + log_cmd 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 @@ -103,7 +103,7 @@ proc global_route_helper { } { if { $::env(SETUP_SLACK_MARGIN) != 0 } { lappend repair_timing_args -setup_margin $::env(SETUP_SLACK_MARGIN) } - repair_timing {*}$repair_timing_args + log_cmd repair_timing {*}$repair_timing_args if { $::env(DETAILED_METRICS) } { report_metrics 5 "global route post repair timing_opt_wns" @@ -114,7 +114,7 @@ proc global_route_helper { } { # Run to get modified net by DPL log_cmd global_route -start_incremental log_cmd detailed_placement {*}$dpl_args - check_placement -verbose + log_cmd 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.rpt diff --git a/flow/scripts/variables.mk b/flow/scripts/variables.mk index de0d5c143c..6567737158 100644 --- a/flow/scripts/variables.mk +++ b/flow/scripts/variables.mk @@ -221,8 +221,6 @@ ifeq ($(origin ABC_CLOCK_PERIOD_IN_PS), undefined) endif endif -export OPT_POST_GRT_WNS ?= 1 - .PHONY: vars vars: mkdir -p $(OBJECTS_DIR)