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.uvm_factory_queue_class[source]

Bases: object

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 and UVMObject (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. The UVMObjectRegistry and UVMComponentRegistry class are used to proxy UVMObject and UVMComponent.

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 the UVMDefaultFactory 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

UVMFactory

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]
Parameters
  • requested_type_name (str) –

  • full_inst_path (str) –

Returns

UVMObjectWrapper

find_override_by_type(requested_type, full_inst_path)[source]
Parameters
  • requested_type

  • full_inst_path

Returns:

convert2string(all_types=True) str[source]

tpoikela: Added this to access factory string repr without print()

Parameters

all_types (bool) – If True, adds all possible types

Returns

Factory converted to string

Return type

str

print_factory(all_types=True)[source]

print

param all_types

debug_create_by_name(requested_type_name, parent_inst_path='', name='')[source]
debug_create_by_type(requested_type, parent_inst_path='', name='')[source]
m_debug_create(requested_type_name, requested_type, parent_inst_path, name)[source]
m_debug_display(requested_type_name, result, full_inst_path)[source]
are_args_ok(qc_elem, requested_type, full_inst_path) bool[source]
args_are_ok_again(type_override, requested_type) bool[source]
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 and UVMComponent-based object available in the test environment, are registered with the UVMFactory. 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 and parent. 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 or create_object. The factory uses this name when matching against the requested type in name-based lookups.

Returns

Name of the type

Return type

str