uvm_test_runner

The UVM test runner is responsible for the execution of the UVM test.

The UVM core service is responsible for instantiating the test runner.  The test runner is responsible for executing the test.

@uvm-contrib For potential contribution to the 1800.2 standard

Summary
uvm_test_runner
The UVM test runner is responsible for the execution of the UVM test.
Class Hierarchy
uvm_object
uvm_test_runner
Class Declaration
class uvm_test_runner extends uvm_object
newCreates a new uvm_test_runner instance with name.
Singleton Accessors
get_global_runnerReturns the global test runner.
Test Execution
get_uvm_testnameReturns the name of the test that was specified, if any.
run_testExecutes the test.
dieThis method is called by the report server if a report reaches the maximum quit count or has a UVM_EXIT action associated with it, e.g., as with fatal errors.

new

function new(
    string  name  =  "uvm_test_runner"
)

Creates a new uvm_test_runner instance with name.

@uvm-contrib For potential contribution to the 1800.2 standard

get_global_runner

static function uvm_test_runner get_global_runner()

Returns the global test runner.

@uvm-contrib For potential contribution to the 1800.2 standard

get_uvm_testname

virtual function string get_uvm_testname()

Returns the name of the test that was specified, if any.

Calling this method before run_test has been called will result in a fatal error.

@uvm-contrib For potential contribution to the 1800.2 standard

run_test

virtual task run_test(
    string  test_name  =  ""
)

Executes the test.

The following operations are performed in order

a) The UVM core state is set to `UVM_CORE_PRE_RUN` via <set_core_state>. b) If the command-line plusarg `+UVM_TESTNAME=<TEST_NAME>` is found, then the implementation shall call <create_component_by_name> on the current factory with requested_type_name set to the plusarg defined <TEST_NAME> and name set to `uvm_test_top`. c) If test_name is not an empty string (“”) and no name was provided via the command-line plusarg, then the implementation shall call <create_component_by_name> on the current factory with requested_type_name set to test_name and name set to `uvm_test_top`. d) If no components other than uvm_root have been created at this point, either by run_test or by the user, then the implementation shall generate a fatal message and run_test shall return immediately. e) The UVM core state is set to `UVM_CORE_RUNNING` via <set_core_state>. f) All components are phased through all registered phases (see <uvm_phase_hopper>). g) The UVM core state is set to `UVM_CORE_POST_RUN` via <set_core_state>. h) The <uvm_report_server::report_summarize> method is called on the current report server. i) The UVM core state is set to `UVM_CORE_FINISHED` via <set_core_state>. j) If <uvm_root::get_finish_on_completion> returns `1`, then `$finish` is called; otherwise, run_test shall return.

@uvm-contrib For potential contribution to the 1800.2 standard

die

virtual function void die()

This method is called by the report server if a report reaches the maximum quit count or has a UVM_EXIT action associated with it, e.g., as with fatal errors.

If the UVM core state is already `UVM_CORE_PRE_ABORT` or `UVM_CORE_ABORTED`, then the method shall return immediately.

Otherwise, the following operations are performed in order

a) The UVM core state is set to `UVM_CORE_PRE_ABORT` via <set_core_state>. b) The <uvm_component::pre_abort> method is called on the entire uvm_component hierarchy in a bottom-up fashion. c) The <uvm_report_server::report_summarize> method is called on the current report server. d) The UVM core state is set to `UVM_CORE_ABORTED` via <set_core_state>. e) The simulation is terminated with $finish.

@uvm-contrib For potential contribution to the 1800.2 standard

class uvm_test_runner extends uvm_object
The UVM test runner is responsible for the execution of the UVM test.
function new(
    string  name  =  "uvm_test_runner"
)
Creates a new uvm_test_runner instance with name.
static function uvm_test_runner get_global_runner()
Returns the global test runner.
virtual function string get_uvm_testname()
Returns the name of the test that was specified, if any.
virtual task run_test(
    string  test_name  =  ""
)
Executes the test.
virtual function void die()
This method is called by the report server if a report reaches the maximum quit count or has a UVM_EXIT action associated with it, e.g., as with fatal errors.
class uvm_root extends uvm_component
Implementation of the uvm_root class, as defined in 1800.2-2020 Section F.7 with the following additional API
The library implements the following public API beyond what is documented in 1800.2.