pdn: throw error on missing grid when adding components instead of silent pass#10643
pdn: throw error on missing grid when adding components instead of silent pass#10643gadfort wants to merge 2 commits into
Conversation
…lent pass Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
There was a problem hiding this comment.
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.
Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
|
@maliberty can you take a look at this one? |
|
@codex review |
|
what is the purpose of the dummy grid? |
There was a problem hiding this comment.
💡 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".
| pdn::make_dummy_inst_grid \ | ||
| $domains \ | ||
| $keys(-name) |
There was a problem hiding this comment.
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 👍 / 👎.
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
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
./etc/Build.sh).