2023-01-31 22:41:45 -05:00
// DESCRIPTION: Verilator: Verilog Test module
//
2026-01-26 20:24:34 -05:00
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2020 Wilson Snyder
2023-01-31 22:41:45 -05:00
// SPDX-License-Identifier: CC0-1.0
2026-03-08 18:26:40 -04:00
// verilog_format: off
2023-01-31 22:41:45 -05: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 18:26:40 -04:00
// verilog_format: on
2023-01-31 22:41:45 -05:00
2025-09-13 09:28:43 -04:00
module t ;
2023-01-31 22:41:45 -05:00
2026-03-08 18:26:40 -04:00
int a1 [] = '{ 12 , 13 };
int a2 [] = { 14 , 15 };
int a3 [] = '{ 16 };
int a4 [] = { 17 };
int a5 [] = {};
2023-01-31 22:41:45 -05:00
2026-03-08 18:26:40 -04:00
initial begin
`checkh ( a1 . size , 2 );
`checkh ( a1 [ 0 ], 12 );
`checkh ( a1 [ 1 ], 13 );
2023-01-31 22:41:45 -05:00
2026-03-08 18:26:40 -04:00
`checkh ( a2 . size , 2 );
`checkh ( a2 [ 0 ], 14 );
`checkh ( a2 [ 1 ], 15 );
2023-01-31 22:41:45 -05:00
2026-03-08 18:26:40 -04:00
`checkh ( a3 . size , 1 );
`checkh ( a3 [ 0 ], 16 );
2023-01-31 22:41:45 -05:00
2026-03-08 18:26:40 -04:00
`checkh ( a4 . size , 1 );
`checkh ( a4 [ 0 ], 17 );
2023-01-31 22:41:45 -05:00
2026-03-08 18:26:40 -04:00
`checkh ( a5 . size , 0 );
2024-04-18 18:53:23 +02:00
2026-03-08 18:26:40 -04:00
$write ( "*-* All Finished *-* \n " );
$finish ;
end
2023-01-31 22:41:45 -05:00
endmodule