module event_m;
event a;
initial
#1 -> a;
always
begin
wait(a.triggered);
$display(" EVENT A is triggered ");
//#1;
end
endmodule
When I comment #1 and execute, it goes to infinite loop and I don’t why it is going to infinite loop.
have gone through this conversation What difference between @event and wait (event.triggered) ? | Verification Academy
my understanding is both initial and always blocks starts execution at 0ns but the “event a” is triggering at 1ns in initial block. The always block also gets executes at 0ns but it will wait for that event up to 1ns, after that it will come out from the always block. then again it will get into the always block at 1ns it will wait for the “event a” but it is already occurred in previous time slot and it is no longer available. since it is a wait statement, it will wait until event occurs that’s why it is going to infinite loop. Is this correct understanding.