[source]

Class uvm_pkg::uvm_event_callback

CLASS

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. 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.

Parameters

Name

Default value

Description

T

uvm_object

Constructors

new(string name = "")

Function

new

Creates a new callback object.

Parameters:

name (string)

Functions

pre_trigger(uvm_event#(uvm_object) e, uvm_object data)

Function

pre_trigger

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.

Parameters:
post_trigger(uvm_event#(uvm_object) e, uvm_object data)

Function

post_trigger

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.

Parameters:
create(string name = "")
Parameters:

name (string)

Return type:

uvm_object