uvm_sequencer

class uvm.seq.uvm_sequencer.UVMSequencer(name, parent=None)[source]

Bases: UVMSequencerParamBase

Group: Sequencer Interface This is an interface for communicating with sequencers.

The interface is defined as:

Requests:
 async def get_next_item      (request: List) -> UVMSequenceItem
 async def try_next_item      (request: List)
 async def get                (request: List) -> UVMSequenceItem
 async def peek               (request: List) -> UVMSequenceItem
Responses:
 def item_done          (response=None)
 async def put          (response: UVMSequenceItem)
Sync Control:
 async def wait_for_sequences()
 def has_do_available()

See UVMSqrIfBase for information about this interface.

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.

async get_next_item(t=None) Any[source]

Retrieves the next available item from a sequence.

Parameters

t (list) – Empty list into which item is appended

async try_next_item(t: List)[source]

Retrieves the next available item from a sequence if one is available.

Parameters

t (List) – Empty list into which item is appended

item_done(item=None) None[source]

Indicates that the request is completed.

Parameters

item (UVMSequenceItem) – Related sequence item.

async put(t) None[source]

Sends a response back to the sequence that issued the request.

Parameters

t (UVMSequenceItem) – Response item.

async get(t: Optional[List] = None) Any[source]

Retrieves the next available item from a sequence into the given list.

Parameters

t (List) – List to hold the response

async peek(t: Optional[List] = None) Any[source]

Gets the current request item if one is in the FIFO.

Parameters

t (List) – List for the output request.

get_object_type()

Function: get_object_type

Returns the type-proxy (wrapper) for this object. The uvm_factory’s type-based override and creation methods take arguments of uvm_object_wrapper. This method, if implemented, can be used as convenient means of supplying those arguments. This method is the same as the static get_type method, but uses an already allocated object to determine the type-proxy to access (instead of using the static object).

The default implementation of this method does a factory lookup of the proxy using the return value from get_type_name. If the type returned by get_type_name is not registered with the factory, then a None handle is returned.

For example:

class cmd (UVMObject):
  type_id = UVMObjectRegistry()
  @classmethod
  def type_id get_type(cls):
    return type_id.get()
  def get_object_type(self):
    return cmd.type_id.get()

This function is implemented by the `uvm_*_utils macros, if employed.

Returns:

classmethod get_type()

Returns the type-proxy (wrapper) for this object. The UVMFactory’s type-based override and creation methods take arguments of uvm_object_wrapper. This method, if implemented, can be used as convenient means of supplying those arguments.

The default implementation of this method produces an error and returns None. To enable use of this method, a user’s subtype must implement a version that returns the subtype’s wrapper.

For example:

class cmd(UVMObject):
  type_id = None

  @classmethod
  def get_type(cls):
    return cls.type_id.get()

Then, to use:

factory.set_type_override(cmd.get_type(), subcmd.get_type())

This function is implemented by the uvm_*_utils functions, if employed.

Returns:

get_type_name()

This function returns the type name of the object, which is typically the type identifier enclosed in quotes. It is used for various debugging functions in the library, and it is used by the factory for creating objects.

This function must be defined in every derived class.

A typical implementation is as follows:

class mytype (UVMObject):
  ...
  type_name = "mytype"

  def get_type_name(self):
    return my_type.type_name

We define the type_name static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.

Returns

Type name of the object.

Return type

str

type_id = <uvm.base.uvm_registry.UVMComponentRegistry object>
type_name = 'UVMSequencer'
m_children: Dict[str, 'UVMComponent']
m_children_by_handle: Dict['UVMComponent', 'UVMComponent']
m_children_ordered: List['UVMComponent']
event_pool: UVMEventPool