Files
iverilog/ivtest/ivltests/sv_root_class.v
T
Stephen Williams cea237b407 Add ivtest to the iverilog source tree
By adding ivtest to the iverilog source tree, it is easier to keep
the regression test synchronized with the source that is being tested.
This should be especially helpful for PRs that add a new feature, and
have a matching ivtest PR with the regression test for that feature.
2022-01-15 10:18:50 -08:00

27 lines
411 B
Verilog

class a_class;
int id_;
function new(int id);
id_ = id;
endfunction
task display();
$display("This is class %0d.", id_);
endtask
endclass
// This should print the following:
// This is class 2.
// This is class 1.
module top;
a_class ac1;
a_class ac2;
initial begin
ac1 = new(1);
ac2 = new(2);
ac2.display();
ac1.display();
end
endmodule