dpl: fix power-rail detection in getMasterPwrs#10616
Conversation
Check rails with cell borders instead of using bbox centers. Previous code would incorrectly collapsed multi-box pins to the cell middle, instead of borders, mislabeling double-height cells. Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request refactors the getMasterPwrs function in src/dpl/src/infrastructure/network.cxx to improve power and ground rail detection. Instead of using the bounding box center of the MPins, it now evaluates individual routing-layer geometries to determine if they touch the cell's top or bottom boundaries. Feedback on this PR includes cleaning up a leftover comment fragment and improving the robustness of the boundary checks by ensuring the pin geometry actually intersects the cell boundaries rather than just checking one-sided inequalities.
| // rail. Only ROUTING-layer geometry counts, to ignore NWELL/PWELL implants | ||
| // encoded as POWER/GROUND pins on MASTERSLICE layers. | ||
| // layers) from polluting the rail detection. |
There was a problem hiding this comment.
There is a leftover comment fragment at the end of the block: // layers) from polluting the rail detection.. This appears to be a remnant from a previous edit. We should clean this up to make the comment grammatically correct and clear.
| // rail. Only ROUTING-layer geometry counts, to ignore NWELL/PWELL implants | |
| // encoded as POWER/GROUND pins on MASTERSLICE layers. | |
| // layers) from polluting the rail detection. | |
| // rail. Only ROUTING-layer geometry counts, to ignore NWELL/PWELL implants | |
| // (encoded as POWER/GROUND pins on MASTERSLICE layers) from polluting the | |
| // rail detection. |
| if (rect.yMin() <= y_cell_bot) { | ||
| (is_pwr ? bot_has_pwr : bot_has_gnd) = true; | ||
| } | ||
| if (rect.yMax() >= y_cell_top) { | ||
| (is_pwr ? top_has_pwr : top_has_gnd) = true; | ||
| } |
There was a problem hiding this comment.
To prevent potential false positives from out-of-bounds geometries (e.g., geometries completely below y_cell_bot or completely above y_cell_top), it is safer and more robust to verify that the pin geometry actually intersects or touches the respective boundary. This can be achieved by checking that the boundary coordinate lies within the [yMin, yMax] interval of the geometry.
| if (rect.yMin() <= y_cell_bot) { | |
| (is_pwr ? bot_has_pwr : bot_has_gnd) = true; | |
| } | |
| if (rect.yMax() >= y_cell_top) { | |
| (is_pwr ? top_has_pwr : top_has_gnd) = true; | |
| } | |
| if (rect.yMin() <= y_cell_bot && rect.yMax() >= y_cell_bot) { | |
| (is_pwr ? bot_has_pwr : bot_has_gnd) = true; | |
| } | |
| if (rect.yMin() <= y_cell_top && rect.yMax() >= y_cell_top) { | |
| (is_pwr ? top_has_pwr : top_has_gnd) = true; | |
| } |
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Check rails with cell borders instead of using bbox centers. Previous code would incorrectly collapsed multi-box pins to the cell middle, instead of borders, mislabeling double-height cells.
Type of Change
Impact
Private designs do not fail anymore.
Verification
./etc/Build.sh).