verilator/test_regress/t/t_struct_unpacked_clean.v

28 lines
522 B
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2023 Wilson Snyder
// SPDX-License-Identifier: CC0-1.0
2026-03-10 02:38:29 +01:00
typedef struct {logic [4:0] w5;} Data_t;
module t;
2026-03-10 02:38:29 +01:00
reg en;
reg [7:0] r_id;
2026-03-10 02:38:29 +01:00
Data_t ts;
2026-03-10 02:38:29 +01:00
initial begin
en = 1;
r_id = 42;
ts = '{w5: en ? r_id[4:0] : 5'b0};
2026-03-10 02:38:29 +01:00
$display("ts.w5 = %h", ts.w5);
if ($c32(ts.w5) != 5'h0a) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
endmodule