Repository navigation
fix(sv): resolve constant functions in unpacked array dimensions - #1612
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merge Queue Status
This pull request spent 1 hour 49 minutes 58 seconds in the queue, with no time running CI. ReasonPull request #1612 has been dequeued Queue conditions are not satisfied:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Requeued — the merge queue status continues in this comment ↓. |
Unpacked dimensions such as `logic [7:0] v [f(1)]` passed analysis but failed during lowering because the analyzer's constant-function environment was no longer available. Retain the evaluated bounds in analyzer IR and use them when constructing signal layouts and procedural array bounds. Keep the original expressions for declaration contracts and later specialization. Add shared regressions for module-local, imported and qualified package functions, multidimensional and negative ranges, and parameterized array ports with loop-based constant functions. Verify that symbolic contracts remain available after publishing their resolved bounds. Fixes #1438. Validation on the current master base: - Analyzer: 753 passed; 3 existing ignores; 2 doctests passed. - Frontend unit test passed. SV integration: 3,001 passed; 90 existing ignores, including all 10 added shared-case execution variants. - Formatting, analyzer/frontend/suite Clippy with warnings denied, and diff checks pass. - The unchanged shared cases previously passed both Verilator and Icarus (2 each); external simulation was not repeated for this rebase. The rebase retained both master's timed-task analyzer regressions and this change's unpacked-bound regression at their shared insertion point. Change-Id: I088feda3ff78b7b924ef3a06d394f2a26c39ffa9
3af7a10 to
89d92d7
Compare
Revision history
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89d92d7889
ℹ️ 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".
| constants, | ||
| parameter_types, | ||
| )) | ||
| .or_else(|| range.resolved_bounds()) |
There was a problem hiding this comment.
Avoid multiplying cached unpacked widths twice
When both a packed range and an unpacked range call user constant functions (for example, logic [word_width()-1:0] data [depth()]), this fallback lets the unpacked range proceed, but signal_type_from_sv still falls back to typ.resolved_width() for the unresolved packed range. That value already includes every unpacked dimension, and the function subsequently multiplies it by array_dims again, so an 8-bit, depth-2 array is lowered as 32 bits instead of 16 and can silently corrupt layout and indexing. Preserve a packed-only resolved width or resolved packed bounds rather than using the type's total width.
Useful? React with 👍 / 👎.
Merge Queue Status
This pull request spent 2 hours 16 minutes 19 seconds in the queue, including 1 hour 58 seconds running CI. Required conditions to merge
|
Unpacked dimensions such as
logic [7:0] v [f(1)]passed analysis butfailed during lowering because the analyzer's constant-function environment
was no longer available. Retain the evaluated bounds in analyzer IR and use
them when constructing signal layouts and procedural array bounds. Keep the
original expressions for declaration contracts and later specialization.
Add shared regressions for module-local, imported and qualified package
functions, multidimensional and negative ranges, and parameterized array
ports with loop-based constant functions. Verify that symbolic contracts
remain available after publishing their resolved bounds.
Fixes #1438.
Validation on the current master base:
ignores, including all 10 added shared-case execution variants.
checks pass.
(2 each); external simulation was not repeated for this rebase.
The rebase retained both master's timed-task analyzer regressions and this
change's unpacked-bound regression at their shared insertion point.