Controls the flow of sequences, which generate the stimulus (sequence item transactions) that is passed on to drivers for execution.
ovm_sequencer_base | |||||
Controls the flow of sequences, which generate the stimulus (sequence item transactions) that is passed on to drivers for execution. | |||||
Class Hierarchy | |||||
| |||||
Class Declaration | |||||
| |||||
Variables | |||||
pound_zero_count | Set this variable via set_config_int to set the number of delta cycles to insert in the wait_for_sequences task. | ||||
count | Sets the number of items to execute. | ||||
max_random_count | Set this variable via set_config_int to set the number of sequence items to generate, at the discretion of the derived sequence. | ||||
max_random_depth | Used for setting the maximum depth inside random sequences. | ||||
default_sequence | This property defines the sequence type (by name) that will be auto-started. | ||||
Methods | |||||
new | Creates and initializes an instance of this class using the normal constructor arguments for ovm_component: name is the name of the instance, and parent is the handle to the hierarchical parent. | ||||
start_default_sequence | Sequencers provide the start_default_sequence task to execute the default sequence in the run phase. | ||||
user_priority_arbitration | If the sequencer arbitration mode is set to SEQ_ARB_USER (via the set_arbitration method), then the sequencer will call this function each time that it needs to arbitrate among sequences. | ||||
is_child | Returns 1 if the child sequence is a child of the parent sequence, 0 otherwise. | ||||
wait_for_grant | This task issues a request for the specified sequence. | ||||
wait_for_item_done | A sequence may optionally call wait_for_item_done. | ||||
is_blocked | Returns 1 if the sequence referred to by sequence_ptr is currently locked out of the sequencer. | ||||
has_lock | Returns 1 if the sequence refered to in the parameter currently has a lock on this sequencer, 0 otherwise. | ||||
lock | Requests a lock for the sequence specified by sequence_ptr. | ||||
grab | Requests a lock for the sequence specified by sequence_ptr. | ||||
unlock | Removes any locks and grabs obtained by the specified sequence_ptr. | ||||
ungrab | Removes any locks and grabs obtained by the specified sequence_ptr. | ||||
stop_sequences | Tells the sequencer to kill all sequences and child sequences currently operating on the sequencer, and remove all requests, locks and responses that are currently queued. | ||||
is_grabbed | Returns 1 if any sequence currently has a lock or grab on this sequencer, 0 otherwise. | ||||
current_grabber | Returns a reference to the sequence that currently has a lock or grab on the sequence. | ||||
has_do_available | Determines if a sequence is ready to supply a transaction. | ||||
set_arbitration | Specifies the arbitration mode for the sequencer. | ||||
wait_for_sequences | Waits for a sequence to have a new item available. | ||||
add_sequence | Adds a sequence of type specified in the type_name paramter to the sequencer’s sequence library. | ||||
get_seq_kind | Returns an int seq_kind correlating to the sequence of type type_name in the sequencer¿s sequence library. | ||||
get_sequence | Returns a reference to a sequence specified by the seq_kind int. | ||||
num_sequences | Returns the number of sequences in the sequencer¿s sequence library. | ||||
send_request | Derived classes implement this function to send a request item to the sequencer, which will forward it to the driver. |
int unsigned pound_zero_count = 6
Set this variable via set_config_int to set the number of delta cycles to insert in the wait_for_sequences task. The delta cycles are used to ensure that a sequence with back-to-back items has an opportunity to fill the action queue when the driver uses the non-blocking try_get interface.
int count = -1
Sets the number of items to execute.
Supercedes the max_random_count variable for ovm_random_sequence class for backward compatibility.
int unsigned max_random_count = 10
Set this variable via set_config_int to set the number of sequence items to generate, at the discretion of the derived sequence. The predefined ovm_random_sequence uses count to determine the number of random items to generate.
int unsigned max_random_depth = 4
Used for setting the maximum depth inside random sequences. (Beyond that depth, random creates only simple sequences.)
protected string default_sequence = "ovm_random_sequence"
This property defines the sequence type (by name) that will be auto-started. The default sequence is initially set to ovm_random_sequence. It can be configured through the ovm_component’s set_config_string method using the field name “default_sequence”.
function new ( string name, ovm_component parent )
Creates and initializes an instance of this class using the normal constructor arguments for ovm_component: name is the name of the instance, and parent is the handle to the hierarchical parent.
virtual task start_default_sequence()
Sequencers provide the start_default_sequence task to execute the default sequence in the run phase. This method is not intended to be called externally, but may be overridden in a derivative sequencer class if special behavior is needed when the default sequence is started. The user class ovm_sequencer_param_base #(REQ,RSP) implements this method.
virtual function integer user_priority_arbitration( integer avail_sequences[$] )
If the sequencer arbitration mode is set to SEQ_ARB_USER (via the set_arbitration method), then the sequencer will call this function each time that it needs to arbitrate among sequences.
Derived sequencers may override this method to perform a custom arbitration policy. Such an override must return one of the entries from the avail_sequences queue, which are int indexes into an internal queue, arb_sequence_q.
The default implementation behaves like SEQ_ARB_FIFO, which returns the entry at avail_sequences[0].
If a user specifies that the sequencer is to use user_priority_arbitration through the call set_arbitration(SEQ_ARB_USER), then the sequencer will call this function each time that it needs to arbitrate among sequences.
This function must return an int that matches one of the available sequences that is passed into the call through the avail_sequences parameter
Each int in avail_sequences points to an entry in the arb_sequence_q, which is a protected queue that may be accessed from this function.
To modify the operation of user_priority_arbitration, the function may arbitrarily choose any sequence among the list of avail_sequences. It is important to choose only an available sequence.
function bit is_child ( ovm_sequence_base parent, ovm_sequence_base child )
Returns 1 if the child sequence is a child of the parent sequence, 0 otherwise.
virtual task wait_for_grant( ovm_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.
virtual task wait_for_item_done( ovm_sequence_base sequence_ptr, int transaction_id )
A sequence may optionally call wait_for_item_done. This task will block until the driver calls item_done() or put() on a transaction issued by the specified sequence. If no transaction_id parameter is specified, then the call will return the next time that the driver calls item_done() or put(). If a specific transaction_id is specified, then the call will only return when the driver indicates that it has completed that specific item.
Note that if a specific transaction_id has been specified, and the driver has already issued an item_done or put for that transaction, then the call will hang waiting for that specific transaction_id.
function bit is_blocked( ovm_sequence_base sequence_ptr )
Returns 1 if the sequence referred to by sequence_ptr is currently locked out of the sequencer. It will return 0 if the sequence is currently allowed to issue operations.
Note that even when a sequence is not blocked, it is possible for another sequence to issue a lock before this sequence is able to issue a request or lock.
function bit has_lock( ovm_sequence_base sequence_ptr )
Returns 1 if the sequence refered to in the parameter currently has a lock on this sequencer, 0 otherwise.
Note that even if this sequence has a lock, a child sequence may also have a lock, in which case the sequence is still blocked from issueing operations on the sequencer
virtual task lock( ovm_sequence_base sequence_ptr )
Requests a lock for the sequence specified by sequence_ptr.
A lock request will be arbitrated the same as any other request. A lock is granted after all earlier requests are completed and no other locks or grabs are blocking this sequence.
The lock call will return when the lock has been granted.
virtual task grab( ovm_sequence_base sequence_ptr )
Requests a lock for the sequence specified by sequence_ptr.
A grab request is put in front of the arbitration queue. It will be arbitrated before any other requests. A grab is granted when no other grabs or locks are blocking this sequence.
The grab call will return when the grab has been granted.
virtual function void unlock( ovm_sequence_base sequence_ptr )
Removes any locks and grabs obtained by the specified sequence_ptr.
virtual function void ungrab( ovm_sequence_base sequence_ptr )
Removes any locks and grabs obtained by the specified sequence_ptr.
virtual function void stop_sequences()
Tells the sequencer to kill all sequences and child sequences currently operating on the sequencer, and remove all requests, locks and responses that are currently queued. This essentially resets the sequencer to an idle state.
virtual function bit is_grabbed()
Returns 1 if any sequence currently has a lock or grab on this sequencer, 0 otherwise.
virtual function ovm_sequence_base current_grabber()
Returns a reference to the sequence that currently has a lock or grab on the sequence. If multiple hierarchical sequences have a lock, it returns the child that is currently allowed to perform operations on the sequencer.
virtual function bit has_do_available()
Determines if a sequence is ready to supply a transaction. A sequence that obtains a transaction in pre-do must determine if the upstream object is ready to provide an item
Returns 1 if a sequence is ready to issue an operation. Returns 0 if no unblocked, relevant sequence is requesting.
function void set_arbitration( SEQ_ARB_TYPE val )
Specifies the arbitration mode for the sequencer. It is one of
SEQ_ARB_FIFO | Requests are granted in FIFO order (default) |
SEQ_ARB_WEIGHTED | Requests are granted randomly by weight |
SEQ_ARB_RANDOM | Requests are granted randomly |
SEQ_ARB_STRICT_FIFO | Requests at highest priority granted in fifo order |
SEQ_ARB_STRICT_RANDOM | Requests at highest priority granted in randomly |
SEQ_ARB_USER | Arbitration is delegated to the user-defined function, user_priority_arbitration. That function will specify the next sequence to grant. |
The default user function specifies FIFO order.
virtual task wait_for_sequences()
Waits for a sequence to have a new item available. The default implementation in the sequencer delays pound_zero_count delta cycles. (This variable is defined in ovm_sequencer_base.) User-derived sequencers may override its wait_for_sequences implementation to perform some other application-specific implementation.
function void add_sequence( string type_name )
Adds a sequence of type specified in the type_name paramter to the sequencer’s sequence library.
function int get_seq_kind( string type_name )
Returns an int seq_kind correlating to the sequence of type type_name in the sequencer¿s sequence library. If the named sequence is not registered a SEQNF warning is issued and -1 is returned.
function ovm_sequence_base get_sequence( int req_kind )
Returns a reference to a sequence specified by the seq_kind int. The seq_kind int may be obtained using the get_seq_kind() method.
function int num_sequences()
Returns the number of sequences in the sequencer¿s sequence library.
virtual function void send_request( ovm_sequence_base sequence_ptr, ovm_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.
The ovm_object class is the base class for all OVM data and hierarchical classes.
virtual class ovm_object extends ovm_void
The ovm_report_object provides an interface to the OVM reporting facility.
class ovm_report_object extends ovm_object
The ovm_component class is the root base class for OVM components.
virtual class ovm_component extends ovm_report_object
Controls the flow of sequences, which generate the stimulus (sequence item transactions) that is passed on to drivers for execution.
class ovm_sequencer_base extends ovm_component
Set this variable via set_config_int to set the number of delta cycles to insert in the wait_for_sequences task.
int unsigned pound_zero_count = 6
Sets the number of items to execute.
int count = -1
Set this variable via set_config_int to set the number of sequence items to generate, at the discretion of the derived sequence.
int unsigned max_random_count = 10
Used for setting the maximum depth inside random sequences.
int unsigned max_random_depth = 4
This property defines the sequence type (by name) that will be auto-started.
protected string default_sequence = "ovm_random_sequence"
Creates and initializes an instance of this class using the normal constructor arguments for ovm_component: name is the name of the instance, and parent is the handle to the hierarchical parent.
function new ( string name, ovm_component parent )
Sequencers provide the start_default_sequence task to execute the default sequence in the run phase.
virtual task start_default_sequence()
If the sequencer arbitration mode is set to SEQ_ARB_USER (via the set_arbitration method), then the sequencer will call this function each time that it needs to arbitrate among sequences.
virtual function integer user_priority_arbitration( integer avail_sequences[$] )
Returns 1 if the child sequence is a child of the parent sequence, 0 otherwise.
function bit is_child ( ovm_sequence_base parent, ovm_sequence_base child )
This task issues a request for the specified sequence.
virtual task wait_for_grant( ovm_sequence_base sequence_ptr, int item_priority = -1, bit lock_request = 0 )
A sequence may optionally call wait_for_item_done.
virtual task wait_for_item_done( ovm_sequence_base sequence_ptr, int transaction_id )
Returns 1 if the sequence referred to by sequence_ptr is currently locked out of the sequencer.
function bit is_blocked( ovm_sequence_base sequence_ptr )
Returns 1 if the sequence refered to in the parameter currently has a lock on this sequencer, 0 otherwise.
function bit has_lock( ovm_sequence_base sequence_ptr )
Requests a lock for the sequence specified by sequence_ptr.
virtual task lock( ovm_sequence_base sequence_ptr )
Requests a lock for the sequence specified by sequence_ptr.
virtual task grab( ovm_sequence_base sequence_ptr )
Removes any locks and grabs obtained by the specified sequence_ptr.
virtual function void unlock( ovm_sequence_base sequence_ptr )
Removes any locks and grabs obtained by the specified sequence_ptr.
virtual function void ungrab( ovm_sequence_base sequence_ptr )
Tells the sequencer to kill all sequences and child sequences currently operating on the sequencer, and remove all requests, locks and responses that are currently queued.
virtual function void stop_sequences()
Returns 1 if any sequence currently has a lock or grab on this sequencer, 0 otherwise.
virtual function bit is_grabbed()
Returns a reference to the sequence that currently has a lock or grab on the sequence.
virtual function ovm_sequence_base current_grabber()
Determines if a sequence is ready to supply a transaction.
virtual function bit has_do_available()
Specifies the arbitration mode for the sequencer.
function void set_arbitration( SEQ_ARB_TYPE val )
Waits for a sequence to have a new item available.
virtual task wait_for_sequences()
Adds a sequence of type specified in the type_name paramter to the sequencer’s sequence library.
function void add_sequence( string type_name )
Returns an int seq_kind correlating to the sequence of type type_name in the sequencer¿s sequence library.
function int get_seq_kind( string type_name )
Returns a reference to a sequence specified by the seq_kind int.
function ovm_sequence_base get_sequence( int req_kind )
Returns the number of sequences in the sequencer¿s sequence library.
function int num_sequences()
Derived classes implement this function to send a request item to the sequencer, which will forward it to the driver.
virtual function void send_request( ovm_sequence_base sequence_ptr, ovm_sequence_item t, bit rerandomize = 0 )
Provides base functionality used by the ovm_sequencer and ovm_push_sequencer.
class ovm_sequencer_param_base #( type REQ = ovm_sequence_item, type RSP = REQ ) extends ovm_sequencer_base