mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 16:29:25 +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.
57 lines
799 B
Verilog
57 lines
799 B
Verilog
/*
|
|
* this test attempts to show a problem with the waits. This skip
|
|
* and skip2 modules should have identical behavior.
|
|
*/
|
|
|
|
module skip(r,a);
|
|
input r;
|
|
output a;
|
|
wire r;
|
|
reg a;
|
|
initial
|
|
a=0;
|
|
always begin
|
|
wait(r);
|
|
#1 a=1;
|
|
wait(!r);
|
|
#1 a=0;
|
|
end
|
|
endmodule
|
|
|
|
module skip2(r,a);
|
|
input r;
|
|
output a;
|
|
wire r;
|
|
reg a;
|
|
initial
|
|
a=0;
|
|
always @ (r or a) begin
|
|
case ({r,a})
|
|
00: ; // idle
|
|
10: #1 a=1;
|
|
11: ; // idle
|
|
01: #1 a=0;
|
|
endcase
|
|
end
|
|
endmodule
|
|
|
|
module test;
|
|
reg r1;
|
|
wire a1;
|
|
reg clk;
|
|
// skip2 skip1(r1,a1); // simulates as expected
|
|
skip skip1(r1,a1); // simulation hangs
|
|
|
|
always #50 clk= !clk;
|
|
|
|
initial begin
|
|
$monitor($time," ",r1,a1);
|
|
$display("starting");
|
|
#100 r1=0;
|
|
#100 r1=1;
|
|
wait(a1);
|
|
#100 r1=0;
|
|
#1000 $display("timeout"); $finish(0);
|
|
end
|
|
endmodule
|