Fold interface-param struct-field generate condition (sub.CFG.HSK.DLY)#4117
Merged
alaindargelas merged 1 commit intoJul 15, 2026
Conversation
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>
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends resolveInterfacePortMember to resolve a NESTED struct-parameter field read through an interface port,
sub.CFG.HSK.DLY— whereCFGis a struct parameter of the interface and.HSK.DLYwalks its members. Previously only a direct 2-levelsub.<localparam>was handled; a deeper path stayed a non-constant hier_path, so a generate conditionif (sub.CFG.HSK.DLY == N)(orcase (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 byif (sub.CFG.HSK.DLY == 0/1)) and clears the EL0545 "Invalid generate case stmt value" on tcb_lite_lib_register_request'scase (sub.CFG.BUS.MOD)— the degu SoC now elaborates without error.New regression: tests/GenIfIfaceParamStructField. Full regression: 787 PASS, 0 fails.