The-OpenROAD-Project / OpenROAD-flow-scripts

OpenROAD's scripts implementing an RTL-to-GDS Flow. Documentation at https://openroad-flow-scripts.readthedocs.io/en/latest/
https://theopenroadproject.org/
Other
331 stars 288 forks source link

Timing extraction during generate_abstract is very slow. #940

Closed oharboe closed 1 year ago

oharboe commented 1 year ago

Description

Timing extraction during generate_abstract is very slow.

The PDN insertion performance has been improved, but still needs more work.

Rebase https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/pull/941 on master and run:

MOCK_ARRAY_WIDTH=32 MOCK_ARRAY_HEIGHT=32 MOCK_ARRAY_DATAWIDTH=64 MOCK_ARRAY_PITCH_SCALE=20 make DESIGN_CONFIG=designs/asap7/mock-array-big/config.mk floorplan
[deleted]
(/usr/bin/time -f 'Elapsed time: %E[h:]min:sec. CPU time: user %U sys %S (%P). Peak memory: %MKB.' /home/oyvind/ascenium/OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad -exit -no_init  ./scripts/pdn.tcl -metrics ./logs/asap7/mock-array-big/base/2_6_pdn.json) 2>&1 | tee ./logs/asap7/mock-array-big/base/2_6_pdn.log
[this step doesn't complete, even after hours]

PDN insertion will take a long time, to skip it and see if we can generate a mock abstract, press ctrl-c and run:

cp results/asap7/mock-array-big/base/2_5_floorplan_tapcell.odb results/asap7/mock-array-big/base/2_6_floorplan_pdn.odb
MOCK_ARRAY_WIDTH=32 MOCK_ARRAY_HEIGHT=32 MOCK_ARRAY_DATAWIDTH=64 MOCK_ARRAY_PITCH_SCALE=20 make DESIGN_CONFIG=designs/asap7/mock-array-big/config.mk generate_mock_abstract
[deleted]
(ABSTRACT_FROM=3_place /usr/bin/time -f 'Elapsed time: %E[h:]min:sec. CPU time: user %U sys %S (%P). Peak memory: %MKB.' /home/oyvind/ascenium/OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad -exit -no_init  ./scripts/generate_abstract.tcl -metrics ./logs/asap7/mock-array-big/base/generate_abstract.json ) 2>&1 | tee ./logs/asap7/mock-array-big/base/generate_abstract.log
OpenROAD v2.0-7374-ge18c0d570 
[takes a long time to complete]

Above we see .lib file extraction taking a long time. See the comment in this duplicate github issue for some investigations into slow .lib extraction: https://github.com/The-OpenROAD-Project/OpenROAD/issues/3069#issuecomment-1486721800

Suggested Solution

Optimize PDN and .lib file extraction so it runs faster.

Additional Context

No response

oharboe commented 1 year ago

@maliberty @tspyrou I've created and verified that the test-case linke to in this github issue can reproduce slow PDN insertion and .lib file creation. In both cases it looks like O(n^2) algorithms.

gadfort commented 1 year ago

@oharboe the PDN issue is the same as you identified before. It shouldn't be too difficult to go though and correct so the obstruction tree is only built once, but would just take a little bit of time on my part.

openroadie commented 1 year ago

@oharboe I believe this is handled by the latest STA integration. Could you please confirm ?

oharboe commented 1 year ago

@oharboe the PDN issue is the same as you identified before. It shouldn't be too difficult to go though and correct so the obstruction tree is only built once, but would just take a little bit of time on my part.

Yes. Thank you!