uvm_*_registry¶
Factory Component and Object Wrappers¶
Topic: Intro¶
This section defines the proxy component and object classes used by the factory. To avoid the overhead of creating an instance of every component and object that get registered, the factory holds lightweight wrappers, or proxies. When a request for a new object is made, the factory calls upon the proxy to create the object it represents.
- class uvm.base.uvm_registry.UVMComponentRegistry(Constr: type, tname: str)[source]¶
Bases:
UVMObjectWrapper
CLASS: UVMComponentRegistry #(T,Tname)
The UVMComponentRegistry serves as a lightweight proxy for a component of type ~T~ and type name ~Tname~, a string. The proxy enables efficient registration with the <uvm_factory>. Without it, registration would require an instance of the component itself.
See <Usage> section below for information on using UVMComponentRegistry.
- registry_db: Dict[str, UVMComponentRegistry] = {'UVMAlgorithmicComparator': <uvm.base.uvm_registry.UVMComponentRegistry object>, 'UVMInOrderBuiltInComparator': <uvm.base.uvm_registry.UVMComponentRegistry object>, 'UVMInOrderClassComparator': <uvm.base.uvm_registry.UVMComponentRegistry object>, 'UVMInOrderComparator': <uvm.base.uvm_registry.UVMComponentRegistry object>, 'UVMRegPredictor': <uvm.base.uvm_registry.UVMComponentRegistry object>, 'UVMSequencer': <uvm.base.uvm_registry.UVMComponentRegistry object>}¶
- registered: Dict[str, bool] = {'UVMAlgorithmicComparator': True, 'UVMInOrderBuiltInComparator': True, 'UVMInOrderClassComparator': True, 'UVMInOrderComparator': True, 'UVMRegPredictor': True, 'UVMSequencer': True}¶
- comps: Dict[str, type] = {'UVMAlgorithmicComparator': <class 'uvm.comps.uvm_algorithmic_comparator.UVMAlgorithmicComparator'>, 'UVMInOrderBuiltInComparator': <class 'uvm.comps.uvm_in_order_comparator.UVMInOrderBuiltInComparator'>, 'UVMInOrderClassComparator': <class 'uvm.comps.uvm_in_order_comparator.UVMInOrderClassComparator'>, 'UVMInOrderComparator': <class 'uvm.comps.uvm_in_order_comparator.UVMInOrderComparator'>, 'UVMRegPredictor': <class 'uvm.reg.uvm_reg_predictor.UVMRegPredictor'>, 'UVMSequencer': <class 'uvm.seq.uvm_sequencer.UVMSequencer'>}¶
- classmethod reset() None [source]¶
Resets the state of the component registry. Used for unit testing
- create_component(name: str, parent)[source]¶
Function: create_component
Creates a component of type T having the provided
name
andparent
. This is an override of the method inUVMObjectWrapper
. It is called by the factory after determining the type of object to create. You should not call this method directly. Callcreate
instead. :param name: :param parent:Returns:
- get_type_name() str [source]¶
Function: get_type_name
Returns the value given by the string parameter,
Tname
. This method overrides the method inUVMObjectWrapper
. Returns:
- get()[source]¶
Function: get
Returns the singleton instance of this type. Type-based factory operation depends on there being a single proxy instance for each registered type. Returns:
- create(name: str, parent, contxt='')[source]¶
Function: create
Returns an instance of the component type,
T
, represented by this proxy, subject to any factory overrides based on the context provided by theparent
’s full name. Thecontxt
argument, if supplied, supersedes theparent
’s context. The new instance will have the given leafname
andparent
. :param name: :param parent: :param contxt:- Returns
The created component
- Return type
- Raises
AttributeError – If get_type_name is not defined in the object.
- set_type_override(override_type, replace=True) None [source]¶
Function: set_type_override
Configures the factory to create an object of the type represented by
override_type
whenever a request is made to create an object of the type,T
, represented by this proxy, provided no instance override applies. The original type,T
, is typically a super class of the override type. :param override_type: :param replace:
- set_inst_override(override_type, inst_path, parent=None) None [source]¶
Function: set_inst_override
Configures the factory to create a component of the type represented by
override_type
whenever a request is made to create an object of the type,T
, represented by this proxy, with matching instance paths. The original type,T
, is typically a super class of the override type.If
parent
is not specified,inst_path
is interpreted as an absolute instance path, which enables instance overrides to be set from outside component classes. Ifparent
is specified,inst_path
is interpreted as being relative to theparent
’s hierarchical instance path, i.e. ~{parent.get_full_name(),”.”,inst_path}~ is the instance path that is registered with the override. Theinst_path
may contain wildcards for matching against multiple contexts. :param override_type: :param inst_path: :param parent:
- class uvm.base.uvm_registry.UVMObjectRegistry(Constr: type, tname: str)[source]¶
Bases:
UVMObjectWrapper
- registry_db: [<class 'str'>, 'UVMObjectRegistry'] = {'UVMBuiltInPair': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMClassPair': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMMemAccessSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMMemSingleAccessSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMMemSingleWalkSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMMemWalkSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMParentChildLink': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMPhaseStateChange': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegAccessSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegBackdoor': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegBitBashSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegField': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegHWResetSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegItem': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegMap': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegMemAccessSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegMemBuiltInSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegReadOnlyCbs': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegSequence': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegSingleAccessSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegSingleBitBashSeq': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRegWriteOnlyCbs': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMRelatedLink': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMReportHandler': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMTLMGenericPayload': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMTextRecorder': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMTextTrDatabase': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMTextTrStream': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'UVMVRegField': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'uvm_get_to_lock_dap': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'uvm_set_before_get_dap': <uvm.base.uvm_registry.UVMObjectRegistry object>, 'uvm_simple_lock_dap': <uvm.base.uvm_registry.UVMObjectRegistry object>}¶
- registered: [<class 'str'>, <class 'bool'>] = {'UVMBuiltInPair': True, 'UVMClassPair': True, 'UVMMemAccessSeq': True, 'UVMMemSingleAccessSeq': True, 'UVMMemSingleWalkSeq': True, 'UVMMemWalkSeq': True, 'UVMParentChildLink': True, 'UVMPhaseStateChange': True, 'UVMRegAccessSeq': True, 'UVMRegBackdoor': True, 'UVMRegBitBashSeq': True, 'UVMRegField': True, 'UVMRegHWResetSeq': True, 'UVMRegItem': True, 'UVMRegMap': True, 'UVMRegMemAccessSeq': True, 'UVMRegMemBuiltInSeq': True, 'UVMRegReadOnlyCbs': True, 'UVMRegSequence': True, 'UVMRegSingleAccessSeq': True, 'UVMRegSingleBitBashSeq': True, 'UVMRegWriteOnlyCbs': True, 'UVMRelatedLink': True, 'UVMReportHandler': True, 'UVMTLMGenericPayload': True, 'UVMTextRecorder': True, 'UVMTextTrDatabase': True, 'UVMTextTrStream': True, 'UVMVRegField': True, 'uvm_get_to_lock_dap': True, 'uvm_set_before_get_dap': True, 'uvm_simple_lock_dap': True}¶
- objs: [<class 'str'>, <class 'type'>] = {'UVMBuiltInPair': <class 'uvm.comps.uvm_pair.UVMBuiltInPair'>, 'UVMClassPair': <class 'uvm.comps.uvm_pair.UVMClassPair'>, 'UVMMemAccessSeq': <class 'uvm.reg.sequences.uvm_mem_access_seq.UVMMemAccessSeq'>, 'UVMMemSingleAccessSeq': <class 'uvm.reg.sequences.uvm_mem_access_seq.UVMMemSingleAccessSeq'>, 'UVMMemSingleWalkSeq': <class 'uvm.reg.sequences.uvm_mem_walk_seq.UVMMemSingleWalkSeq'>, 'UVMMemWalkSeq': <class 'uvm.reg.sequences.uvm_mem_walk_seq.UVMMemWalkSeq'>, 'UVMParentChildLink': <class 'uvm.base.uvm_links.UVMParentChildLink'>, 'UVMPhaseStateChange': <class 'uvm.base.uvm_phase.UVMPhaseStateChange'>, 'UVMRegAccessSeq': <class 'uvm.reg.sequences.uvm_reg_access_seq.UVMRegAccessSeq'>, 'UVMRegBackdoor': <class 'uvm.reg.uvm_reg_backdoor.UVMRegBackdoor'>, 'UVMRegBitBashSeq': <class 'uvm.reg.sequences.uvm_reg_bit_bash_seq.UVMRegBitBashSeq'>, 'UVMRegField': <class 'uvm.reg.uvm_reg_field.UVMRegField'>, 'UVMRegHWResetSeq': <class 'uvm.reg.sequences.uvm_reg_hw_reset_seq.UVMRegHWResetSeq'>, 'UVMRegItem': <class 'uvm.reg.uvm_reg_item.UVMRegItem'>, 'UVMRegMap': <class 'uvm.reg.uvm_reg_map.UVMRegMap'>, 'UVMRegMemAccessSeq': <class 'uvm.reg.sequences.uvm_reg_access_seq.UVMRegMemAccessSeq'>, 'UVMRegMemBuiltInSeq': <class 'uvm.reg.sequences.uvm_reg_mem_built_in_seq.UVMRegMemBuiltInSeq'>, 'UVMRegReadOnlyCbs': <class 'uvm.reg.uvm_reg_cbs.UVMRegReadOnlyCbs'>, 'UVMRegSequence': <class 'uvm.reg.uvm_reg_sequence.UVMRegSequence'>, 'UVMRegSingleAccessSeq': <class 'uvm.reg.sequences.uvm_reg_access_seq.UVMRegSingleAccessSeq'>, 'UVMRegSingleBitBashSeq': <class 'uvm.reg.sequences.uvm_reg_bit_bash_seq.UVMRegSingleBitBashSeq'>, 'UVMRegWriteOnlyCbs': <class 'uvm.reg.uvm_reg_cbs.UVMRegWriteOnlyCbs'>, 'UVMRelatedLink': <class 'uvm.base.uvm_links.UVMRelatedLink'>, 'UVMReportHandler': <class 'uvm.base.uvm_report_handler.UVMReportHandler'>, 'UVMTLMGenericPayload': <class 'uvm.tlm2.uvm_tlm2_generic_payload.UVMTLMGenericPayload'>, 'UVMTextRecorder': <class 'uvm.base.uvm_recorder.UVMTextRecorder'>, 'UVMTextTrDatabase': <class 'uvm.base.uvm_tr_database.UVMTextTrDatabase'>, 'UVMTextTrStream': <class 'uvm.base.uvm_tr_stream.UVMTextTrStream'>, 'UVMVRegField': <class 'uvm.reg.uvm_vreg_field.UVMVRegField'>, 'uvm_get_to_lock_dap': <class 'uvm.dap.uvm_get_to_lock_dap.uvm_get_to_lock_dap'>, 'uvm_set_before_get_dap': <class 'uvm.dap.uvm_set_before_get_dap.uvm_set_before_get_dap'>, 'uvm_simple_lock_dap': <class 'uvm.dap.uvm_simple_lock_dap.uvm_simple_lock_dap'>}¶
- create_object(name='') UVMObject [source]¶
Function: create_object
Creates an object of type ~T~ and returns it as a handle to a
UVMObject
. This is an override of the method inUVMObjectWrapper
. It is called by the factory after determining the type of object to create. You should not call this method directly. Call <create> instead.
- get_type_name() str [source]¶
Function: get_type_name
Returns the value given by the string parameter,
Tname
. This method overrides the method inUVMObjectWrapper
. Returns:
- get()[source]¶
Function: get
Returns the singleton instance of this type. Type-based factory operation depends on there being a single proxy instance for each registered type. Returns:
- create(name, parent=None, contxt='')[source]¶
Function: create
Returns an instance of the object type,
T
, represented by this proxy, subject to any factory overrides based on the context provided by theparent
’s full name. Thecontxt
argument, if supplied, supersedes theparent
’s context. The new instance will have the given leafname
, if provided. :param name: :param parent: :param contxt:Returns:
- set_type_override(override_type, replace=True) None [source]¶
Function: set_type_override
Configures the factory to create an object of the type represented by
override_type
whenever a request is made to create an object of the type represented by this proxy, provided no instance override applies. The original type,T
, is typically a super class of the override type. :param override_type: :param replace:
- set_inst_override(override_type, inst_path: str, parent=None)[source]¶
Function: set_inst_override
Configures the factory to create an object of the type represented by
override_type
whenever a request is made to create an object of the type represented by this proxy, with matching instance paths. The original type,T
, is typically a super class of the override type.If
parent
is not specified,inst_path
is interpreted as an absolute instance path, which enables instance overrides to be set from outside component classes. Ifparent
is specified,inst_path
is interpreted as being relative to theparent
’s hierarchical instance path, i.e. ~{parent.get_full_name(),”.”,inst_path}~ is the instance path that is registered with the override. Theinst_path
may contain wildcards for matching against multiple contexts. :param override_type: :param inst_path: :param parent: