The-OpenROAD-Project / OpenROAD

OpenROAD's unified application implementing an RTL-to-GDS Flow. Documentation at https://openroad.readthedocs.io/en/latest/
https://theopenroadproject.org/
BSD 3-Clause "New" or "Revised" License
1.38k stars 485 forks source link

ispd24: detailed route takes 2.5x longer for default groute compared to using 0.5 set_gloabl_route_layer_adjustment #5061

Open stefanottili opened 3 weeks ago

stefanottili commented 3 weeks ago

Description

Testcase is ispd24 bsg_chip, Nangate45 tech.

The global router defaults are way too optimistic with regard to available routing resources.

This leads to 2.5x slower detailed route times compared to a run with only 0.5 the resources.

Default groute takes 23min whereas a run limiting the groute resources to 0.5 takes 9min. It's a testimony to the quality of the detailed router to finish both runs without violations, but one run needs 10 iterations, the other just 4.

This is even worse when allowing metal1 to be global routed.

The resource limited run creates slightly longer wires, but uses lot less via.

Layer         Resource        Demand        Usage (%)    Max H / Max V / Total Overflow
---------------------------------------------------------------------------------------
metal1               0             0            0.00%             0 /  0 /  0
metal2        10833831       3700181           34.15%             0 /  0 /  0
metal3        14685943       3917150           26.67%             0 /  0 /  0
metal4         6880596       1034829           15.04%             0 /  0 /  0
metal5        13397121       1273167            9.50%             0 /  0 /  0
metal6        13401270        687065            5.13%             0 /  0 /  0
metal7         3826761         11571            0.30%             0 /  0 /  0
metal8         3828144         16832            0.44%             0 /  0 /  0
---------------------------------------------------------------------------------------
Total         66853666       10640795           15.92%             0 /  0 /  0

[INFO GRT-0018] Total wirelength: 27648629 um
..
[INFO DRT-0195] Start 10th optimization iteration.
...
Total wire length = 22891860 um.
Total wire length on LAYER metal1 = 39815 um.
Total wire length on LAYER metal2 = 7483953 um.
Total wire length on LAYER metal3 = 8563329 um.
Total wire length on LAYER metal4 = 2612693 um.
Total wire length on LAYER metal5 = 2684721 um.
Total wire length on LAYER metal6 = 1447989 um.
Total wire length on LAYER metal7 = 24268 um.
Total wire length on LAYER metal8 = 35087 um.
Total wire length on LAYER metal9 = 0 um.
Total wire length on LAYER metal10 = 0 um.
Total number of vias = 6205474.
Up-via summary (total 6205474)
...
[INFO DRT-0267] cpu time = 10:01:01, elapsed time = 00:29:13, memory = 22657.21 (MB), peak = 23734.66 (MB)
Layer         Resource        Demand        Usage (%)    Max H / Max V / Total Overflow
---------------------------------------------------------------------------------------
metal1               0             0            0.00%             0 /  0 /  0
metal2         4927504       2409005           48.89%             0 /  0 /  0
metal3         6831065       3127110           45.78%             0 /  0 /  0
metal4         2955866       1202912           40.70%             0 /  0 /  0
metal5         5742216       1862529           32.44%             0 /  0 /  0
metal6         5744982       1645941           28.65%             0 /  0 /  0
metal7         1914072        378639           19.78%             0 /  0 /  0
metal8         1914072        305874           15.98%             0 /  0 /  0
---------------------------------------------------------------------------------------
Total         30029777       10932010           36.40%             0 /  0 /  0

[INFO GRT-0018] Total wirelength: 28584173 um
...
[INFO DRT-0195] Start 4th optimization iteration.
...
[INFO DRT-0198] Complete detail routing.
Total wire length = 23225813 um.
Total wire length on LAYER metal1 = 28521 um.
Total wire length on LAYER metal2 = 5210261 um.
Total wire length on LAYER metal3 = 6734777 um.
Total wire length on LAYER metal4 = 2525702 um.
Total wire length on LAYER metal5 = 3864860 um.
Total wire length on LAYER metal6 = 3436629 um.
Total wire length on LAYER metal7 = 787656 um.
Total wire length on LAYER metal8 = 637401 um.
Total wire length on LAYER metal9 = 0 um.
Total wire length on LAYER metal10 = 0 um.
Total number of vias = 5894660.
Up-via summary (total 5894660)
..
[INFO DRT-0267] cpu time = 03:08:44, elapsed time = 00:09:18, memory = 26350.10 (MB), peak = 27093.80 (MB)

Suggested Solution

It would be good to adjust the default groute routing resource calculation to better correlate with what detailed_route can route.

Additional Context

read_lef lef/Nangate.lef.gz
read_def def/bsg_chip.def.gz
set_routing_layers -signal metal2-metal8 -clock metal6-metal8
set_global_routing_layer_adjustment metal2-metal8 0.5
global_route -verbose
detailed_route -verbose 1

ispd24 download https://drive.google.com/drive/folders/1ocChoQupNxlLBH2hgqkPwR0-7D3ocTwm

maliberty commented 3 weeks ago

It is hard to know a priori what the right amount of derate is, even for a routing developer. Finding a reasonable value is part of PDK setup today. The autotuner is helpful in this regard. Do you have a thought on how to do this differently?

stefanottili commented 3 weeks ago

ispd19_test6 (detailed route contest) shows that the 'other' eda tools route guides wire length/via are very close to the achieved detailed routing. I'm don't know whether M1 was allowed "out of the box" or not.

In order to get a similar results out of OR, one has to reduce the groute resources by 100% on M1 and by 50% on the other layers.

Congrats to drt to be able to route violation free, considering the "bad" default global routing.

But the runtime of 2:15 hours default vs 0:22 guides vs 0:26 reduced shows that groute defaults need tuning. It seems that groute at least has to recognize that it shouldn't use M1 in stdcell areas.

I only have ispd19_test6 and ispd24 (nangate45) as datapoints. I'm curious whether there is a common theme here or whether these technologies are outliers.

reading guides generated by 'other' eda tool

[INFO DRT-0195] Start 0st optimization iteration.
Total wire length = 6569767 um.
Total wire length on LAYER Metal1 = 1898 um.
Total wire length on LAYER Metal2 = 1503573 um.
Total wire length on LAYER Metal3 = 2215783 um.
Total wire length on LAYER Metal4 = 1449000 um.
Total wire length on LAYER Metal5 = 507856 um.
Total wire length on LAYER Metal6 = 206744 um.
Total wire length on LAYER Metal7 = 349911 um.
Total wire length on LAYER Metal8 = 328675 um.
Total wire length on LAYER Metal9 = 6324 um.
Total number of vias = 1943698.
...
[INFO DRT-0195] Start 4th optimization iteration.
...
Total wire length = 6548693 um.
Total wire length on LAYER Metal1 = 1524 um.
Total wire length on LAYER Metal2 = 1493507 um.
Total wire length on LAYER Metal3 = 2203296 um.
Total wire length on LAYER Metal4 = 1451080 um.
Total wire length on LAYER Metal5 = 507659 um.
Total wire length on LAYER Metal6 = 206564 um.
Total wire length on LAYER Metal7 = 349936 um.
Total wire length on LAYER Metal8 = 328750 um.
Total wire length on LAYER Metal9 = 6371 um.
Total number of vias = 1927805.
...
[INFO DRT-0267] cpu time = 02:42:11, elapsed time = 00:22:18, memory = 7751.22 (MB), peak = 8392.83 (MB)

default groute M1-M9, 1.0 resources

[INFO GRT-0096] Final congestion report:
Layer         Resource        Demand        Usage (%)    Max H / Max V / Total Overflow
---------------------------------------------------------------------------------------
Metal1         4325352        334997            7.74%             0 /  0 /  0
Metal2         6389663       1689533           26.44%             0 /  0 /  0
Metal3         7416968       1440070           19.42%             0 /  0 /  0
Metal4         7400515        490346            6.63%             0 /  0 /  0
Metal5         4806384        156206            3.25%             0 /  0 /  0
Metal6         3316645         83303            2.51%             0 /  0 /  0
Metal7         4231056        120197            2.84%             0 /  0 /  0
Metal8         5578618         35332            0.63%             0 /  0 /  0
Metal9          799092          2030            0.25%             0 /  0 /  0
---------------------------------------------------------------------------------------
Total         44264293       4352014            9.83%             0 /  0 /  0

[INFO GRT-0018] Total wirelength: 8008272 um
...
[INFO DRT-0195] Start 0th optimization iteration.
[INFO DRT-0199]   Number of violations = 735178.
...
[INFO DRT-0195] Start 6th optimization iteration.
...
[INFO DRT-0198] Complete detail routing.
Total wire length = 6646430 um.
Total wire length on LAYER Metal1 = 22683 um.
Total wire length on LAYER Metal2 = 2271797 um.
Total wire length on LAYER Metal3 = 2651582 um.
Total wire length on LAYER Metal4 = 1078314 um.
Total wire length on LAYER Metal5 = 258148 um.
Total wire length on LAYER Metal6 = 125060 um.
Total wire length on LAYER Metal7 = 179893 um.
Total wire length on LAYER Metal8 = 55802 um.
Total wire length on LAYER Metal9 = 3148 um.
Total number of vias = 2195400.
...
[INFO DRT-0267] cpu time = 16:29:12, elapsed time = 02:15:07, memory = 5591.69 (MB), peak = 8202.78 (MB)

groute M2-M9, 0.5 resources

[INFO GRT-0096] Final congestion report:
Layer         Resource        Demand        Usage (%)    Max H / Max V / Total Overflow
---------------------------------------------------------------------------------------
Metal1               0             0            0.00%             0 /  0 /  0
Metal2         3044459       1187519           39.01%             0 /  0 /  0
Metal3         3461622       1248542           36.07%             0 /  0 /  0
Metal4         3453673        875168           25.34%             0 /  0 /  0
Metal5         2387378        520344           21.80%             0 /  0 /  0
Metal6         1423878        208702           14.66%             0 /  0 /  0
Metal7         1739772        242890           13.96%             0 /  0 /  0
Metal8         2391034         55816            2.33%             0 /  0 /  0
Metal9          798210         25373            3.18%             0 /  0 /  0
---------------------------------------------------------------------------------------
Total         18700026       4364354           23.34%             0 /  0 /  0
...
[INFO GRT-0018] Total wirelength: 8049547 um
...
[INFO DRT-0195] Start 0th optimization iteration.
[INFO DRT-0199]   Number of violations = 147226.
...
[INFO DRT-0195] Start 4th optimization iteration.
...
[INFO DRT-0198] Complete detail routing.
Total wire length = 6623925 um.
Total wire length on LAYER Metal1 = 3780 um.
Total wire length on LAYER Metal2 = 1805824 um.
Total wire length on LAYER Metal3 = 1900419 um.
Total wire length on LAYER Metal4 = 1330677 um.
Total wire length on LAYER Metal5 = 782192 um.
Total wire length on LAYER Metal6 = 312730 um.
Total wire length on LAYER Metal7 = 363853 um.
Total wire length on LAYER Metal8 = 86491 um.
Total wire length on LAYER Metal9 = 37957 um.
Total number of vias = 1948235.
...
[INFO DRT-0267] cpu time = 03:07:42, elapsed time = 00:26:02, memory = 7725.55 (MB), peak = 8040.28 (MB)
maliberty commented 3 weeks ago

Depending on the pdk's fill cells you might be able to do m1 routing in the unused sites. Most technologies benefit from some amount of derating but it is hard to make a general prediction.

I'm surprised to see so little impact of derating on total wire length. I would think the increased derating would lead to increased detouring.