uvm_factory¶
- uvm.base.uvm_factory.m_has_wildcard(nm: str) bool [source]¶
Returns True if given string has wildcard * or ?
- class uvm.base.uvm_factory.UVMFactoryOverride(full_inst_path='', orig_type_name='', orig_type=None, ovrd_type=None)[source]¶
Bases:
object
- class uvm.base.uvm_factory.UVMFactory[source]¶
Bases:
object
UVMFactory is used to create objects of type
UVMComponent
andUVMObject
(and their derived user-defined types). Object and component types are registered with the factory using lightweight proxies to the actual objects and components being created. TheUVMObjectRegistry
andUVMComponentRegistry
class are used to proxyUVMObject
andUVMComponent
.The factory provides both name-based and type-based interfaces.
type-based - The type-based interface is far less prone to errors in usage.
- name-based - The name-based interface is dominated
by string arguments that can be misspelled and provided in the wrong order. Errors in name-based requests might only be caught at the time of the call, if at all.
The
UVMFactory
is an abstract class. The UVM uses theUVMDefaultFactory
class as its default factory implementation.See
UVMDefaultFactory
section for details on configuring and using the factory.- classmethod get() UVMFactory [source]¶
Function: get Static accessor for
UVMFactory
The static accessor is provided as a convenience wrapper around retrieving the factory via the
UVMCoreService.get_factory
method.# Using the uvm_coreservice_t: cs = UVMCoreService.get() f = cs.get_factory()
# Not using the uvm_coreservice_t: f = UVMFactory.get()
- Returns
Singleton instace of the factory
- Return type
- class uvm.base.uvm_factory.UVMDefaultFactory[source]¶
Bases:
UVMFactory
- m_debug_pass = False¶
- register(obj) None [source]¶
Group: Registering Types
Function: register
Registers the given proxy object,
obj
, with the factory. :param obj:
- set_type_override_by_type(original_type, override_type, replace=True)[source]¶
- #def set_type_override_by_type (uvm_object_wrapper original_type,
uvm_object_wrapper override_type, bit replace=1)
- Parameters
original_type –
override_type –
replace –
- set_type_override_by_name(original_type_name, override_type_name, replace=True)[source]¶
- Parameters
original_type_name –
override_type_name –
replace –
- check_inst_override_exists(original_type, override_type, full_inst_path)[source]¶
- #def check_inst_override_exists (uvm_object_wrapper original_type,
uvm_object_wrapper override_type, string full_inst_path)
- Parameters
original_type –
override_type –
full_inst_path –
Returns:
- set_inst_override_by_type(original_type, override_type, full_inst_path)[source]¶
- #def set_inst_override_by_type (uvm_object_wrapper original_type,
uvm_object_wrapper override_type, string full_inst_path)
- Parameters
original_type –
override_type –
full_inst_path –
- create_object_by_name(requested_type_name, parent_inst_path='', name='')[source]¶
- Parameters
requested_type_name –
parent_inst_path –
name –
Returns:
- create_object_by_type(requested_type, parent_inst_path='', name='')[source]¶
- Parameters
requested_type –
parent_inst_path –
name –
Returns:
- create_component_by_name(requested_type_name, parent_inst_path, name, parent)[source]¶
- Parameters
requested_type_name –
parent_inst_path –
name –
parent –
Returns:
- create_component_by_type(requested_type, parent_inst_path, name, parent)[source]¶
- Parameters
requested_type –
parent_inst_path –
name –
parent –
Returns:
- find_wrapper_by_name(type_name: str) Optional[UVMObjectWrapper] [source]¶
- find_override_by_name(requested_type_name, full_inst_path) Optional[UVMObjectWrapper] [source]¶
- find_override_by_type(requested_type, full_inst_path)[source]¶
- Parameters
requested_type –
full_inst_path –
Returns:
- class uvm.base.uvm_factory.UVMObjectWrapper[source]¶
Bases:
object
The UVMObjectWrapper provides an abstract interface for creating object and component proxies. Instances of these lightweight proxies, representing every
UVMObject
-based andUVMComponent
-based object available in the test environment, are registered with theUVMFactory
. When the factory is called upon to create an object or component, it finds and delegates the request to the appropriate proxy.- create_object(name='')[source]¶
Creates a new object with the optional
name
. An object proxy (e.g., <uvm_object_registry #(T,Tname)>) implements this method to create an object of a specific type, T.- Parameters
name (str) –
- Returns
UVMObject|None
- create_component(name, parent)[source]¶
Function: create_component
Creates a new component, passing to its constructor the given
name
andparent
. A component proxy (e.g. <uvm_component_registry #(T,Tname)>) implements this method to create a component of a specific type, T.- Parameters
name (str) –
parent (UVMComponent) – Parent of the created component.
- Returns
UVMComponent|None
- get_type_name()[source]¶
Derived classes implement this method to return the type name of the object created by
create_component
orcreate_object
. The factory uses this name when matching against the requested type in name-based lookups.- Returns
Name of the type
- Return type