Skip to content

Commit bee8b39

Browse files
authored
Merge pull request #1250 from diffblue/array_in_struct1
Verilog: KNOWNBUG test for arrays inside struct
2 parents e281a3d + 536ae2d commit bee8b39

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
KNOWNBUG
2+
array_in_struct1.sv
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
This fails in the typechecker.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module main;
2+
3+
struct {
4+
// unpacked
5+
int array1[4];
6+
7+
// packed
8+
bit [31:0] [3:0] array2;
9+
} s;
10+
11+
initial s = '{ '{ 1, 2, 3, 4 }, '{ 1, 2, 3, 4 } };
12+
13+
// Expected to pass.
14+
p0: assert property ($bits(s) == 4);
15+
p11: assert property (s.array1[0] == 1);
16+
p12: assert property (s.array1[1] == 2);
17+
p13: assert property (s.array1[2] == 3);
18+
p14: assert property (s.array1[3] == 4);
19+
p21: assert property (s.array2[0] == 1);
20+
p22: assert property (s.array2[1] == 2);
21+
p23: assert property (s.array2[2] == 3);
22+
p24: assert property (s.array2[3] == 4);
23+
24+
endmodule

0 commit comments

Comments
 (0)