feat(gen-verilog): resolve const-name array dimensions before codegen - #2402
Merged
Conversation
The second half of #2275 was one gate: dimensions spelled as const names ([NUM_MAC_UNITS]MACUnit) never parsed, parse_array_type wants digits, so the AoS declaration emitted a 32-bit reg plus a TODO and every element field access flattened to an unbound identifier. resolve_symbolic_dims substitutes integer-literal module consts into every type and dimension string once, before codegen: mac_units becomes reg [1343:0] with per-element part-select initializers and iverilog elaborates mac.v with ZERO errors for the first time. The folded zero initializer is exact for this literal (all fields zero). Blast radius measured first: 13 specs corpus-wide, 2 under specs/fpga; the 32-module yosys smoke stays 32/32. M5 performed. Closes #2275.
gHashTag
enabled auto-merge (squash)
August 22, 2026 10:56
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-08-22 10:57:32 UTC
Summary
Seal Status
|
gHashTag
added a commit
that referenced
this pull request
Aug 22, 2026
The Rust backend resolved .len() for ages; Verilog emitted the method call verbatim and iverilog rejected it -- arrays have no methods. One fold covers the three parse shapes the same source text produces (method-kind, call-over-field-access, qualified name); the receiver's length comes from the type registries through parse_array_type, with symbolic dims already resolved by the #2402 pass. mac self-test drops 13 -> 12 elaboration errors; class (2) of #2413 is dead. 32/32 yosys smoke unchanged. M5 performed. Refs #2413.
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.
Closes #2275. One pass unblocks the whole packed-array machinery for symbolic dims; mac.v elaborates with zero iverilog errors for the first time — the vvp lane's (#2241) blocker module is open. 32/32 yosys smoke; blast radius 13 specs measured before landing.
🤖 Generated with Claude Code