2013-10-29 00:41:05 +00:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
//
|
2020-03-21 15:24:24 +00:00
|
|
|
// 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
|
2013-10-29 00:41:05 +00:00
|
|
|
|
|
|
|
module x;
|
|
|
|
typedef struct {
|
2022-12-21 00:22:42 +00:00
|
|
|
int a, b;
|
|
|
|
logic [3:0] c;
|
|
|
|
} embedded_t;
|
2013-10-29 00:41:05 +00:00
|
|
|
|
2022-12-21 00:22:42 +00:00
|
|
|
typedef struct {
|
|
|
|
embedded_t b;
|
|
|
|
embedded_t tab [3:0];
|
|
|
|
} notembedded_t;
|
2013-10-29 00:41:05 +00:00
|
|
|
|
2022-12-21 00:22:42 +00:00
|
|
|
notembedded_t p;
|
|
|
|
embedded_t t [1:0];
|
2013-10-29 00:41:05 +00:00
|
|
|
|
|
|
|
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;
|
2013-10-29 00:41:05 +00:00
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
$finish;
|
|
|
|
end
|
|
|
|
endmodule
|