Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global route: add policy on iteration reporting on hard runs #1333

Conversation

oharboe
Copy link
Collaborator

@oharboe oharboe commented Aug 8, 2023

The default behavior if the user didn't specify GLOBAL_ROUTE_ARGS is to first make an attempt with a few iterations, if this is a hard global route, start from scratch, try harder and logging. The goal here is to make ORFS handle the simple cases without fuzz and to make the harder cases more easily debuggable without having to go spelunking in Tcl.

If GLOBAL_ROUTE_ARGS is specified, then we do only what the GLOBAL_ROUTE_ARGS specifies.

The default behavior if the user didn't specify GLOBAL_ROUTE_ARGS is to
first make an attempt with a few iterations, if this is a hard global
route, start from scratch, try harder and logging. The goal here is to make
ORFS handle the simple cases without fuzz and to make the harder
cases more easily debuggable without having to go spelunking in Tcl.

If GLOBAL_ROUTE_ARGS is specified, then we do only what the
GLOBAL_ROUTE_ARGS specifies.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe oharboe requested a review from maliberty August 8, 2023 15:34
@oharboe
Copy link
Collaborator Author

oharboe commented Aug 9, 2023

Example with sky130hd/microwatt.

First, comment out the GLOBAL_ROUTE_ARGS, so that we enable the policy we want to test:

--- a/flow/designs/sky130hd/microwatt/config.mk
+++ b/flow/designs/sky130hd/microwatt/config.mk
@@ -31,4 +31,4 @@ export CTS_CLUSTER_SIZE = 30
 
 export export SETUP_SLACK_MARGIN = 0.2
 
-export GLOBAL_ROUTE_ARGS=-congestion_iterations 100 -verbose
+#export GLOBAL_ROUTE_ARGS=-congestion_iterations 100 -verbose

Then we get:

w$ make DESIGN_CONFIG=designs/sky130hd/microwatt/config.mk do-5_1_grt
[INFO][FLOW] Using platform directory ./platforms/sky130hd
(/usr/bin/time -f 'Elapsed time: %E[h:]min:sec. CPU time: user %U sys %S (%P). Peak memory: %MKB.' /home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad -exit -no_init  ./scripts/global_route.tcl -metrics ./logs/sky130hd/microwatt/base/5_1_grt.json) 2>&1 | tee ./logs/sky130hd/microwatt/base/5_1_grt.log
OpenROAD v2.0-9788-g020494c0c 
This program is licensed under the BSD-3 license. See the LICENSE file for details.
Components of this program may be licensed under more restrictive licenses which must be honored.
[INFO GRT-0020] Min routing layer: met1
[INFO GRT-0021] Max routing layer: met5
[INFO GRT-0022] Global adjustment: 0%
[INFO GRT-0023] Grid origin: (0, 0)
[INFO GRT-0043] No OR_DEFAULT vias defined.
[INFO GRT-0088] Layer li1     Track-Pitch = 0.4600  line-2-Via Pitch: 0.3400
[INFO GRT-0088] Layer met1    Track-Pitch = 0.3400  line-2-Via Pitch: 0.3400
[INFO GRT-0088] Layer met2    Track-Pitch = 0.4600  line-2-Via Pitch: 0.3500
[INFO GRT-0088] Layer met3    Track-Pitch = 0.6800  line-2-Via Pitch: 0.6150
[INFO GRT-0088] Layer met4    Track-Pitch = 0.9200  line-2-Via Pitch: 1.0400
[INFO GRT-0088] Layer met5    Track-Pitch = 3.4000  line-2-Via Pitch: 3.1100
[INFO GRT-0019] Found 814 clock nets.
[INFO GRT-0001] Minimum degree: 2
[INFO GRT-0002] Maximum degree: 65
[INFO GRT-0003] Macros: 6
[INFO GRT-0004] Blockages: 164875

[INFO GRT-0053] Routing resources analysis:
          Routing      Original      Derated      Resource
Layer     Direction    Resources     Resources    Reduction (%)
---------------------------------------------------------------
li1        Vertical            0             0          0.00%
met1       Horizontal    4314600       1314978          69.52%
met2       Vertical      3235950       1318610          59.25%
met3       Horizontal    2157300        910857          57.78%
met4       Vertical      1294380        401758          68.96%
met5       Horizontal     431460        215642          50.02%
---------------------------------------------------------------

[INFO GRT-0101] Running extra iterations to remove overflow.
[INFO GRT-0197] Via related to pin nodes: 342108
[INFO GRT-0198] Via related Steiner nodes: 17423
[INFO GRT-0199] Via filling finished.
[INFO GRT-0111] Final number of vias: 449023
[INFO GRT-0112] Final usage 3D: 2484864
[ERROR GRT-0119] Routing congestion too high. Check the congestion heatmap in the GUI and load ./reports/sky130hd/microwatt/base/congestion.rpt in the DRC viewer.
First attempt failed. Retrying, reporting each iteration...
Error message: GRT-0119
[INFO GRT-0020] Min routing layer: met1
[INFO GRT-0021] Max routing layer: met5
[INFO GRT-0022] Global adjustment: 0%
[INFO GRT-0023] Grid origin: (0, 0)
[INFO GRT-0043] No OR_DEFAULT vias defined.
[INFO GRT-0088] Layer li1     Track-Pitch = 0.4600  line-2-Via Pitch: 0.3400
[INFO GRT-0088] Layer met1    Track-Pitch = 0.3400  line-2-Via Pitch: 0.3400
[INFO GRT-0088] Layer met2    Track-Pitch = 0.4600  line-2-Via Pitch: 0.3500
[INFO GRT-0088] Layer met3    Track-Pitch = 0.6800  line-2-Via Pitch: 0.6150
[INFO GRT-0088] Layer met4    Track-Pitch = 0.9200  line-2-Via Pitch: 1.0400
[INFO GRT-0088] Layer met5    Track-Pitch = 3.4000  line-2-Via Pitch: 3.1100
[INFO GRT-0019] Found 814 clock nets.
[INFO GRT-0001] Minimum degree: 2
[INFO GRT-0002] Maximum degree: 65
[INFO GRT-0003] Macros: 6
[INFO GRT-0004] Blockages: 164875

[INFO GRT-0053] Routing resources analysis:
          Routing      Original      Derated      Resource
Layer     Direction    Resources     Resources    Reduction (%)
---------------------------------------------------------------
li1        Vertical            0             0          0.00%
met1       Horizontal    4314600       1314978          69.52%
met2       Vertical      3235950       1318610          59.25%
met3       Horizontal    2157300        910857          57.78%
met4       Vertical      1294380        401758          68.96%
met5       Horizontal     431460        215642          50.02%
---------------------------------------------------------------

[INFO GRT-0101] Running extra iterations to remove overflow.
[INFO GRT-0197] Via related to pin nodes: 342087
[INFO GRT-0198] Via related Steiner nodes: 17296
[INFO GRT-0199] Via filling finished.
[INFO GRT-0111] Final number of vias: 454213
[INFO GRT-0112] Final usage 3D: 2545176
[ERROR GRT-0119] Routing congestion too high. Check the congestion heatmap in the GUI and load ./reports/sky130hd/microwatt/base/congestion.rpt in the DRC viewer.
Error: global_route.tcl, 48 GRT-0119
Command exited with non-zero status 1
Elapsed time: 1:39.61[h:]min:sec. CPU time: user 99.29 sys 0.31 (99%). Peak memory: 1049632KB.
make: *** [Makefile:654: do-5_1_grt] Error 1

The reports are irrelevant in size compared to the .odb files:

...
272M	results/sky130hd/microwatt/base/4_cts.odb
...
$ du -hs reports/sky130hd/microwatt/base/* | sort -h | tail -n 10
40K	reports/sky130hd/microwatt/base/congestion-11.rpt
64K	reports/sky130hd/microwatt/base/congestion-10.rpt
196K	reports/sky130hd/microwatt/base/congestion-9.rpt
276K	reports/sky130hd/microwatt/base/congestion-8.rpt
512K	reports/sky130hd/microwatt/base/congestion-7.rpt
784K	reports/sky130hd/microwatt/base/congestion-6.rpt
1000K	reports/sky130hd/microwatt/base/congestion-5.rpt
1,3M	reports/sky130hd/microwatt/base/congestion-4.rpt
1,5M	reports/sky130hd/microwatt/base/congestion-3.rpt
2,1M	reports/sky130hd/microwatt/base/congestion-2.rpt

Examine reports in GUI after, e.g. 5 iterations:

make DESIGN_CONFIG=designs/sky130hd/microwatt/config.mk gui_place

image

Now we can load congestion report 21 and zoom in on the problems:

image

fix tcl gaffes

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe oharboe requested a review from maliberty August 12, 2023 07:15
@maliberty maliberty merged commit d4d8376 into The-OpenROAD-Project:master Aug 13, 2023
5 checks passed
@oharboe oharboe deleted the global-route-reporting-policy branch August 13, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants