Overview
UVM phases are predefined stages in the execution of a UVM verification environment. They give verification components a shared understanding of what actions are expected at each point in the testbench flow, which helps independently developed components remain interoperable and makes testbench execution more structured and predictable.
The provided UVM phase diagram groups phases into build, run, and cleanup portions of execution. UVM components implement phase-related virtual methods according to the phases in which they participate.
Role in a UVM test
A UVM test is the top-level object in a UVM environment: environment objects are members of the test case object, and UVM requires tests to extend uvm_test. In the cited CV32E/CORE-V environment, the base test class uvmt_cv32_base_test_c directly extends uvm_test, and project test cases are expected to extend that base test to preserve the intended test flow and avoid duplicated boilerplate.
Example phase usage in a CORE-V/CV32E environment
The CORE-V/CV32E example describes three time-consuming tasks commonly extended by a UVM test:
- Reset phase: often only calls
super.resetphase(), which invokes the default reset sequence. A test-specific reset virtual sequence can also be invoked here. - Configure phase: in many UVM environments this is busy, but in the CV32E example the core CSRs may not require configuration before execution if the program running on the core performs what is needed. Tests that require pre-compiled programs to be loaded into instruction memory should do that in this phase.
- Run phase: typically contains most procedural test code.
A typical run-phase flow in the CORE-V example is:
- Raise an objection.
- Assert the core
fetch_eninput. - Wait for the core or environments to signal completion.
- Drop the objection.
Why phases matter
The phase mechanism gives testbench authors a common lifecycle for setup, execution, and cleanup. In processor-oriented UVM environments such as the CORE-V example, the run flow may also need to account for software executing on the core: the test program runs in an execution environment defined by the ISA, memory map, and virtual peripherals, while the UVM environment responds to that program as part of the run flow.