Skip to content

pdn: throw error on missing grid when adding components instead of silent pass#10643

Open
gadfort wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
gadfort:pdn-error-on-missing-grid
Open

pdn: throw error on missing grid when adding components instead of silent pass#10643
gadfort wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
gadfort:pdn-error-on-missing-grid

Conversation

@gadfort

@gadfort gadfort commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Ensures the power grid definition will generate an error when an undefined grid is referenced. This avoids nasty PDN errors when typos appear in the grid component commands and there is no error.

Type of Change

  • Bug fix

Impact

For most users a warning will appear when a unused grid is created, but unless they have setup errors, there should be no change to the final result.

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).

…lent pass

Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
@gadfort gadfort requested a review from a team as a code owner June 12, 2026 00:26
@gadfort gadfort requested a review from maliberty June 12, 2026 00:26

@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 dummy instance grids to handle cases where no instances are found for a macro grid definition, preventing hard failures and instead issuing a warning. Key changes include the addition of the DummyInstanceGrid class, updates to grid retrieval and lookup methods to support dummy grids, and integration into the Tcl grid definition flow. Two critical issues were identified in the Tcl implementation: an invalid empty command evaluation [] used for list initialization, and a SWIG type mismatch caused by passing a list of domains instead of iterating over them individually.

Comment thread src/pdn/src/pdn.tcl Outdated
Comment thread src/pdn/src/pdn.tcl
Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
@gadfort

gadfort commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@maliberty can you take a look at this one?

@maliberty

Copy link
Copy Markdown
Member

@codex review

@maliberty

Copy link
Copy Markdown
Member

what is the purpose of the dummy grid?

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 770264bc97

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/pdn/src/pdn.tcl
Comment on lines +1125 to +1127
pdn::make_dummy_inst_grid \
$domains \
$keys(-name)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Create dummy grids per voltage domain

When a macro grid names multiple -voltage_domains and no matching/oriented instances are created, this passes the entire Tcl list in $domains to pdn::make_dummy_inst_grid, but the SWIG wrapper is declared to accept a single pdn::VoltageDomain* (PdnGen.i). The normal grid-creation path loops over each domain above, so this no-instance path should do the same; otherwise multi-domain PDN scripts hit a pointer-conversion error before the unused grid is recorded.

Useful? React with 👍 / 👎.

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