Skip to content

update sta and add new regression to catch read_def with funny DEFs#10065

Closed
openroad-ci wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:update_sta_dsengupta
Closed

update sta and add new regression to catch read_def with funny DEFs#10065
openroad-ci wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:update_sta_dsengupta

Conversation

@openroad-ci

Copy link
Copy Markdown
Member

Summary

Reading a DEF with port names containing non-numeric bracket subscripts (e.g., kv_write[3][write_en]) crashes with a segfault. parseBusName uses rfind('[') to find the last left bracket, then calls std::stoi on the content. For kv_write[3][write_en], rfind finds the [ before write_en, and stoi("write_en]") throws an unhandled std::invalid_argument which terminates the process.

This occurs when externally-produced DEF files use multi-level bracket names where the innermost subscript is a field name rather than a numeric bus index.

Add an isdigit check on the first character after [ before calling stoi in both parseBusName overloads. Non-numeric subscripts like [write_en] are treated as non-bus names (is_bus = false), while ports with numeric trailing subscripts like kv_write[3][ write_entry][4] continue to parse and group correctly as bus kv_write[3][write_entry] with index 4.
This change is done inside src/sta/ParseBus.cc so OpenROAD needs to be updated to that STA. For OpenROAD itself, I added a regression to reproduce the issue and verify the STA fix

Type of Change

  • Bug fix

Impact

Fixes error when externally generated DEF files are read

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 signed my commits (DCO).

Related Issues

[Link issues here]

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>

@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 introduces a new integration test, read_def_bus_port, to verify that read_def correctly handles port names with non-numeric bus subscripts and properly groups numeric subscripts into buses. The changes include a new DEF file, a TCL test script, and a subproject commit update for sta. Feedback was provided to move the new test entry in CMakeLists.txt to maintain the alphabetical ordering of the integration tests.

Comment thread src/dbSta/test/CMakeLists.txt Outdated
Comment on lines +22 to +24
read_liberty1
read_vcd
read_def_bus_port

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.

medium

The integration tests in or_integration_tests are maintained in alphabetical order. read_def_bus_port should be moved before read_liberty1 to maintain this consistency.

    read_def_bus_port
    read_liberty1
    read_vcd

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.

Already resolved

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@dsengupta0628

Copy link
Copy Markdown
Contributor

@dsengupta0628

Copy link
Copy Markdown
Contributor

Update after new set of STA changes

@openroad-ci openroad-ci deleted the update_sta_dsengupta branch May 13, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants