uvm_sequencer_base

UVMkit » 1800.2-2017

The library implements some public API beyond what is documented in 1800.2.  It also modifies some API described erroneously in 1800.2.

Summary
uvm_sequencer_base
The library implements some public API beyond what is documented in 1800.2.
Class Hierarchy
Class Declaration
`ifndef UVM_ENABLE_DEPRECATED_API virtual `endif class uvm_sequencer_base extends uvm_component
Methods
newCreates and initializes an instance of this class using the normal constructor arguments for uvm_component: name is the name of the instance, and parent is the handle to the hierarchical parent.
execute_itemExecutes the given transaction item directly on this sequencer.
start_phase_sequenceStart the default sequence for this phase, if any.
stop_phase_sequenceStop the default sequence for this phase, if any exists, and it is still executing.
wait_for_grantThis task issues a request for the specified sequence.
unlock
unlock is documented in error as a virtual task, whereas it isimplemented as a virtual function.
ungrab
ungrab is documented in error as a virtual task, whereas it isimplemented as a virtual function.
wait_for_sequencesWaits for a sequence to have a new item available.
send_requestDerived classes implement this function to send a request item to the sequencer, which will forward it to the driver.
Macros
UVM_DISABLE_AUTO_ITEM_RECORDINGPerforms the same function as the 1800.2 define UVM_DISABLE_RECORDING, globally turning off automatic item recording when defined by the user.
Methods
disable_auto_item_recordingDisables auto_item_recording
is_auto_item_recording_enabledReturns 1 is auto_item_recording is enabled, otherwise 0

new

function new ( string  name,
uvm_component  parent )

Creates and initializes an instance of this class using the normal constructor arguments for uvm_component: name is the name of the instance, and parent is the handle to the hierarchical parent.

execute_item

virtual task execute_item( uvm_sequence_item  item )

Executes the given transaction item directly on this sequencer.  A temporary parent sequence is automatically created for the item.  There is no capability to retrieve responses.  If the driver returns responses, they will accumulate in the sequencer, eventually causing response overflow unless uvm_sequence_base::set_response_queue_error_report_enabled is called.

start_phase_sequence

virtual function void start_phase_sequence( uvm_phase  phase )

Start the default sequence for this phase, if any.  The default sequence is configured via resources using either a sequence instance or sequence type (object wrapper).  If both are used, the sequence instance takes precedence.  When attempting to override a previous default sequence setting, you must override both the instance and type (wrapper) resources, else your override may not take effect.

When setting the resource using set, the 1st argument specifies the context pointer, usually this for components or null when executed from outside the component hierarchy (i.e. in module).  The 2nd argument is the instance string, which is a path name to the target sequencer, relative to the context pointer.  The path must include the name of the phase with a “_phase” suffix.  The 3rd argument is the resource name, which is “default_sequence”.  The 4th argument is either an object wrapper for the sequence type, or an instance of a sequence.

Configuration by instances allows pre-initialization, setting rand_mode, use of inline constraints, etc.

myseq_t myseq = new("myseq");
myseq.randomize() with { ... };
uvm_config_db #(uvm_sequence_base)::set(null, "top.agent.myseqr.main_phase",
                                        "default_sequence",
                                        myseq);

Configuration by type is shorter and can be substituted via the factory.

uvm_config_db #(uvm_object_wrapper)::set(null, "top.agent.myseqr.main_phase",
                                         "default_sequence",
                                         myseq_type::type_id::get());

The uvm_resource_db can similarly be used.

myseq_t myseq = new("myseq");
myseq.randomize() with { ... };
uvm_resource_db #(uvm_sequence_base)::set({get_full_name(), ".myseqr.main_phase",
                                          "default_sequence",
                                          myseq, this);
uvm_resource_db #(uvm_object_wrapper)::set({get_full_name(), ".myseqr.main_phase",
                                           "default_sequence",
                                           myseq_t::type_id::get(),
                                           this );

stop_phase_sequence

virtual function void stop_phase_sequence( uvm_phase  phase )

Stop the default sequence for this phase, if any exists, and it is still executing.

wait_for_grant

virtual task wait_for_grant( uvm_sequence_base  sequence_ptr,   
int  item_priority  =  -1,
bit  lock_request  =  0 )

This task issues a request for the specified sequence.  If item_priority is not specified, then the current sequence priority will be used by the arbiter.  If a lock_request is made, then the sequencer will issue a lock immediately before granting the sequence.  (Note that the lock may be granted without the sequence being granted if is_relevant is not asserted).

When this method returns, the sequencer has granted the sequence, and the sequence must call send_request without inserting any simulation delay other than delta cycles.  The driver is currently waiting for the next item to be sent via the send_request call.

