uvm_test

class uvm.comps.uvm_test.UVMTest(name, parent)[source]

Bases: UVMComponent

This class is the virtual base class for the user-defined tests.

The UVMTest class should be used as the base class for user-defined tests. Doing so provides the ability to select which test to execute using the UVM_TESTNAME command line or argument to the UVMRoot.run_test task.

For example

prompt> SIM_COMMAND +UVM_TESTNAME=test_bus_retry

The global run_test() task should be specified inside a function decorated with @cocotb.test() (the parentheses are important!) such as

Multiple tests, identified by their type name, can be selected for execution from the command line. Random seed selection is also available on the command line.

If +UVM_TESTNAME=test_name is specified, then an object of type ‘test_name’ is created by factory and phasing begins. Here, it is presumed that the test will instantiate the test environment, or the test environment will have already been instantiated before the call to run_test().

If the specified test_name cannot be created by the UVMFactory, then a fatal error occurs. If run_test() is called without UVM_TESTNAME being specified, then all components constructed before the call to run_test will be cycled through their simulation phases.

Deriving from UVMTest will allow you to distinguish tests from other component types that inherit from UVMComponent directly. Such tests will automatically inherit features that may be added to uvm_test in the future.

type_name = 'uvm_test'
get_type_name()[source]

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

m_children: Dict[str, 'UVMComponent']
m_children_by_handle: Dict['UVMComponent', 'UVMComponent']
m_children_ordered: List['UVMComponent']
event_pool: UVMEventPool