mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 05:47:31 +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.
37 lines
506 B
Verilog
37 lines
506 B
Verilog
module test();
|
|
|
|
reg clk;
|
|
reg [1:0] state;
|
|
|
|
always begin
|
|
case (state)
|
|
0 : state = 1;
|
|
1 : state = 2;
|
|
default : /* do nothing */ ;
|
|
endcase
|
|
@(posedge clk);
|
|
end
|
|
|
|
reg failed = 0;
|
|
|
|
initial begin
|
|
clk = 0;
|
|
state = 0;
|
|
#1 clk = 1;
|
|
#1 clk = 0;
|
|
if (state !== 1) failed = 1;
|
|
#1 clk = 1;
|
|
#1 clk = 0;
|
|
if (state !== 2) failed = 1;
|
|
#1 clk = 1;
|
|
#1 clk = 0;
|
|
if (state !== 2) failed = 1;
|
|
|
|
if (failed)
|
|
$display("FAILED");
|
|
else
|
|
$display("PASSED");
|
|
end
|
|
|
|
endmodule
|