Event Triggering

Hi
Can some one tell me the exact difference between “event.triggered” and the “wait(event.triggered)” with an example

triggered is a method by which, we can come to know whether that event is triggered or not. It is a function which is going to return 1 or 0 depending on the triggering.

1 - if event is triggered
0 - ifevent is not triggered.

It is a non-blocking which checks whether event is triggered or not.

To know, whether event is trgiggered or not, use the following snippet.


bit trigger;
event ev;

// some delay and logic
trigger = ev.triggered();
if(trigger)
       $display("event is triggered");
else
       $display("event is not triggered");

Wait(event.triggered) statement gets blocked until it evaluates to TRUE. Meaning that, wait statement will block the execution of the next statements. If some task has to be done after triggering event of a named event, you can use the following snippet.


wait(ev.triggered());
//do something

In reply to puttasatish:

Correct Explanation