Skip to content

Fold interface-param struct-field generate condition (sub.CFG.HSK.DLY)#4117

Merged
alaindargelas merged 1 commit into
chipsalliance:masterfrom
alainmarcel:fix-iface-param-struct-field-gencond
Jul 15, 2026
Merged

Fold interface-param struct-field generate condition (sub.CFG.HSK.DLY)#4117
alaindargelas merged 1 commit into
chipsalliance:masterfrom
alainmarcel:fix-iface-param-struct-field-gencond

Conversation

@alaindargelas

Copy link
Copy Markdown
Collaborator

Extends resolveInterfacePortMember to resolve a NESTED struct-parameter field read through an interface port, sub.CFG.HSK.DLY — where CFG is a struct parameter of the interface and .HSK.DLY walks its members. Previously only a direct 2-level sub.<localparam> was handled; a deeper path stayed a non-constant hier_path, so a generate condition if (sub.CFG.HSK.DLY == N) (or case (sub.CFG.BUS.MOD)) could not fold and the branch was dropped.

For a multi-level member the helper now builds a sub-path from the member elements (dropping the interface-port base) and decodes it via decodeHierPath in the interface DEFINITION's context, where the struct-parameter-field navigation resolves it to a constant. The interface instance is not bound to the port at generate-elaboration time, so the type-definition params (default/overridden) are used.

This drives the jeras/rp32 demultiplexer response select (rsp_sel, guarded by if (sub.CFG.HSK.DLY == 0/1)) and clears the EL0545 "Invalid generate case stmt value" on tcb_lite_lib_register_request's case (sub.CFG.BUS.MOD) — the degu SoC now elaborates without error.

New regression: tests/GenIfIfaceParamStructField. Full regression: 787 PASS, 0 fails.

Extends resolveInterfacePortMember to resolve a NESTED struct-parameter field
read through an interface port, `sub.CFG.HSK.DLY` — where `CFG` is a struct
parameter of the interface and `.HSK.DLY` walks its members.  Previously only a
direct 2-level `sub.<localparam>` was handled; a deeper path stayed a
non-constant hier_path, so a generate condition `if (sub.CFG.HSK.DLY == N)` (or
`case (sub.CFG.BUS.MOD)`) could not fold and the branch was dropped.

For a multi-level member the helper now builds a sub-path from the member
elements (dropping the interface-port base) and decodes it via decodeHierPath in
the interface DEFINITION's context, where the struct-parameter-field navigation
resolves it to a constant.  The interface instance is not bound to the port at
generate-elaboration time, so the type-definition params (default/overridden)
are used.

This drives the jeras/rp32 demultiplexer response select (`rsp_sel`, guarded by
`if (sub.CFG.HSK.DLY == 0/1)`) and clears the EL0545 "Invalid generate case
stmt value" on tcb_lite_lib_register_request's `case (sub.CFG.BUS.MOD)` — the
degu SoC now elaborates without error.

New regression: tests/GenIfIfaceParamStructField.  Full regression: 787 PASS, 0 fails.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alaindargelas
alaindargelas merged commit cbdbea4 into chipsalliance:master Jul 15, 2026
6 of 14 checks passed
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Missing ID

  • ✅ login: alaindargelas / name: alaindargelas (c56ea78)
  • ❌ The email address for the commit (c56ea78) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please visit our EasyCLA portal and chat with our support bot.

One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via:

Co-authored-by: name <email>

Supported Co-authored-by: formats include:

  1. Anything <id+login@users.noreply.github.com> - it will locate your GitHub user by id part.
  2. Anything <login@users.noreply.github.com> - it will locate your GitHub user by login part.
  3. Anything <public-email> - it will locate your GitHub user by public-email part. Note that this email must be made public on Github.
  4. Anything <other-email> - it will locate your GitHub user by other-email part but only if that email was used before for any other CLA as a main commit author.
  5. login <any-valid-email> - it will locate your GitHub user by login part, note that login part must be at least 3 characters long.

Alternatively, if the co-author should not be included, remove the Co-authored-by: line from the commit message.

Please update your commit message(s) by doing git commit --amend and then git push [--force] and then request re-running CLA check via commenting on this pull request:

/easycla

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.

1 participant