# uvm_resource_db

Implementation of uvm_resource_db, as defined in section C.3.2.1 of 1800.2-2017.

>     class uvm_resource_db#(type T=uvm_object)

Summary

uvm_resource_db
Implementation of uvm_resource_db, as defined in section C.3.2.1 of 1800.2-2017.
Methods |
read_by_name | Locates a resource by name and scope and reads its value.
read_by_type | Reads a value by type.

### Methods

### read_by_name

Locates a resource by name and scope and reads its value. The value is returned through the inout argument val. The return value is a bit that indicates whether or not the read was successful. The accessor is available for an implementation to use for debug purposes only; its value shall have no functional effect on outcome of this method.

Note: This function deviates from IEEE 1800.2-2017 LRM as it defines the val argument as inout, whereas the LRM defines it as an output.

>     static function bit read_by_name(input string scope,
>                                      input string name,
>                                      inout T val,
>                                      input uvm_object accessor = null);

The implementation treats the argument as inout for cases where a read may fail and the value will not change from its original supplied value.

@uvm-contrib This API is being considered for potential contribution to 1800.2

### read_by_type

Reads a value by type. The value is returned through the inout 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 available for an implementation to use for debug purposes only; its value shall have no functional effect on outcome of this method.

Note: This function deviates from IEEE 1800.2-2017 LRM as it defines the <val> argument as inout, whereas the LRM defines it as an output.

>     static function bit read_by_type(input string scope,
>                                      inout T val,
>                                      input uvm_object accessor = null);

The implementation treats the argument as inout for cases where a read may fail and the value will not change from its original supplied value.

@uvm-contrib This API is being considered for potential contribution to 1800.2