Hi all,
module
initial begin
event event_aa[int];
event e1;
fork
begin
#10ns;
event_aa[1] = e1;
end
forever begin
#1ns;
$display("xxx %0d", event_aa.num());
end
begin
wait(event_aa.num() != 0);
$display("yyy %0d", event_aa.num());
end
join_any
#10ns;
$finish;
end
endmodule
When I used the code snippet above, I found that the wait method is not triggered, but when I printed the output, I saw that event_aa.num() was equal to 1 at 10 ns. Why? The same situation applies to queues as well.
However, when I change the storage type to something else, such as int, everything goes back to normal (wait is triggered).
BR