The ovm_root class serves as the implicit top-level and phase controller for all OVM components. Users do not directly instantiate ovm_root. The OVM automatically creates a single instance of ovm_root that users can access via the global (ovm_pkg-scope) variable, ovm_top.
The ovm_top instance of ovm_root plays several key roles in the OVM.
Implicit top-level | The ovm_top serves as an implicit top-level component. Any component whose parent is specified as NULL becomes a child of ovm_top. Thus, all OVM components in simulation are descendants of ovm_top. |
Phase control | ovm_top manages the phasing for all components. There are eight phases predefined in every component: build, connect, end_of_elaboration, start_of_simulation, run, extract, check, and report. Of these, only the run phase is a task. All others are functions. OVM’s flexible phasing mechanism allows users to insert any number of custom function and task-based phases. See run_test, insert_phase, and stop_request, and others. |
Search | Use ovm_top to search for components based on their hierarchical name. See find and find_all. |
Report configuration | Use ovm_top to globally configure report verbosity, log files, and actions. For example, ovm_top.set_report_verbosity_level_hier(OVM_FULL) would set full verbosity for all components in simulation. |
Global reporter | Because ovm_top is globally accessible (in ovm_pkg scope), OVM’s reporting mechanism is accessible from anywhere outside ovm_component, such as in modules and sequences. See ovm_report_error, ovm_report_warning, and other global methods. |
ovm_root | |||||
The ovm_root class serves as the implicit top-level and phase controller for all OVM components. | |||||
Class Hierarchy | |||||
| |||||
Class Declaration | |||||
| |||||
Methods | |||||
run_test | Phases all components through all registered phases. | ||||
stop_request | Calling this function triggers the process of shutting down the currently running task-based phase. | ||||
in_stop_request | This function returns 1 if a stop request is currently active, and 0 otherwise. | ||||
insert_phase | Inserts a new phase given by new_phase after the existing phase given by exist_phase. | ||||
find | |||||
find_all | Returns the component handle (find) or list of components handles (find_all) matching a given string. | ||||
get_current_phase | Returns the handle of the currently executing phase. | ||||
get_phase_by_name | Returns the handle of the phase having the given name. | ||||
Variables | |||||
phase_timeout | |||||
stop_timeout | These set watchdog timers for task-based phases and stop tasks. | ||||
enable_print_topology | If set, then the entire testbench topology is printed just after completion of the end_of_elaboration phase. | ||||
finish_on_completion | If set, then run_test will call $finish after all phases are executed. | ||||
ovm_top | This is the top-level that governs phase execution and provides component search interface. | ||||
Methods | |||||
raised | |||||
all_dropped |
virtual task run_test ( string test_name = "" )
Phases all components through all registered phases. If the optional test_name argument is provided, or if a command-line plusarg, +OVM_TESTNAME=TEST_NAME, is found, then the specified component is created just prior to phasing. The test may contain new verification components or the entire testbench, in which case the test and testbench can be chosen from the command line without forcing recompilation. If the global (package) variable, finish_on_completion, is set, then $finish is called after phasing completes.
function void stop_request()
Calling this function triggers the process of shutting down the currently running task-based phase. This process involves calling all components’ stop tasks for those components whose enable_stop_interrupt bit is set. Once all stop tasks return, or once the optional global_stop_timeout expires, all components’ kill method is called, effectively ending the current phase. The ovm_top will then begin execution of the next phase, if any.
function bit in_stop_request()
This function returns 1 if a stop request is currently active, and 0 otherwise.
function void insert_phase ( ovm_phase new_phase, ovm_phase exist_phase )
Inserts a new phase given by new_phase after the existing phase given by exist_phase. The ovm_top maintains a queue of phases executed in consecutive order. If exist_phase is null, then new_phase is inserted at the head of the queue, i.e., it becomes the first phase.
function ovm_component find ( string comp_match )
function void find_all ( string comp_match, ref ovm_component comps[$], input ovm_component comp = null )
Returns the component handle (find) or list of components handles (find_all) matching a given string. The string may contain the wildcards,
function ovm_phase get_current_phase ()
Returns the handle of the currently executing phase.
function ovm_phase get_phase_by_name ( string name )
Returns the handle of the phase having the given name.
time phase_timeout = `OVM_DEFAULT_TIMEOUT
time stop_timeout = `OVM_DEFAULT_TIMEOUT
These set watchdog timers for task-based phases and stop tasks. The timeout is specified in absolute time. The default timeout is set by the OVM_DEFAULT_TIMEOUT define. A timeout at this value usually indicates a problem with your testbench, or failure to call global_stop_request. When set to 0, the timeout is disabled.
bit enable_print_topology = 0
If set, then the entire testbench topology is printed just after completion of the end_of_elaboration phase.
bit finish_on_completion = 1
If set, then run_test will call $finish after all phases are executed.
function void ovm_root::raised ( ovm_objection objection, ovm_object source_obj, int count )
task ovm_root::all_dropped ( ovm_objection objection, ovm_object source_obj, int count )
The ovm_object class is the base class for all OVM data and hierarchical classes.
virtual class ovm_object extends ovm_void
The ovm_report_object provides an interface to the OVM reporting facility.
class ovm_report_object extends ovm_object
The ovm_component class is the root base class for OVM components.
virtual class ovm_component extends ovm_report_object
The ovm_root class serves as the implicit top-level and phase controller for all OVM components.
class ovm_root extends ovm_component
Phases all components through all registered phases.
virtual task run_test ( string test_name = "" )
Calling this function triggers the process of shutting down the currently running task-based phase.
function void stop_request()
This function returns 1 if a stop request is currently active, and 0 otherwise.
function bit in_stop_request()
Inserts a new phase given by new_phase after the existing phase given by exist_phase.
function void insert_phase ( ovm_phase new_phase, ovm_phase exist_phase )
function ovm_component find ( string comp_match )
Returns the component handle (find) or list of components handles (find_all) matching a given string.
function void find_all ( string comp_match, ref ovm_component comps[$], input ovm_component comp = null )
Returns the handle of the currently executing phase.
function ovm_phase get_current_phase ()
Returns the handle of the phase having the given name.
function ovm_phase get_phase_by_name ( string name )
time phase_timeout = `OVM_DEFAULT_TIMEOUT
These set watchdog timers for task-based phases and stop tasks.
time stop_timeout = `OVM_DEFAULT_TIMEOUT
If set, then the entire testbench topology is printed just after completion of the end_of_elaboration phase.
bit enable_print_topology = 0
If set, then run_test will call $finish after all phases are executed.
bit finish_on_completion = 1
This is the top-level that governs phase execution and provides component search interface.
`const ovm_root ovm_top = ovm_root::get()
function void ovm_root::raised ( ovm_objection objection, ovm_object source_obj, int count )
task ovm_root::all_dropped ( ovm_objection objection, ovm_object source_obj, int count )
function void ovm_report_error( string id, string message, int verbosity = OVM_LOW, string filename = "", int line = 0 )
function void ovm_report_warning( string id, string message, int verbosity = OVM_MEDIUM, string filename = "", int line = 0 )
Convenience function for ovm_top.stop_request().
function void global_stop_request()