# uvm_test

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

The uvm_test virtual 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 uvm_root::run_test task.

For example

>     prompt> SIM_COMMAND +UVM_TESTNAME=test_bus_retry

The global run_test() task should be specified inside an initial block such as

>     initial run_test();

Multiple tests, identified by their type name, are compiled in and then selected for execution from the command line without need for recompilation. 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 uvm_factory, 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 uvm_test will allow you to distinguish tests from other component types that inherit from uvm_component directly. Such tests will automatically inherit features that may be added to uvm_test in the future.

Summary

uvm_test
This class is the virtual base class for the user-defined tests.
Class Hierarchy
uvm_void
uvm_object
uvm_report_object
uvm_component
uvm_test
Class Declaration
> virtual class uvm_test extends uvm_component
Methods |
new | 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, if any.

### Methods

### 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, if any.

> 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 uvm_component class is the root base class for UVM components.

> virtual class uvm_test extends uvm_component

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

> 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, if any.

> virtual task run_test (
> | string | test_name | = | ""
> )

Phases all components through all registered phases.

> virtual class uvm_factory

As the name implies, uvm_factory is used to manufacture (create) UVM objects and components.