Tutorials
Learn More
Nonblocking Events
Refer to SystemVerilog Events before going through this section.
Non-blocking event is triggered using ->>
As discussed in an earlier example,
In case of waiting for an event using @ operator, an event will be missed if the event is triggered (using ->) at the same time as waiting for the event trigger.
The non-blocking event (using –>>) is triggered in the non-blocking region of the time slot. Ultimately, event triggering using ->> is a delayed version of the event triggering using ->. Hence, the process_B was waiting for the event using @ operator is completed as shown in the below example.
module event_example();
event e1;
task process_A();
$display("@%0t: process_A: Before triggering event e1 using ->>", $time);
->>e1;
$display("@%0t: process_A: After triggering event e1 using ->>", $time);
endtask
task process_B();
$display("@%0t: process_B: waiting for the event e1", $time);
@(e1.triggered);
$display("@%0t: process_B: event e1 is triggered", $time);
endtask
initial begin
fork
process_A();
process_B();
join
end
endmodule
Output:
@0: process_A: Before triggering event e1 using ->>
@0: process_A: After triggering event e1 using ->>
@0: process_B: waiting for the event e1
@0: process_B: event e1 is triggered
System Verilog Tutorials