Verilog: arrays of module instances - #2125
Merged
Merged
Conversation
This adds support for arrays of module instances (1800-2017 23.3.2), including multi-dimensional ones. Each element of the array gets its own module instance symbol, and the port connections are split over the elements as required by 1800-2017 23.3.3: connections that match the port are replicated to all elements, wider vector connections are split bit-wise with the most significant bits going to the element with the leftmost index, and unpacked array connections are split element-wise. Hierarchical references into the elements of an instance array are supported.
2 tasks
tautschnig
approved these changes
Sep 6, 2026
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.
Summary
This adds support for arrays of module instances (IEEE 1800-2017 23.3.2), including multi-dimensional ones.
s[3]...s[0]forsub s[3:0](...)), plus a symbol for the array itself, which is used to resolve hierarchical references into the elements.defparamonto individual elements works via the element identifiers.my_instance[1].i,c[1][2].o) are resolved by the type checker, including multi-dimensional selects.Test plan
regression/verilog/modules/instance_array1: multi-dimensional instance array with element-wise unpacked connections (was a rejection test, now CORE with properties)regression/verilog/modules/instance_array2: bit-wise splitting with[8:1]range and hierarchical references (was KNOWNBUG, now CORE)regression/verilog/modules/instance_array3(new): named port connections, replication, and bit-wise splitting of a wide connectionregression/verilog/modules/instance_array4(new): error for connections that cannot be split