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.
uvm_event | ||||
The uvm_event class is a wrapper class around the SystemVerilog event construct. | ||||
Class Hierarchy | ||||
| ||||
Class Declaration | ||||
| ||||
Methods | ||||
new | Creates a new event object. | |||
wait_on | Waits for the event to be activated for the first time. | |||
wait_off | If the event has already triggered and is “on”, this task waits for the event to be turned “off” via a call to reset. | |||
wait_trigger | Waits for the event to be triggered. | |||
wait_ptrigger | Waits for a persistent trigger of the event. | |||
wait_trigger_data | This method calls wait_trigger followed by get_trigger_data. | |||
wait_ptrigger_data | This method calls wait_ptrigger followed by get_trigger_data. | |||
trigger | Triggers the event, resuming all waiting processes. | |||
get_trigger_data | Gets the data, if any, provided by the last call to trigger. | |||
get_trigger_time | Gets the time that this event was last triggered. | |||
is_on | Indicates whether the event has been triggered since it was last reset. | |||
is_off | Indicates whether the event has been triggered or been reset. | |||
reset | Resets the event to its off state. | |||
add_callback | Registers a callback object, cb, with this event. | |||
delete_callback | Unregisters the given callback, cb, from this event. | |||
cancel | Decrements the number of waiters on the event. | |||
get_num_waiters | Returns the number of processes waiting on the event. |
virtual task wait_on ( bit delta = )
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 delta = )
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 task wait_trigger_data ( output uvm_object data )
This method calls wait_trigger followed by get_trigger_data.
virtual task wait_ptrigger_data ( output uvm_object data )
This method calls wait_ptrigger followed by get_trigger_data.
virtual function void trigger ( uvm_object data = null )
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 wakeup = )
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 cb, bit append = 1 )
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 cb )
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.
The uvm_object class is the base class for all UVM data and hierarchical classes.
virtual class uvm_object extends uvm_void
The uvm_event class is a wrapper class around the SystemVerilog event construct.
class uvm_event extends uvm_object
Creates a new event object.
function new ( string name = "" )
Waits for the event to be activated for the first time.
virtual task wait_on ( bit delta = )
If the event has already triggered and is “on”, this task waits for the event to be turned “off” via a call to reset.
virtual task wait_off ( bit delta = )
Resets the event to its off state.
virtual function void reset ( bit wakeup = )
Waits for the event to be triggered.
virtual task wait_trigger ()
Waits for a persistent trigger of the event.
virtual task wait_ptrigger ()
This method calls wait_trigger followed by get_trigger_data.
virtual task wait_trigger_data ( output uvm_object data )
Gets the data, if any, provided by the last call to trigger.
virtual function uvm_object get_trigger_data ()
This method calls wait_ptrigger followed by get_trigger_data.
virtual task wait_ptrigger_data ( output uvm_object data )
Triggers the event, resuming all waiting processes.
virtual function void trigger ( uvm_object data = null )
Gets the time that this event was last triggered.
virtual function time get_trigger_time ()
Indicates whether the event has been triggered since it was last reset.
virtual function bit is_on ()
Indicates whether the event has been triggered or been reset.
virtual function bit is_off ()
Registers a callback object, cb, with this event.
virtual function void add_callback ( uvm_event_callback cb, bit append = 1 )
Unregisters the given callback, cb, from this event.
virtual function void delete_callback ( uvm_event_callback cb )
Decrements the number of waiters on the event.
virtual function void cancel ()
Returns the number of processes waiting on the event.
virtual function int get_num_waiters ()