Repository navigation
UHDM: a function-local UNPACKED array keeps one value per element -- st[0] ^ st[1] folded to 1 - #4206
Merged
alaindargelas merged 1 commit intoOct 4, 2026
Conversation
…`st[0] ^ st[1]` folded to 1 Bumps UHDM for chipsalliance/UHDM#1161: ExprEval's setValueInInstance found a function-local `reg [57:0] st [0:1]` through getObject and took the flat packed-vector path -- the variable's typespec is the ELEMENT's `[57:0]`, so each element assignment wrote ONE bit at position `index` and the element read it back as that bit: `st[0] ^ st[1]` folded to 1 (verilog-ethernet's lfsr_mask, and every constant function that stages a table in a local array). An array_var now stores per element in a param_assign/array_expr, the representation reduceExpr's bit_select case already reads. tests/FuncLocalArrayElemFold: direct, for-loop and while-loop element reads of a local array; every output folds to 64'h0300000000000001. Golden refresh: TfItemUnpackedLocal's `f0` now folds to 64'hC000000180000001, the XOR of its four table entries (was 1). Prepared with the assistance of Claude Code.
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.
Bumps UHDM to chipsalliance/UHDM#1161 (7c42de4).
ExprEval::setValueInInstancefound a function-localreg [57:0] st [0:1]throughgetObjectand took the flat packed-vector path: the variable's typespec is the ELEMENT's[57:0], so each element assignment wrote one bit at positionindexand the element read it back as that bit.st[0] ^ st[1]folded to 1 (verilog-ethernet'slfsr_mask, and every constant function that stages a table in a local array). Anarray_varnow stores per element in aparam_assign/array_expr, the representationreduceExpr's bit_select case already reads.Test:
tests/FuncLocalArrayElemFoldwith direct, for-loop and while-loop element reads of a local array; every output folds to64'h0300000000000001.Regression: 828 PASS / 1 DIFF / 0 FAIL. The one DIFF is the intended correction:
TfItemUnpackedLocal'sf0now folds to64'hC000000180000001, the XOR of its four table entries (was 1). Both goldens refreshed and${SURELOG_DIR}-normalized.Prepared with the assistance of Claude Code.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XshwvRJtjR5dA48M4b1CLM