uvm event wait_ptrigger
Table of Contents
wait ptrigger example
event trigger and wait for event trigger at the same time
As seen in the previous example, triggering the event and waiting for event trigger with wait_trigger leads to race conditions and the event trigger will not get detected.
UVM_Event provides wait_ptrigger to overcome race conditions.
Below is the example with wait_ptrigger.
module uvm_events_ex;
uvm_event ev_1; //declaring uvm_event ev_1
initial begin
ev_1 = new(); //Creating the event
fork
//process-1, triggers the event
begin
$display($time," Triggering The Event");
ev_1.trigger;
end
//process-2, wait for the event to trigger
begin
$display($time," Waiting for the Event to trigger");
ev_1.wait_ptrigger;
$display($time," Event triggered");
end
join
end
initial begin
#100;
$display($time," Ending the Simulation");
$finish;
end
endmodule
Simulator Output
0 Triggering The Event 0 Waiting for the Event to trigger 0 Event triggered 100 Ending the Simulation
