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

Support 2D bit arrays in structures. Optimise array indexing.

This commit is contained in:
Peter Crozier 2020-06-08 20:34:52 +01:00
parent 4ef9ee3c42
commit 01ec681373
2 changed files with 102 additions and 31 deletions

View file

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