Skip to content

pad: avoid segfault when pad placement is not possible#10605

Open
gadfort wants to merge 5 commits into
The-OpenROAD-Project:masterfrom
gadfort:pad-fix-segfault
Open

pad: avoid segfault when pad placement is not possible#10605
gadfort wants to merge 5 commits into
The-OpenROAD-Project:masterfrom
gadfort:pad-fix-segfault

Conversation

@gadfort

@gadfort gadfort commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Add check for non-convergence / non-progress and error out. And fix out of bound index

Type of Change

  • Bug fix

Impact

Avoids a segfault when entire row is blocked and exit early when placement is stuck.

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have included tests to prevent regressions.
  • I have signed my commits (DCO).

Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
@gadfort gadfort requested a review from a team as a code owner June 7, 2026 14:32
@gadfort gadfort requested a review from maliberty June 7, 2026 14:32
@github-actions github-actions Bot added the size/S label Jun 7, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes an off-by-one boundary check in pad spreading and adds convergence detection to identify when pad positions stop changing across iterations, logging an error and placing instances for debugging if legalization fails. A new test case, 'place_pads_uniform_fullyblocked', is also introduced. Feedback is provided to optimize the convergence check in 'PadPlacer.cpp' by using a 'std::vector' instead of creating and comparing 'odb::PtrMap's, which avoids significant allocation and lookup overhead in each iteration.

Comment thread src/pad/src/PadPlacer.cpp Outdated
gadfort added 4 commits June 7, 2026 16:07
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants