2025-08-18 14:51:25 +02:00
// DESCRIPTION: Verilator: Verilog Test module
//
2026-01-27 02:24:34 +01:00
// This file ONLY is placed under the Creative Commons Public Domain
// SPDX-FileCopyrightText: 2025 Antmicro
2025-08-18 14:51:25 +02:00
// SPDX-License-Identifier: CC0-1.0
2025-12-21 03:46:43 +01:00
// verilog_format: off
2025-08-18 14:51:25 +02: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);
2025-12-21 03:46:43 +01:00
// verilog_format: on
2025-08-18 14:51:25 +02:00
2025-12-21 03:46:43 +01:00
module m ( ) ;
2025-08-18 14:51:25 +02:00
class c ;
static function void fstatic ( ) ;
`checkh ( v , 42 ) ;
v + + ;
endfunction
function void fnonstatic ( ) ;
`checkh ( v , 43 ) ;
v + + ;
endfunction
endclass
c classinst ;
int v ;
initial begin
2025-12-21 03:46:43 +01:00
v = 42 ;
2025-08-18 14:51:25 +02:00
`checkh ( v , 42 ) ;
c : : fstatic ( ) ;
classinst = new ( ) ;
classinst . fnonstatic ( ) ;
`checkh ( v , 44 ) ;
$finish ;
end
endmodule