verilator/test_regress/t/t_program_anonymous.v

35 lines
549 B
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2022 Wilson Snyder
// SPDX-License-Identifier: CC0-1.0
program;
2026-03-08 23:26:40 +01:00
task atask;
endtask
function int afunc(input int i);
return i+1;
endfunction
class acls;
2026-03-08 23:26:40 +01:00
static int i = 10;
endclass
endprogram
program t;
2026-03-08 23:26:40 +01:00
int i;
2026-03-08 23:26:40 +01:00
initial begin
atask();
2026-03-08 23:26:40 +01:00
i = afunc(2);
if (i != 3) $stop;
2026-03-08 23:26:40 +01:00
if (acls::i != 10) $stop;
2026-03-08 23:26:40 +01:00
$write("*-* All Finished *-*\n");
$finish;
end
endprogram