The uvm_event class is a wrapper class around the SystemVerilog event construct. It provides some additional services such as setting callbacks and maintaining the number of waiters.
|function new ( ||string
Creates a new event object.
|virtual task wait_on ( ||bit
Waits for the event to be activated for the first time.
If the event has already been triggered, this task returns immediately. If delta is set, the caller will be forced to wait a single delta #0 before returning. This prevents the caller from returning before previously waiting processes have had a chance to resume.
Once an event has been triggered, it will be remain “on” until the event is reset.
|virtual task wait_off ( ||bit
If the event has already triggered and is “on”, this task waits for the event to be turned “off” via a call to reset.
If the event has not already been triggered, this task returns immediately. If delta is set, the caller will be forced to wait a single delta #0 before returning. This prevents the caller from returning before previously waiting processes have had a chance to resume.
|virtual task wait_trigger ()
Waits for the event to be triggered.
If one process calls wait_trigger in the same delta as another process calls trigger, a race condition occurs. If the call to wait occurs before the trigger, this method will return in this delta. If the wait occurs after the trigger, this method will not return until the next trigger, which may never occur and thus cause deadlock.
|virtual task wait_ptrigger ()
Waits for a persistent trigger of the event. Unlike wait_trigger, this views the trigger as persistent within a given time-slice and thus avoids certain race conditions. If this method is called after the trigger but within the same time-slice, the caller returns immediately.
|virtual function void trigger ( ||uvm_object
Triggers the event, resuming all waiting processes.
An optional data argument can be supplied with the enable to provide trigger-specific information.
|virtual function uvm_object get_trigger_data ()
Gets the data, if any, provided by the last call to trigger.
|virtual function time get_trigger_time ()
Gets the time that this event was last triggered. If the event has not been triggered, or the event has been reset, then the trigger time will be 0.
|virtual function bit is_on ()
Indicates whether the event has been triggered since it was last reset.
A return of 1 indicates that the event has triggered.
|virtual function bit is_off ()
Indicates whether the event has been triggered or been reset.
A return of 1 indicates that the event has not been triggered.
|virtual function void reset ( ||bit
Resets the event to its off state. If wakeup is set, then all processes currently waiting for the event are activated before the reset.
No callbacks are called during a reset.
|virtual function void add_callback ( ||uvm_event_callback
Registers a callback object, cb, with this event. The callback object may include pre_trigger and post_trigger functionality. If append is set to 1, the default, cb is added to the back of the callback list. Otherwise, cb is placed at the front of the callback list.
|virtual function void delete_callback ( ||uvm_event_callback
Unregisters the given callback, cb, from this event.
|virtual function void cancel ()
Decrements the number of waiters on the event.
This is used if a process that is waiting on an event is disabled or activated by some other means.
|virtual function int get_num_waiters ()
Returns the number of processes waiting on the event.