mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-29 01:03:29 +02:00
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.
27 lines
411 B
Verilog
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
|