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/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": { diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index d8e75580b5..9f427cf1ef 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -87,22 +87,46 @@ 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 + 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 + + 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) + } + log_cmd 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 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 } - - 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 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": [ 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