uvm_transaction

The uvm_transaction class is the root base class for UVM transactions.  Inheriting all the methods of uvm_object, uvm_transaction adds a timing and recording interface.

Use of the class uvm_transaction as a base for user-defined transactions is deprecated.  Its subtype, uvm_sequence_item, shall be used as the base class for all user-defined transaction types.

Summary
uvm_transaction
The uvm_transaction class is the root base class for UVM transactions.
Class Hierarchy
uvm_transaction
Class Declaration
virtual class uvm_transaction extends uvm_object
Methods
newCreates a new transaction object.
accept_trCalling accept_tr indicates that the transaction has been accepted for processing by a consumer component, such as an uvm_driver.
do_accept_trThis user-definable callback is called by accept_tr just before the accept event is triggered.
begin_trThis function indicates that the transaction has been started and is not the child of another transaction.
begin_child_trThis function indicates that the transaction has been started as a child of a parent transaction given by parent_handle.
do_begin_trThis user-definable callback is called by begin_tr and begin_child_tr just before the begin event is triggered.
end_trThis function indicates that the transaction execution has ended.
do_end_trThis user-definable callback is called by end_tr just before the end event is triggered.
get_tr_handleReturns the handle associated with the transaction, as set by a previous call to begin_child_tr or begin_tr with transaction recording enabled.
disable_recordingTurns off recording for the transaction stream.
enable_recordingTurns on recording to the stream specified by stream, whose interpretation is implementation specific.
is_recording_enabledReturns 1 if recording is currently on, 0 otherwise.
is_activeReturns 1 if the transaction has been started but has not yet been ended.
get_event_poolReturns the event pool associated with this transaction.
set_initiatorSets initiator as the initiator of this transaction.
get_initiatorReturns the component that produced or started the transaction, as set by a previous call to set_initiator.
get_accept_time
get_begin_time
get_end_timeReturns the time at which this transaction was accepted, begun, or ended, as by a previous call to accept_tr, begin_tr, begin_child_tr, or end_tr.
set_transaction_idSets this transaction’s numeric identifier to id.
get_transaction_idReturns this transaction’s numeric identifier, which is -1 if not set explicitly by set_transaction_id.
Variables
eventsThe event pool instance for this transaction.
begin_eventThe event that is triggered when transaction recording for this transaction begins.
end_eventThe event that is triggered when transaction recording for this transaction ends.

new

function new ( string  name  =  "",
uvm_component  initiator  =  null )

Creates a new transaction object.  The name is the instance name of the transaction.  If not supplied, then the object is unnamed.

accept_tr

function void accept_tr ( time  accept_time  =  )

Calling accept_tr indicates that the transaction has been accepted for processing by a consumer component, such as an uvm_driver.  With some protocols, the transaction may not be started immediately after it is accepted.  For example, a bus driver may have to wait for a bus grant before starting the transaction.

This function performs the following actions

  • The transaction’s internal accept time is set to the current simulation time, or to accept_time if provided and non-zero.  The accept_time may be any time, past or future.
  • The transaction’s internal accept event is triggered.  Any processes waiting on the this event will resume in the next delta cycle.
  • The do_accept_tr method is called to allow for any post-accept action in derived classes.

do_accept_tr

virtual protected function void do_accept_tr ()

This user-definable callback is called by accept_tr just before the accept event is triggered.  Implementations should call super.do_accept_tr to ensure correct operation.

begin_tr

function integer begin_tr ( time  begin_time  =  )

This function indicates that the transaction has been started and is not the child of another transaction.  Generally, a consumer component begins execution of the transactions it receives.

This function performs the following actions

  • The transaction’s internal start time is set to the current simulation time, or to begin_time if provided and non-zero.  The begin_time may be any time, past or future, but should not be less than the accept time.
  • If recording is enabled, then a new database-transaction is started with the same begin time as above.
  • The do_begin_tr method is called to allow for any post-begin action in derived classes.
  • The transaction’s internal begin event is triggered.  Any processes waiting on this event will resume in the next delta cycle.

