Add initial support for array assignment patterns #953
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.
SystemVerilog allows to use assignment patterns to assign values to an
array. E.g.
int a[4] = '{1, 2, 3, 4}
.Each value is evaluated in the context of the element type of the array.
Nested assignment patterns are supported. E.g.
int a[2][2] = '{'{1, 2}, '{1, 2}};
Add initial support for array assignment patterns for both continuous as
well as procedural assignments.
For continuous assignments the assignment pattern is synthesized into an
array of nets. Each pin is connected to one of the assignment pattern
values and then the whole net array is connected to target array.
For procedural assignments it is unrolled in the vvp backend. E.g
effectively turning
a = '{1, 2};
intoa[0] = 1; a[1] = 2;
.Not yet supported are indexed initializers or
default
.E.g.
int a[10] = '{1:10, default: 20};
Resolves #562