ovm_sequence_item

The base class for user-defined sequence items and also the base class for the ovm_sequence class.  The ovm_sequence_item class provides the basic functionality for objects, both sequence items and sequences, to operate in the sequence mechanism.

Summary
ovm_sequence_item
The base class for user-defined sequence items and also the base class for the ovm_sequence class.
Class Hierarchy
ovm_sequence_item
Class Declaration
class ovm_sequence_item extends ovm_transaction
Methods
newThe constructor method for ovm_sequence_item.
get_sequence_idprivate
set_use_sequence_info
get_use_sequence_infoThese methods are used to set and get the status of the use_sequence_info bit.
set_id_infoCopies the sequence_id and transaction_id from the referenced item into the calling item.
set_sequencer
get_sequencerThese routines set and get the reference to the sequencer to which this sequence_item communicates.
set_parent_sequenceSets the parent sequence of this sequence_item.
get_parent_sequenceReturns a reference to the parent sequence of any sequence on which this method was called.
set_depthThe depth of any sequence is calculated automatically.
get_depthReturns the depth of a sequence from it’s parent.
is_itemThis function may be called on any sequence_item or sequence.
start_itemstart_item and finish_item together will initiate operation of either a sequence_item or sequence object.
finish_itemfinish_item, together with start_item together will initiate operation of either a sequence_item or sequence object.
get_root_sequence_nameProvides the name of the root sequence (the top-most parent sequence).
get_root_sequenceProvides a reference to the root sequence (the top-most parent sequence).
get_sequence_pathProvides a string of names of each sequence in the full hierarchical path.

new

function new (string name =  "ovm_sequence_item",
ovm_sequencer_base sequencer =  null,
ovm_sequence_base parent_sequence =  null)

The constructor method for ovm_sequence_item.  The sequencer and parent_sequence may be specified in the constructor, or directly using ovm_sequence_item methods.

get_sequence_id

function int get_sequence_id()

private

Get_sequence_id is an internal method that is not intended for user code.  The sequence_id is not a simple integer.  The get_transaction_id is meant for users to identify specific transactions.

These methods allow access to the sequence_item sequence and transaction IDs. get_transaction_id and set_transaction_id are methods on the ovm_transaction base_class.  These IDs are used to identify sequences to the sequencer, to route responses back to the sequence that issued a request, and to uniquely identify transactions.

The sequence_id is assigned automatically by a sequencer when a sequence initiates communication through any sequencer calls (i.e.  `ovm_do_xxx, wait_for_grant).  A sequence_id will remain unique for this sequence until it ends or it is killed.  However, a single sequence may have multiple valid sequence ids at any point in time.  Should a sequence start again after it has ended, it will be given a new unique sequence_id.

The transaction_id is assigned automatically by the sequence each time a transaction is sent to the sequencer with the transaction_id in its default (-1) value.  If the user sets the transaction_id to any non-default value, that value will be maintained.

Responses are routed back to this sequences based on sequence_id.  The sequence may use the transaction_id to correlate responses with their requests.

set_use_sequence_info

function void set_use_sequence_info(bit value)

get_use_sequence_info

function bit get_use_sequence_info()

These methods are used to set and get the status of the use_sequence_info bit.  Use_sequence_info controls whether the sequence information (sequencer, parent_sequence, sequence_id, etc.) is printed, copied, or recorded.  When use_sequence_info is the default value of 0, then the sequence information is not used.  When use_sequence_info is set to 1, the sequence information will be used in printing and copying.

set_id_info

function void set_id_info(ovm_sequence_item item)

Copies the sequence_id and transaction_id from the referenced item into the calling item.  This routine should always be used by drivers to initialize responses for future compatibility.

set_sequencer

function void set_sequencer(ovm_sequencer_base sequencer)

get_sequencer

function ovm_sequencer_base get_sequencer()

These routines set and get the reference to the sequencer to which this sequence_item communicates.

set_parent_sequence

function void set_parent_sequence(ovm_sequence_base parent)

Sets the parent sequence of this sequence_item.  This is used to identify the source sequence of a sequence_item.

get_parent_sequence

function ovm_sequence_base get_parent_sequence()

Returns a reference to the parent sequence of any sequence on which this method was called.  If this is a parent sequence, the method returns null.

set_depth

function void set_depth(int value)

The depth of any sequence is calculated automatically.  However, the user may use set_depth to specify the depth of a particular sequence.  This method will override the automatically calculated depth, even if it is incorrect.

get_depth

function int get_depth()

Returns the depth of a sequence from it’s parent.  A parent sequence will have a depth of 1, it’s child will have a depth of 2, and it’s grandchild will have a depth of 3.

is_item

virtual function bit is_item()

This function may be called on any sequence_item or sequence.  It will return 1 for items and 0 for sequences (which derive from this class).

start_item

virtual task start_item(ovm_sequence_item item,  
int set_priority =  -1)

start_item and finish_item together will initiate operation of either a sequence_item or sequence object.  If the object has not been initiated using create_item, then start_item will be initialized in start_item to use the default sequencer specified by m_sequencer.  Randomization may be done between start_item and finish_item to ensure late generation

finish_item

virtual task finish_item(ovm_sequence_item item,  
int set_priority =  -1)

finish_item, together with start_item together will initiate operation of either a sequence_item or sequence object.  Finish_item must be called after start_item with no delays or delta-cycles.  Randomization, or other functions may be called between the start_item and finish_item calls.

get_root_sequence_name

function string get_root_sequence_name()

Provides the name of the root sequence (the top-most parent sequence).

get_root_sequence

function ovm_sequence_base get_root_sequence()

Provides a reference to the root sequence (the top-most parent sequence).

get_sequence_path

function string get_sequence_path()

Provides a string of names of each sequence in the full hierarchical path.  A “.” is used as the separator between each sequence.

virtual class ovm_object extends ovm_void
The ovm_object class is the base class for all OVM data and hierarchical classes.
virtual class ovm_transaction extends ovm_object
The ovm_transaction class is the root base class for OVM transactions.
class ovm_sequence_item extends ovm_transaction
The base class for user-defined sequence items and also the base class for the ovm_sequence class.
function new (string name =  "ovm_sequence_item",
ovm_sequencer_base sequencer =  null,
ovm_sequence_base parent_sequence =  null)
The constructor method for ovm_sequence_item.
function int get_sequence_id()
private
function void set_use_sequence_info(bit value)
function bit get_use_sequence_info()
These methods are used to set and get the status of the use_sequence_info bit.
function void set_id_info(ovm_sequence_item item)
Copies the sequence_id and transaction_id from the referenced item into the calling item.
function void set_sequencer(ovm_sequencer_base sequencer)
function ovm_sequencer_base get_sequencer()
These routines set and get the reference to the sequencer to which this sequence_item communicates.
function void set_parent_sequence(ovm_sequence_base parent)
Sets the parent sequence of this sequence_item.
function ovm_sequence_base get_parent_sequence()
Returns a reference to the parent sequence of any sequence on which this method was called.
function void set_depth(int value)
The depth of any sequence is calculated automatically.
function int get_depth()
Returns the depth of a sequence from it’s parent.
virtual function bit is_item()
This function may be called on any sequence_item or sequence.
virtual task start_item(ovm_sequence_item item,  
int set_priority =  -1)
start_item and finish_item together will initiate operation of either a sequence_item or sequence object.
virtual task finish_item(ovm_sequence_item item,  
int set_priority =  -1)
finish_item, together with start_item together will initiate operation of either a sequence_item or sequence object.
function string get_root_sequence_name()
Provides the name of the root sequence (the top-most parent sequence).
function ovm_sequence_base get_root_sequence()
Provides a reference to the root sequence (the top-most parent sequence).
function string get_sequence_path()
Provides a string of names of each sequence in the full hierarchical path.