UVM Common Phases¶
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
UVMBuildPhase
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:
UVMTopdownPhase
Class: UVMBuildPhase
Create and configure of testbench structure
UVMTopdownPhase
that calls theUVMComponent.build_phase
method.- 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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- class uvm.base.uvm_common_phases.UVMConnectPhase(name='connect')[source]¶
Bases:
UVMBottomupPhase
Establish cross-component connections.
UVMBottomupPhase
that calls theUVMComponent.connect_phase
method.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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- class uvm.base.uvm_common_phases.UVMEndOfElaborationPhase(name='end_of_elaboration')[source]¶
Bases:
UVMBottomupPhase
Fine-tune the testbench.
UVMBottomupPhase
that calls theUVMComponent.end_of_elaboration_phase
method.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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- class uvm.base.uvm_common_phases.UVMStartofSimulationPhase(name='start_of_simulation')[source]¶
Bases:
UVMBottomupPhase
Get ready for DUT to be simulated.
UVMBottomupPhase
that calls theUVMComponent.start_of_simulation_phase
method.- 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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- class uvm.base.uvm_common_phases.UVMRunPhase(name='run')[source]¶
Bases:
UVMTaskPhase
Stimulate the DUT.
This
UVMTaskPhase
calls theUVMComponent.run_phase
virtual method. This phase runs in parallel to the runtime phases,UVMPreResetPhase
throughUVMPostShutdownPhase
. 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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- class uvm.base.uvm_common_phases.UVMExtractPhase(name='extract')[source]¶
Bases:
UVMBottomupPhase
Extract data from different points of the verification environment.
UVMBottomupPhase
that calls theUVMComponent.extract_phase
method.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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- class uvm.base.uvm_common_phases.UVMCheckPhase(name='check')[source]¶
Bases:
UVMBottomupPhase
Check for any unexpected conditions in the verification environment.
UVMBottomupPhase
that calls theUVMComponent.check_phase
method.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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- class uvm.base.uvm_common_phases.UVMReportPhase(name='report')[source]¶
Bases:
UVMBottomupPhase
Report results of the test.
UVMBottomupPhase
that calls theUVMComponent.report_phase
method.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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- class uvm.base.uvm_common_phases.UVMFinalPhase(name='final')[source]¶
Bases:
UVMBottomupPhase
Tie up loose ends.
UVMTopdownPhase
that calls theUVMComponent.final_phase
method.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:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type