The return value is a transaction handle, which is valid (non-zero) only if recording is enabled.  The meaning of the handle is implementation specific.

begin_child_tr

function integer begin_child_tr ( time  begin_time  =  0,
integer  parent_handle  =  0 )

This function indicates that the transaction has been started as a child of a parent transaction given by parent_handle.  Generally, a consumer component begins execution of the transactions it receives.

The parent handle is obtained by a previous call to begin_tr or begin_child_tr.  If the parent_handle is invalid (=0), then this function behaves the same as begin_tr.

This function performs the following actions

  • The transaction’s internal start time is set to the current simulation time, or to begin_time if provided and non-zero.  The begin_time may be any time, past or future, but should not be less than the accept time.
  • If recording is enabled, then a new database-transaction is started with the same begin time as above.  The record method inherited from uvm_object is then called, which records the current property values to this new transaction.  Finally, the newly started transaction is linked to the parent transaction given by parent_handle.
  • The do_begin_tr method is called to allow for any post-begin action in derived classes.
  • The transaction’s internal begin event is triggered.  Any processes waiting on this event will resume in the next delta cycle.

The return value is a transaction handle, which is valid (non-zero) only if recording is enabled.  The meaning of the handle is implementation specific.

do_begin_tr

virtual protected function void do_begin_tr ()

This user-definable callback is called by begin_tr and begin_child_tr just before the begin event is triggered.  Implementations should call super.do_begin_tr to ensure correct operation.

end_tr

function void end_tr ( time  end_time  =  0,
bit  free_handle  =  1 )

This function indicates that the transaction execution has ended.  Generally, a consumer component ends execution of the transactions it receives.

This function performs the following actions

  • The transaction’s internal end time is set to the current simulation time, or to end_time if provided and non-zero.  The end_time may be any time, past or future, but should not be less than the begin time.
  • If recording is enabled and a database-transaction is currently active, then the record method inherited from uvm_object is called, which records the final property values.  The transaction is then ended.  If free_handle is set, the transaction is released and can no longer be linked to (if supported by the implementation).
  • The do_end_tr method is called to allow for any post-end action in derived classes.
  • The transaction’s internal end event is triggered.  Any processes waiting on this event will resume in the next delta cycle.

do_end_tr

virtual protected function void do_end_tr ()

This user-definable callback is called by end_tr just before the end event is triggered.  Implementations should call super.do_end_tr to ensure correct operation.

get_tr_handle

function integer get_tr_handle ()

Returns the handle associated with the transaction, as set by a previous call to begin_child_tr or begin_tr with transaction recording enabled.

disable_recording

function void disable_recording ()

Turns off recording for the transaction stream.  This method does not effect a uvm_component’s recording streams.

enable_recording

function void enable_recording ( string  stream,   
uvm_recorder  recorder  =  null )

Turns on recording to the stream specified by stream, whose interpretation is implementation specific.  The optional recorder argument specifies

If transaction recording is on, then a call to record is made when the transaction is started and when it is ended.

is_recording_enabled

function bit is_recording_enabled()

Returns 1 if recording is currently on, 0 otherwise.

is_active

function bit is_active ()

Returns 1 if the transaction has been started but has not yet been ended.  Returns 0 if the transaction has not been started.

get_event_pool

function uvm_event_pool get_event_pool ()

Returns the event pool associated with this transaction.

By default, the event pool contains the events: begin, accept, and end.  Events can also be added by derivative objects.  An event pool is a specialization of an <uvm_pool #(T)>, e.g. a uvm_pool#(uvm_event).

set_initiator

function void set_initiator ( uvm_component  initiator )

Sets initiator as the initiator of this transaction.

The initiator can be the component that produces the transaction.  It can also be the component that started the transaction.  This or any other usage is up to the transaction designer.

get_initiator

function uvm_component get_initiator ()

Returns the component that produced or started the transaction, as set by a previous call to set_initiator.

get_accept_time

function time get_accept_time ()

get_begin_time

function time get_begin_time ()

get_end_time

function time get_end_time ()

