verilator/test_regress/t/t_struct_array_assignment_d...

36 lines
614 B
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain
// SPDX-FileCopyrightText: 2024 sumpster
// SPDX-License-Identifier: CC0-1.0
module tb;
2026-03-10 02:38:29 +01:00
typedef struct {
logic a;
logic b;
} SimpleStruct;
2026-03-10 02:38:29 +01:00
SimpleStruct s[1];
2026-03-10 02:38:29 +01:00
logic clock;
2026-03-10 02:38:29 +01:00
always @(posedge clock) begin
for (int i = 0; i < 1; i++) begin
s[i].a <= 1;
s[i].b <= 0;
end
2026-03-10 02:38:29 +01:00
end
2026-03-10 02:38:29 +01:00
initial begin
clock = 0;
s[0].a = 0;
s[0].b = 0;
2026-03-10 02:38:29 +01:00
#1 clock = 1;
#1 if (s[0].a != 1) $stop;
2026-03-10 02:38:29 +01:00
$write("*-* All Finished *-*\n");
$finish;
end
endmodule