blob: 8df8e32b0bd5405562607568c4627cfc5a77ca73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package p;
typedef struct packed {
byte a;
byte b;
} p_t;
endpackage
module top;
typedef logic[7:0] t_t;
typedef struct packed {
bit a;
logic[7:0] b;
t_t t;
p::p_t ps;
} s_t;
s_t s;
s_t s1;
p::p_t ps;
assign s.a = '1;
assign s.b = '1;
assign s.t = 8'h55;
assign s1 = s;
assign ps.a = 8'hAA;
assign ps.b = 8'h55;
assign s.ps = ps;
always_comb begin
assert(s.a == 1'b1);
assert(s.b == 8'hFF);
assert(s.t == 8'h55);
assert(s1.t == 8'h55);
assert(ps.a == 8'hAA);
assert(ps.b == 8'h55);
assert(s.ps.a == 8'hAA);
assert(s.ps.b == 8'h55);
end
endmodule
|