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:
parent
534be6670d
commit
76c499db71
3 changed files with 158 additions and 17 deletions
22
tests/svtypes/struct_array.sv
Normal file
22
tests/svtypes/struct_array.sv
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue