UVM Common Phases¶
Title: UVM Common Phases
The common phases are the set of function and task phases that all `UVMComponent`s execute together. All `UVMComponent`s are always synchronized with respect to the common phases.
The names of the UVM phases (which will be returned by get_name() for a phase instance) match the class names specified below with the “uvm_” and “_phase” removed. For example, the build phase corresponds to the uvm_build_phase class below and has the name “build”, which means that the following can be used to call foo() at the end of the build phase (after all lower levels have finished build):
def phase_ended(self, phase):
if (phase.get_name()=="build"):
self.foo()
The common phases are executed in the sequence they are specified below.
-
class
uvm.base.uvm_common_phases.UVMBuildPhase(name='build')[source]¶ Bases:
uvm.base.uvm_topdown_phase.UVMTopdownPhaseClass: UVMBuildPhase
Create and configure of testbench structure
UVMTopdownPhasethat calls theUVMComponent.build_phasemethod.- Upon entry:
The top-level components have been instantiated under
UVMRoot. Current simulation time is still equal to 0 but some “delta cycles” may have occurred- Typical Uses:
Instantiate sub-components. Instantiate register model. Get configuration values for the component being built. Set configuration values for sub-components.
- Exit Criteria:
All `UVMComponent`s have been instantiated.
-
m_inst= <uvm.base.uvm_common_phases.UVMBuildPhase object>¶
-
type_name= 'uvm_build_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-
class
uvm.base.uvm_common_phases.UVMConnectPhase(name='connect')[source]¶ Bases:
uvm.base.uvm_bottomup_phase.UVMBottomupPhaseEstablish cross-component connections.
UVMBottomupPhasethat calls theUVMComponent.connect_phasemethod.Upon Entry: - All components have been instantiated. - Current simulation time is still equal to 0
but some “delta cycles” may have occurred.
Typical Uses: - Connect TLM ports and exports. - Connect TLM initiator sockets and target sockets. - Connect register model to adapter components. - Setup explicit phase domains.
Exit Criteria: - All cross-component connections have been established. - All independent phase domains are set.
-
m_inst= <uvm.base.uvm_common_phases.UVMConnectPhase object>¶
-
type_name= 'uvm_connect_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-
-
class
uvm.base.uvm_common_phases.UVMEndOfElaborationPhase(name='end_of_elaboration')[source]¶ Bases:
uvm.base.uvm_bottomup_phase.UVMBottomupPhaseFine-tune the testbench.
UVMBottomupPhasethat calls theUVMComponent.end_of_elaboration_phasemethod.Upon Entry: - The verification environment has been completely assembled. - Current simulation time is still equal to 0
but some “delta cycles” may have occurred.
Typical Uses: - Display environment topology. - Open files. - Define additional configuration settings for components.
Exit Criteria: - None.
-
m_inst= <uvm.base.uvm_common_phases.UVMEndOfElaborationPhase object>¶
-
type_name= 'uvm_end_of_elaboration_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-
-
class
uvm.base.uvm_common_phases.UVMStartofSimulationPhase(name='start_of_simulation')[source]¶ Bases:
uvm.base.uvm_bottomup_phase.UVMBottomupPhaseGet ready for DUT to be simulated.
UVMBottomupPhasethat calls theUVMComponent.start_of_simulation_phasemethod.- Upon Entry:
Other simulation engines, debuggers, hardware assisted platforms and all other run-time tools have been started and synchronized.
The verification environment has been completely configured and is ready to start.
Current simulation time is still equal to 0 but some “delta cycles” may have occurred.
- Typical Uses:
Display environment topology
Set debugger breakpoint
Set initial run-time configuration values.
- Exit Criteria:
None.
-
m_inst= <uvm.base.uvm_common_phases.UVMStartofSimulationPhase object>¶
-
type_name= 'uvm_start_of_simulation_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-
class
uvm.base.uvm_common_phases.UVMRunPhase(name='run')[source]¶ Bases:
uvm.base.uvm_task_phase.UVMTaskPhaseStimulate the DUT.
This
UVMTaskPhasecalls theUVMComponent.run_phasevirtual method. This phase runs in parallel to the runtime phases,UVMPreResetPhasethroughUVMPostShutdownPhase. All components in the testbench are synchronized with respect to the run phase regardless of the phase domain they belong to.Upon Entry: - Indicates that power has been applied. - There should not have been any active clock edges before entry
into this phase (e.g. x->1 transitions via initial blocks).
Current simulation time is still equal to 0 but some “delta cycles” may have occurred.
Typical Uses: - Components implement behavior that is exhibited for the entire
run-time, across the various run-time phases.
Backward compatibility with OVM.
Exit Criteria: - The DUT no longer needs to be simulated, and - The <uvm_post_shutdown_phase> is ready to end
The run phase terminates in one of two ways.
All run_phase objections are dropped:
When all objections on the run_phase objection have been dropped, the phase ends and all of its threads are killed. If no component raises a run_phase objection immediately upon entering the phase, the phase ends immediately.
Timeout:
The phase ends if the timeout expires before all objections are dropped. By default, the timeout is set to 9200 seconds. You may override this via <uvm_root::set_timeout>.
If a timeout occurs in your simulation, or if simulation never ends despite completion of your test stimulus, then it usually indicates that a component continues to object to the end of a phase.
-
m_inst= <uvm.base.uvm_common_phases.UVMRunPhase object>¶
-
type_name= 'uvm_run_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-
class
uvm.base.uvm_common_phases.UVMExtractPhase(name='extract')[source]¶ Bases:
uvm.base.uvm_bottomup_phase.UVMBottomupPhaseExtract data from different points of the verification environment.
UVMBottomupPhasethat calls theUVMComponent.extract_phasemethod.Upon Entry: - The DUT no longer needs to be simulated. - Simulation time will no longer advance.
Typical Uses: - Extract any remaining data and final state information
from scoreboard and testbench components
Probe the DUT (via zero-time hierarchical references and/or backdoor accesses) for final state information.
Compute statistics and summaries.
Display final state information
Close files.
Exit Criteria: - All data has been collected and summarized.
-
m_inst= <uvm.base.uvm_common_phases.UVMExtractPhase object>¶
-
type_name= 'uvm_extract_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-
class
uvm.base.uvm_common_phases.UVMCheckPhase(name='check')[source]¶ Bases:
uvm.base.uvm_bottomup_phase.UVMBottomupPhaseCheck for any unexpected conditions in the verification environment.
UVMBottomupPhasethat calls theUVMComponent.check_phasemethod.Upon Entry: - All data has been collected.
Typical Uses: - Check that no unaccounted-for data remain.
Exit Criteria: - Test is known to have passed or failed.
-
m_inst= <uvm.base.uvm_common_phases.UVMCheckPhase object>¶
-
type_name= 'uvm_check_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-
-
class
uvm.base.uvm_common_phases.UVMReportPhase(name='report')[source]¶ Bases:
uvm.base.uvm_bottomup_phase.UVMBottomupPhaseReport results of the test.
UVMBottomupPhasethat calls theUVMComponent.report_phasemethod.Upon Entry: - Test is known to have passed or failed.
Typical Uses: - Report test results. - Write results to file.
Exit Criteria: - End of test.
-
m_inst= <uvm.base.uvm_common_phases.UVMReportPhase object>¶
-
type_name= 'uvm_report_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-
-
class
uvm.base.uvm_common_phases.UVMFinalPhase(name='final')[source]¶ Bases:
uvm.base.uvm_bottomup_phase.UVMBottomupPhaseTie up loose ends.
UVMTopdownPhasethat calls theUVMComponent.final_phasemethod.Upon Entry: - All test-related activity has completed.
Typical Uses: - Close files. - Terminate co-simulation engines.
Exit Criteria: - Ready to exit simulator.
-
m_inst= <uvm.base.uvm_common_phases.UVMFinalPhase object>¶
-
type_name= 'uvm_final_phase'¶
-
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:
- Returns
Type name of the object.
- Return type
-