uvm_event_callback

UVMkit » 1800.2-2020

The uvm_event_callback class is an abstract class that is used to create callback objects which may be attached to uvm_event#(T)s.  To use, you derive a new class and override any or both pre_trigger and post_trigger.

Callbacks are an alternative to using processes that wait on events.  When a callback is attached to an event, that callback object’s callback function is called each time the event is triggered.

Summary
uvm_event_callback
The uvm_event_callback class is an abstract class that is used to create callback objects which may be attached to uvm_event#(T)s.
Class Hierarchy
uvm_event_callback
Class Declaration
virtual class uvm_event_callback#(
    type  T  =  uvm_object
) extends uvm_callback
Methods
newCreates a new callback object.
pre_triggerThis callback is called just before triggering the associated event.
post_triggerThis callback is called after triggering the associated event.

new

function new ( string  name  =  "" )

Creates a new callback object.

pre_trigger

virtual function bit pre_trigger ( uvm_event#(T)  e,
data )

This callback is called just before triggering the associated event.  In a derived class, override this method to implement any pre-trigger functionality.

If your callback returns 1, then the event will not trigger and the post-trigger callback is not called.  This provides a way for a callback to prevent the event from triggering.

In the function, e is the uvm_event#(T) that is being triggered, and data is the optional data associated with the event trigger.

post_trigger

virtual function void post_trigger ( uvm_event#(T)  e,
data )

This callback is called after triggering the associated event.  In a derived class, override this method to implement any post-trigger functionality.

In the function, e is the uvm_event#(T) that is being triggered, and data is the optional data associated with the event trigger.

virtual class uvm_void
The uvm_void class is the base class for all UVM classes.
virtual class uvm_object extends uvm_void
The uvm_object class is the base class for all UVM data and hierarchical classes.
class uvm_callback extends uvm_object
The uvm_callback class is the base class for user-defined callback classes.
virtual class uvm_event_callback#( type  T  =  uvm_object ) extends uvm_callback
The uvm_event_callback class is an abstract class that is used to create callback objects which may be attached to uvm_event#(T)s.
class uvm_event#( type  T  =  uvm_object ) extends uvm_event_base
This is an implementation of uvm_event#(T) as described in 1800.2 with the addition of API described below.
function new ( string  name  =  "" )
Creates a new callback object.
virtual function bit pre_trigger ( uvm_event#(T)  e,
data )
This callback is called just before triggering the associated event.
virtual function void post_trigger ( uvm_event#(T)  e,
data )
This callback is called after triggering the associated event.