verilator/test_regress/t/t_class_virtual_pure.v

32 lines
688 B
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2019 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
2020-08-24 02:27:25 +02:00
virtual class VBase;
2025-11-16 23:16:21 +01:00
pure virtual function int hello();
// See Issue #6698; appears IEEE illegal
// pure virtual task automatic fin();
pure virtual task fin();
endclass
2020-08-24 02:27:25 +02:00
class VA extends VBase;
2025-11-16 23:16:21 +01:00
virtual function int hello;
return 2;
endfunction
virtual task automatic fin;
$write("*-* All Finished *-*\n");
$finish;
endtask
2020-08-24 02:27:25 +02:00
endclass
module t;
2025-11-16 23:16:21 +01:00
initial begin
VA va;
va = new;
if (va.hello() != 2) $stop;
va.fin();
end
2020-08-24 02:27:25 +02:00
endmodule