[source]

Class uvm_sequencer_base

uvm_pkg::uvm_sequencer_base + count : int + m_exhaustive_count : int + m_is_relevant_completed : int + m_random_count : int + m_simple_count : int + max_random_count : int unsigned + max_random_depth : int unsigned + sequences[$] : string + add_sequence(): void + analysis_write(): void + build(): void + build_phase(): void + convert2string(): string + current_grabber(): uvm_sequence_base + disable_auto_item_recording(): void + do_print(): void + execute_item() + get_arbitration(): UVM_SEQ_ARB_TYPE + get_seq_kind(): int + get_sequence(): uvm_sequence_base + grab() + has_do_available(): bit + has_lock(): bit + is_auto_item_recording_enabled(): bit + is_blocked(): bit + is_child(): bit + is_grabbed(): bit + kill_sequence(): void + lock() + m_add_builtin_seqs(): void + m_register_sequence(): int + m_sequence_exiting(): void + m_set_arbitration_completed(): void + m_unlock_req(): void + m_wait_for_arbitration_completed() + num_sequences(): int + remove_sequence(): void + run_phase() + send_request(): void + set_arbitration(): void + set_max_zero_time_wait_relevant_count(): void + set_sequences_queue(): void + start_default_sequence() + start_phase_sequence(): void + stop_phase_sequence(): void + stop_sequences(): void + ungrab(): void + unlock(): void + user_priority_arbitration(): integer + wait_for_grant() + wait_for_item_done() + wait_for_sequences() uvm_pkg::uvm_sequencer_param_base <REQ, RSP>

Inheritance Diagram of uvm_sequencer_base

Controls the flow of sequences, which generate the stimulus (sequence item transactions) that is passed on to drivers for execution.

Variables

Name

Type

Description

count

int

Variable- count

Sets the number of items to execute.

Supercedes the max_random_count variable for uvm_random_sequence class for backward compatibility.

max_random_count

int unsigned

max_random_depth

int unsigned

sequences

string

Constructors

function new ( string name, uvm_component parent ) [source]

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

Enums

seq_req_t [source]

Enum Items :
  • SEQ_TYPE_REQ
  • SEQ_TYPE_LOCK
  • SEQ_TYPE_GRAB

    FIXME SEQ_TYPE_GRAB is unused

Functions

function bit is_child ( uvm_sequence_base parent, uvm_sequence_base child ) [source]

Returns 1 if the child sequence is a child of the parent sequence, 0 otherwise. Is_child

virtual function integer user_priority_arbitration ( integer avail_sequences ) [source]

When the sequencer arbitration mode is set to UVM_SEQ_ARB_USER (via the set_arbitration method), 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. The override must return one of the entries from the avail_sequences queue, which are indexes into an internal queue, arb_sequence_q.

The default implementation behaves like UVM_SEQ_ARB_FIFO, which returns the entry at avail_sequences[0]. User_priority_arbitration

virtual function void start_phase_sequence ( uvm_phase phase ) [source]

Start_phase_sequence

virtual function void stop_phase_sequence ( uvm_phase phase ) [source]

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

function bit is_blocked ( uvm_sequence_base sequence_ptr ) [source]

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

function bit has_lock ( uvm_sequence_base sequence_ptr ) [source]

Returns 1 if the sequence referred 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 issuing operations on the sequencer. Has_lock

virtual function void unlock ( uvm_sequence_base sequence_ptr ) [source]

Removes any locks and grabs obtained by the specified sequence_ptr. Unlock

virtual function void ungrab ( uvm_sequence_base sequence_ptr ) [source]

Removes any locks and grabs obtained by the specified sequence_ptr. Ungrab

virtual function void stop_sequences ( ) [source]

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

virtual function bit is_grabbed ( ) [source]

Returns 1 if any sequence currently has a lock or grab on this sequencer, 0 otherwise. Is_grabbed

virtual function uvm_sequence_base current_grabber ( ) [source]

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

virtual function bit has_do_available ( ) [source]

Returns 1 if any sequence running on this sequencer is ready to supply a transaction, 0 otherwise. A sequence is ready if it is not blocked (via grab or lock and is_relevant returns 1. Has_do_available

function void set_arbitration ( UVM_SEQ_ARB_TYPE val ) [source]

Specifies the arbitration mode for the sequencer. It is one of

UVM_SEQ_ARB_FIFO

Requests are granted in FIFO order (default)

UVM_SEQ_ARB_WEIGHTED

Requests are granted randomly by weight

UVM_SEQ_ARB_RANDOM

Requests are granted randomly

UVM_SEQ_ARB_STRICT_FIFO

Requests at highest priority granted in FIFO order

UVM_SEQ_ARB_STRICT_RANDOM

Requests at highest priority granted in randomly

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

function UVM_SEQ_ARB_TYPE get_arbitration ( ) [source]

Return the current arbitration mode set for this sequencer. See set_arbitration for a list of possible modes. Get_arbitration

virtual function void send_request ( uvm_sequence_base sequence_ptr, uvm_sequence_item t, bit rerandomize ) [source]

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

virtual function void set_max_zero_time_wait_relevant_count ( int new_val ) [source]

Can be called at any time to change the maximum number of times wait_for_relevant() can be called by the sequencer in zero time before an error is declared. The default maximum is 10. Set_max_zero_time_wait_relevant_count

function void kill_sequence ( uvm_sequence_base sequence_ptr ) [source]

Kill_sequence

virtual function void analysis_write ( uvm_sequence_item t ) [source]

Analysis_write

virtual function void build ( ) [source]

virtual function void build_phase ( uvm_phase phase ) [source]

Build_phase

virtual function void do_print ( uvm_printer printer ) [source]

Do_print

virtual function string convert2string ( ) [source]

Convert2string

virtual function void disable_auto_item_recording ( ) [source]

Access to following internal methods provided via seq_item_export

virtual function bit is_auto_item_recording_enabled ( ) [source]

function void add_sequence ( string type_name ) [source]

Add_sequence

Adds a sequence of type specified in the type_name paramter to the sequencer's sequence library.

function void remove_sequence ( string type_name ) [source]

Remove_sequence

function void set_sequences_queue ( string sequencer_sequence_lib ) [source]

Set_sequences_queue

function int get_seq_kind ( string type_name ) [source]

Get_seq_kind

Returns an int seq_kind correlating to the sequence of type type_name in the sequencers sequence library. If the named sequence is not registered a SEQNF warning is issued and -1 is returned.

function uvm_sequence_base get_sequence ( int req_kind ) [source]

Get_sequence

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 ( ) [source]

Num_sequences

Tasks

virtual function execute_item ( uvm_sequence_item item ) [source]

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_disabled is called. Execute_item

virtual function wait_for_grant ( uvm_sequence_base sequence_ptr, int item_priority, bit lock_request ) [source]

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

virtual function wait_for_item_done ( uvm_sequence_base sequence_ptr, int transaction_id ) [source]

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

virtual function lock ( uvm_sequence_base sequence_ptr ) [source]

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

virtual function grab ( uvm_sequence_base sequence_ptr ) [source]

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

virtual function wait_for_sequences ( ) [source]

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

virtual function start_default_sequence ( ) [source]

Start_default_sequence

Called when the run phase begins, this method starts the default sequence, as specified by the default_sequence member variable.

virtual function run_phase ( uvm_phase phase ) [source]

Run_phase