verilator/test_regress/t/t_struct_unpacked.v

30 lines
615 B
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2009 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module x;
typedef struct {
2022-12-21 00:22:42 +00:00
int a, b;
logic [3:0] c;
} embedded_t;
2022-12-21 00:22:42 +00:00
typedef struct {
embedded_t b;
embedded_t tab [3:0];
} notembedded_t;
2022-12-21 00:22:42 +00:00
notembedded_t p;
embedded_t t [1:0];
initial begin
2022-12-21 00:22:42 +00:00
t[1].a = 2;
p.b.a = 1;
if (t[1].a != 2) $stop;
if (p.b.a != 1) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
endmodule