J
Jason Zheng
Guest
I'm quite interested in various ways to retrigger events in verilog. So
I wrote a simple test code:
`timescale 1ns / 100ps
module test;
event bar;
always @ (bar) begin:foo_trig
foo_task;
end
task foo_task;
begin
#300 $display("%t... foo_task triggered", $stime);
end
endtask
initial
begin
repeat (16) begin
#50 disable foo_trig;
-> bar;
end
#5000 $finish;
end
endmodule // test
If all goes well, only the last ->bar will trigger foo_task, right?
I run this piece of code in 3 simulators, namely ncverilog, iverilog,
and cver. As it turns out, iverilog and cver didn't print anything. Only
ncverilog printed the result that I expected.
Disappointed, I changed the code a little bit:
repeat (16) begin
#49 disable foo_trig;
#1 -> bar;
end
Now all three simulators have the same result. It seems that iverilog
and cver are disabling foo_trig before ->bar takes place. My question is
: Is this a gray area in verilog language? Or is it a common bug shared
by iverilog and cver? Or is it a ncverilog bug? Comments?
cheers,
jz
I wrote a simple test code:
`timescale 1ns / 100ps
module test;
event bar;
always @ (bar) begin:foo_trig
foo_task;
end
task foo_task;
begin
#300 $display("%t... foo_task triggered", $stime);
end
endtask
initial
begin
repeat (16) begin
#50 disable foo_trig;
-> bar;
end
#5000 $finish;
end
endmodule // test
If all goes well, only the last ->bar will trigger foo_task, right?
I run this piece of code in 3 simulators, namely ncverilog, iverilog,
and cver. As it turns out, iverilog and cver didn't print anything. Only
ncverilog printed the result that I expected.
Disappointed, I changed the code a little bit:
repeat (16) begin
#49 disable foo_trig;
#1 -> bar;
end
Now all three simulators have the same result. It seems that iverilog
and cver are disabling foo_trig before ->bar takes place. My question is
: Is this a gray area in verilog language? Or is it a common bug shared
by iverilog and cver? Or is it a ncverilog bug? Comments?
cheers,
jz