[source]

Class uvm_resource_db

uvm_pkg::uvm_resource_db <T> + dump(): void + get_by_name(): rsrc_t + get_by_type(): rsrc_t + read_by_name(): bit + read_by_type(): bit + set(): void + set_anonymous(): void + set_default(): rsrc_t + set_override(): void + set_override_name(): void + set_override_type(): void + write_by_name(): bit + write_by_type(): bit uvm_pkg::uvm_config_db <T> <T : T>

Inheritance Diagram of uvm_resource_db

All of the functions in uvm_resource_db#(T) are static, so they must be called using the :: operator. For example:

uvm_resource_db#(int)::set(&quot;A&quot;, &quot;*&quot;, 17, this);

The parameter value "int" identifies the resource type as uvm_resource#(int). Thus, the type of the object in the resource container is int. This maintains the type-safety characteristics of resource operations.

Parameters

Name

Default value

Description

T

uvm_object

Typedefs

Name

Actual Type

Description

rsrc_t

uvm_resource#(T)

Functions

static function rsrc_t get_by_type ( string scope ) [source]

Get a resource by type. The type is specified in the db class parameter so the only argument to this function is the scope .

static function rsrc_t get_by_name ( string scope, string name, bit rpterr ) [source]

Imports a resource by name . The first argument is the current scope of the resource to be retrieved and the second argument is the name . The rpterr flag indicates whether or not to generate a warning if no matching resource is found.

static function rsrc_t set_default ( string scope, string name ) [source]

add a new item into the resources database. The item will not be written to so it will have its default value. The resource is created using name and scope as the lookup parameters.

static function void set ( string scope, string name, uvm_object val, uvm_object accessor ) [source]

Create a new resource, write a val to it, and set it into the database using name and scope as the lookup parameters. The accessor is used for auditing.

static function void set_anonymous ( string scope, uvm_object val, uvm_object accessor ) [source]

Create a new resource, write a val to it, and set it into the database. The resource has no name and therefore will not be entered into the name map. But is does have a scope for lookup purposes. The accessor is used for auditing.

static function void set_override ( string scope, string name, uvm_object val, uvm_object accessor ) [source]

function set_override

Create a new resource, write val to it, and set it into the database. Set it at the beginning of the queue in the type map and the name map so that it will be (currently) the highest priority resource with the specified name and type.

static function void set_override_type ( string scope, string name, uvm_object val, uvm_object accessor ) [source]

function set_override_type

Create a new resource, write val to it, and set it into the database. Set it at the beginning of the queue in the type map so that it will be (currently) the highest priority resource with the specified type. It will be normal priority (i.e. at the end of the queue) in the name map.

static function void set_override_name ( string scope, string name, uvm_object val, uvm_object accessor ) [source]

function set_override_name

Create a new resource, write val to it, and set it into the database. Set it at the beginning of the queue in the name map so that it will be (currently) the highest priority resource with the specified name. It will be normal priority (i.e. at the end of the queue) in the type map.

static function bit read_by_name ( string scope, string name, uvm_object val, uvm_object accessor ) [source]

locate a resource by name and scope and read its value. The value is returned through the output argument val . The return value is a bit that indicates whether or not the read was successful. The accessor is used for auditing.

static function bit read_by_type ( string scope, uvm_object val, uvm_object accessor ) [source]

Read a value by type. The value is returned through the output argument val . The scope is used for the lookup. The return value is a bit that indicates whether or not the read is successful. The accessor is used for auditing.

static function bit write_by_name ( string scope, string name, uvm_object val, uvm_object accessor ) [source]

write a val into the resources database. First, look up the resource by name and scope . If it is not located then add a new resource to the database and then write its value.

Because the scope is matched to a resource which may be a regular expression, and consequently may target other scopes beyond the scope argument. Care must be taken with this function. If a get_by_name match is found for name and scope then val will be written to that matching resource and thus may impact other scopes which also match the resource.

static function bit write_by_type ( string scope, uvm_object val, uvm_object accessor ) [source]

write a val into the resources database. First, look up the resource by type. If it is not located then add a new resource to the database and then write its value.

Because the scope is matched to a resource which may be a regular expression, and consequently may target other scopes beyond the scope argument. Care must be taken with this function. If a get_by_name match is found for name and scope then val will be written to that matching resource and thus may impact other scopes which also match the resource.

static function void dump ( ) [source]

Dump all the resources in the resource pool. This is useful for debugging purposes. This function does not use the parameter T, so it will dump the same thing -- the entire database -- no matter the value of the parameter.