uvm_named_object_registry

The uvm_named_object_registry serves as a lightweight proxy for a named_object 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 named_object itself.

See Usage section below for information on using uvm_named_object_registry.

Summary
uvm_named_object_registry
The uvm_named_object_registry serves as a lightweight proxy for a named_object of type T and type name Tname, a string.
Class Hierarchy
uvm_object_wrapper
uvm_named_object_registry
Class Declaration
class uvm_named_object_registry #(
   type T = uvm_named_object,
   string Tname = "<unknown>"
) extends uvm_object_wrapper
Methods
create_named_objectCreates a named_object of type T having the provided name and parent.
create_objectCreates an object of type T and returns it as a handle to an <uvm_object>.
get_type_nameReturns the value given by the string parameter, Tname.
getReturns the singleton instance of this type.
createReturns an instance of the named_object type, T, represented by this proxy, subject to any factory overrides based on the context provided by the parent’s full name.
set_type_overrideConfigures 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.
set_inst_overrideConfigures the factory to create a named_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, with matching instance paths.

create_named_object

virtual function uvm_named_object create_named_object (
   string name,  
   uvm_named_object parent =  null
)

Creates a named_object of type T having the provided name and parent.  This is an override of the method in <uvm_object_wrapper>.  It is called by the factory after determining the type of object to create.  You should not call this method directly.  Call create instead.

create_object

Creates an object of type T and returns it as a handle to an <uvm_object>.  This is an override of the method in <uvm_object_wrapper>.  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

virtual function string get_type_name()

Returns the value given by the string parameter, Tname.  This method overrides the method in <uvm_object_wrapper>.

get

static function this_type get()

Returns the singleton instance of this type.  Type-based factory operation depends on there being a single proxy instance for each registered type.

create

static function T create(string name,  
uvm_named_object parent,  
string contxt = "")

Returns an instance of the named_object type, T, represented by this proxy, subject to any factory overrides based on the context provided by the parent’s full name.  The contxt argument, if supplied, supercedes the parent’s context.  The new instance will have the given leaf name and parent.

set_type_override

static function void set_type_override (uvm_object_wrapper override_type,  
bit replace = 1)

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.

set_inst_override

static function void set_inst_override(uvm_object_wrapper override_type,  
string inst_path,  
uvm_named_object parent = null)

Configures the factory to create a named_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, 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 named_object classes.  If parent is specified, inst_path is interpreted as being relative to the parent’s hierarchical instance path, i.e.  {parent.get_full_name(),”.”,inst_path} is the instance path that is registered with the override.  The inst_path may contain wildcards for matching against multiple contexts.

class uvm_named_object_registry #(
   type T = uvm_named_object,
   string Tname = "<unknown>"
) extends uvm_object_wrapper
The uvm_named_object_registry serves as a lightweight proxy for a named_object of type T and type name Tname, a string.
virtual function uvm_named_object create_named_object (
   string name,  
   uvm_named_object parent =  null
)
Creates a named_object of type T having the provided name and parent.
virtual function string get_type_name()
Returns the value given by the string parameter, Tname.
static function this_type get()
Returns the singleton instance of this type.
static function T create(string name,  
uvm_named_object parent,  
string contxt = "")
Returns an instance of the named_object type, T, represented by this proxy, subject to any factory overrides based on the context provided by the parent’s full name.
static function void set_type_override (uvm_object_wrapper override_type,  
bit replace = 1)
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.
static function void set_inst_override(uvm_object_wrapper override_type,  
string inst_path,  
uvm_named_object parent = null)
Configures the factory to create a named_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, with matching instance paths.