Returns the time at which this transaction was accepted, begun, or ended, as by a previous call to accept_tr, begin_tr, begin_child_tr, or end_tr.

set_transaction_id

function void set_transaction_id( integer  id )

Sets this transaction’s numeric identifier to id.  If not set via this method, the transaction ID defaults to -1.

When using sequences to generate stimulus, the transaction ID is used along with the sequence ID to route responses in sequencers and to correlate responses to requests.

get_transaction_id

function integer get_transaction_id()

Returns this transaction’s numeric identifier, which is -1 if not set explicitly by set_transaction_id.

When using a uvm_sequence #(REQ,RSP) to generate stimulus, the transaction ID is used along with the sequence ID to route responses in sequencers and to correlate responses to requests.

events

const uvm_event_pool events = new

The event pool instance for this transaction.

begin_event

uvm_event begin_event

The event that is triggered when transaction recording for this transaction begins.

end_event

uvm_event end_event

The event that is triggered when transaction recording for this transaction ends.

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.
virtual class uvm_transaction extends uvm_object
The uvm_transaction class is the root base class for UVM transactions.
function new ( string  name  =  "",
uvm_component  initiator  =  null )
Creates a new transaction object.
function void accept_tr ( time  accept_time  =  )
Calling accept_tr indicates that the transaction has been accepted for processing by a consumer component, such as an uvm_driver.
virtual protected function void do_accept_tr ()
This user-definable callback is called by accept_tr just before the accept event is triggered.
function integer begin_tr ( time  begin_time  =  )
This function indicates that the transaction has been started and is not the child of another transaction.
function integer begin_child_tr ( time  begin_time  =  0,
integer  parent_handle  =  0 )
This function indicates that the transaction has been started as a child of a parent transaction given by parent_handle.
virtual protected function void do_begin_tr ()
This user-definable callback is called by begin_tr and begin_child_tr just before the begin event is triggered.
function void end_tr ( time  end_time  =  0,
bit  free_handle  =  1 )
This function indicates that the transaction execution has ended.
virtual protected function void do_end_tr ()
This user-definable callback is called by end_tr just before the end event is triggered.
function integer get_tr_handle ()
Returns the handle associated with the transaction, as set by a previous call to begin_child_tr or begin_tr with transaction recording enabled.
function void disable_recording ()
Turns off recording for the transaction stream.
function void enable_recording ( string  stream,   
uvm_recorder  recorder  =  null )
Turns on recording to the stream specified by stream, whose interpretation is implementation specific.
function bit is_recording_enabled()
Returns 1 if recording is currently on, 0 otherwise.
function bit is_active ()
Returns 1 if the transaction has been started but has not yet been ended.
function uvm_event_pool get_event_pool ()
Returns the event pool associated with this transaction.
function void set_initiator ( uvm_component  initiator )
Sets initiator as the initiator of this transaction.
function uvm_component get_initiator ()
Returns the component that produced or started the transaction, as set by a previous call to set_initiator.
function time get_accept_time ()
function time get_begin_time ()
function time get_end_time ()
Returns the time at which this transaction was accepted, begun, or ended, as by a previous call to accept_tr, begin_tr, begin_child_tr, or end_tr.
function void set_transaction_id( integer  id )
Sets this transaction’s numeric identifier to id.
function integer get_transaction_id()
Returns this transaction’s numeric identifier, which is -1 if not set explicitly by set_transaction_id.
const uvm_event_pool events = new
The event pool instance for this transaction.
uvm_event begin_event
The event that is triggered when transaction recording for this transaction begins.
uvm_event end_event
The event that is triggered when transaction recording for this transaction ends.
class uvm_sequence_item extends uvm_transaction
The base class for user-defined sequence items and also the base class for the uvm_sequence class.
virtual class uvm_component extends uvm_report_object
The uvm_component class is the root base class for UVM components.
virtual class uvm_sequence #(
    type  REQ  =  uvm_sequence_item,
    type  RSP  =  REQ
) extends uvm_sequence_base
The uvm_sequence class provides the interfaces necessary in order to create streams of sequence items and/or other sequences.