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.41k stars 494 forks source link

mpl2: avoid checking nullptr LibertyCell #5256

Closed AcKoucher closed 1 week ago

AcKoucher commented 1 week ago

Resolve #1850

This solves the crash, but mpl2 stage only completes with the changes in #5255.

My suspicions are that these checks were there, because mpl2 used to get the instances area in micron from their LibertyCell. This was fixed in #5036.

github-actions[bot] commented 1 week ago

clang-tidy review says "All clean, LGTM! :+1:"

AcKoucher commented 1 week ago

Running CI

maliberty commented 1 week ago

How did the checks cause a crash?

AcKoucher commented 1 week ago

Sky130hd/chameleon has macros, and so mpl2 is not skipped, because unfixed_macros != 0

https://github.com/The-OpenROAD-Project/OpenROAD/blob/73ad7caa801b7f6d27100d38df2668031856bfef/src/mpl2/src/hier_rtlmp.cpp#L446-L456

However, on master, we only create the HardMacro objects and incorporate the metrics data if the LibertyCell* is not nullptr: https://github.com/The-OpenROAD-Project/OpenROAD/blob/73ad7caa801b7f6d27100d38df2668031856bfef/src/mpl2/src/hier_rtlmp.cpp#L674-L693

So mpl2 flow would go on with no macros to place which shouldn't happen. On #1850 log:


Traversed logical hierarchy
[...]
    Number of macros: 0
    Area of macros: 0.00
[...]
    Design Utilization: 0.00
    Core Utilization: 0.00
[...]