3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

Support packed arrays in struct/union.

This commit is contained in:
Peter Crozier 2020-06-07 18:28:45 +01:00
parent 534be6670d
commit 76c499db71
3 changed files with 158 additions and 17 deletions

View file

@ -0,0 +1,22 @@
// test for array indexing in structures
module top;
struct packed {
bit [5:0] [7:0] a; // 6 element packed array of bytes
bit [15:0] b; // filler for non-zero offset
} s;
initial begin
s = '0;
s.a[2:1] = 16'h1234;
s.a[5] = 8'h42;
s.b = '1;
s.b[1:0] = '0;
end
always_comb assert(s==64'h4200_0012_3400_FFFC);
endmodule