unlock

extern virtual function void unlock(uvm_sequence_base sequence_ptr);

Implementation of unlock, as defined in P1800.2-2017 section 15.3.2.12.

unlock is documented in error as a virtual task, whereas it is

implemented as a virtual function.

@uvm-contrib This API is being considered for potential contribution to 1800.2

ungrab

extern virtual function void ungrab(uvm_sequence_base sequence_ptr);

Implementation of ungrab, as defined in P1800.2-2017 section 15.3.2.13.

ungrab is documented in error as a virtual task, whereas it is

implemented as a virtual function.

@uvm-contrib This API is being considered for potential contribution to 1800.2

wait_for_sequences

virtual task wait_for_sequences()

Waits for a sequence to have a new item available.  Uses uvm_wait_for_nba_region to give a sequence as much time as possible to deliver an item before advancing time.

send_request

virtual function void send_request( uvm_sequence_base  sequence_ptr,   
uvm_sequence_item  t,   
bit  rerandomize  =  0 )

Derived classes implement this function to send a request item to the sequencer, which will forward it to the driver.  If the rerandomize bit is set, the item will be randomized before being sent to the driver.

This function may only be called after a wait_for_grant call.

UVM_DISABLE_AUTO_ITEM_RECORDING

Performs the same function as the 1800.2 define UVM_DISABLE_RECORDING, globally turning off automatic item recording when defined by the user.  Provided for backward compatibility.

@uvm-contrib This API is being considered for potential contribution to 1800.2

disable_auto_item_recording

virtual function void disable_auto_item_recording()

Disables auto_item_recording

This function is the implementation of the uvm_sqr_if_base::disable_auto_item_recording() method detailed in IEEE1800.2 section 15.2.1.2.10

This function is implemented here to allow uvm_push_sequencer#(REQ,RSP) and uvm_push_driver#(REQ,RSP) access to the call.

@uvm-contrib This API is being considered for potential contribution to 1800.2

is_auto_item_recording_enabled

virtual function bit is_auto_item_recording_enabled()

Returns 1 is auto_item_recording is enabled, otherwise 0

This function is the implementation of the uvm_sqr_if_base::is_auto_item_recording_enabled() method detailed in IEEE1800.2 section 15.2.1.2.11

This function is implemented here to allow uvm_push_sequencer#(REQ,RSP) and uvm_push_driver#(REQ,RSP) access to the call.

@uvm-contrib This API is being considered for potential contribution to 1800.2

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_report_object extends uvm_object
The uvm_report_object provides an interface to the UVM reporting facility.
virtual class uvm_component extends uvm_report_object
The library implements the following public API beyond what is documented in 1800.2.
`ifndef UVM_ENABLE_DEPRECATED_API virtual `endif class uvm_sequencer_base extends uvm_component
The library implements some public API beyond what is documented in 1800.2.
function new ( string  name,
uvm_component  parent )
Creates and initializes an instance of this class using the normal constructor arguments for uvm_component: name is the name of the instance, and parent is the handle to the hierarchical parent.
virtual task execute_item( uvm_sequence_item  item )
Executes the given transaction item directly on this sequencer.
virtual function void start_phase_sequence( uvm_phase  phase )
Start the default sequence for this phase, if any.
virtual function void stop_phase_sequence( uvm_phase  phase )
Stop the default sequence for this phase, if any exists, and it is still executing.
virtual task wait_for_grant( uvm_sequence_base  sequence_ptr,   
int  item_priority  =  -1,
bit  lock_request  =  0 )
This task issues a request for the specified sequence.
virtual task wait_for_sequences()
Waits for a sequence to have a new item available.
virtual function void send_request( uvm_sequence_base  sequence_ptr,   
uvm_sequence_item  t,   
bit  rerandomize  =  0 )
Derived classes implement this function to send a request item to the sequencer, which will forward it to the driver.
virtual function void disable_auto_item_recording()
Disables auto_item_recording
virtual function bit is_auto_item_recording_enabled()
Returns 1 is auto_item_recording is enabled, otherwise 0
function void set_response_queue_error_report_enabled( bit  value )
By default, if the internal response queue overflows, an error is reported.
task uvm_wait_for_nba_region
This task will block until SystemVerilog’s NBA region (or Re-NBA region if called from a program context).
class uvm_push_sequencer #(
    type  REQ  =  uvm_sequence_item,
      RSP  =  REQ
) extends uvm_sequencer_param_base #(REQ, RSP)
class uvm_push_driver #( type  REQ  =  uvm_sequence_item,
type  RSP  =  REQ ) extends uvm_component
Base class for a driver that passively receives transactions, i.e.