verilator/test_regress/t/t_dynarray_unpacked.v

35 lines
856 B
Systemverilog
Raw Normal View History

2020-12-13 02:56:35 +01:00
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2020 Wilson Snyder
2020-12-13 02:56:35 +01:00
// SPDX-License-Identifier: CC0-1.0
2026-03-08 23:26:40 +01:00
// verilog_format: off
2020-12-13 02:56:35 +01:00
`define stop $stop
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0)
2026-03-08 23:26:40 +01:00
// verilog_format: on
2020-12-13 02:56:35 +01:00
module t;
2020-12-13 02:56:35 +01:00
2026-03-08 23:26:40 +01:00
byte dyn[][1:0];
2020-12-13 02:56:35 +01:00
2026-03-08 23:26:40 +01:00
initial begin
begin
dyn = new[3];
dyn[0] = '{101, 100};
dyn[1] = '{111, 110};
dyn[2] = '{121, 120};
`checkh(dyn[0][0], 100);
`checkh(dyn[0][1], 101);
`checkh(dyn[1][0], 110);
`checkh(dyn[1][1], 111);
`checkh(dyn[2][0], 120);
`checkh(dyn[2][1], 121);
end
2020-12-13 02:56:35 +01:00
2026-03-08 23:26:40 +01:00
$write("*-* All Finished *-*\n");
$finish;
end
2020-12-13 02:56:35 +01:00
endmodule