Class uvm_pkg::uvm_resource
Inheritance Diagram of uvm_resource
Name |
Default value |
Description |
---|---|---|
T |
int |
Name |
Type |
Description |
---|---|---|
my_type |
singleton handle that represents the type of this resource |
Name |
Actual Type |
Description |
---|---|---|
this_type |
Constructors
- new(string name = "", string scope = "")
- Parameters:
name (string)
scope (string)
Functions
- convert2string()
- get_type()
Function
get_type
Static function that returns the static type handle. The return type is this_type, which is the type of the parameterized class.
- Return type:
- get_type_handle()
Function
get_type_handle
Returns the static type handle of this resource in a polymorphic fashion. The return type of get_type_handle() is uvm_resource_base. This function is not static and therefore can only be used by instances of a parameterized resource.
- Return type:
- set()
Function
set
Simply put this resource into the global resource pool
- set_override(uvm_resource_types::override_t override = 2'b11)
Function
set_override
Put a resource into the global resource pool as an override. This means it gets put at the head of the list and is searched before other existing resources that occupy the same position in the name map or the type map. The default is to override both the name and type maps. However, using the override argument you can specify that either the name map or type map is overridden.
- Parameters:
override (uvm_resource_types::override_t)
- get_by_name(string scope, string name, bit rpterr = 1)
Function
get_by_name
looks up a resource by name in the name map. The first resource with the specified name, whose type is the current type, and is visible in the specified scope is returned, if one exists. The rpterr flag indicates whether or not an error should be reported if the search fails. If rpterr is set to one then a failure message is issued, including suggested spelling alternatives, based on resource names that exist in the database, gathered by the spell checker.
- Parameters:
scope (string)
name (string)
rpterr (bit)
- Return type:
- get_by_type(string scope = "", uvm_resource_base type_handle)
Function
get_by_type
looks up a resource by type_handle in the type map. The first resource with the specified type_handle that is visible in the specified scope is returned, if one exists. If there is no resource matching the specifications, null is returned.
- Parameters:
scope (string)
type_handle (uvm_resource_base)
- Return type:
- read(uvm_object accessor = null)
Function
read
Return the object stored in the resource container. If an accessor object is supplied then also update the accessor record for this resource.
- Parameters:
accessor (uvm_object)
- write(int t, uvm_object accessor = null)
Function
write
Modify the object stored in this resource container. If the resource is read-only then issue an error message and return without modifying the object in the container. If the resource is not read-only and an accessor object has been supplied then also update the accessor record. Lastly, replace the object value in the container with the value supplied as the argument, t , and release any processes blocked on uvm_resource_base::wait_modified. If the value to be written is the same as the value already present in the resource then the write is not done. That also means that the accessor record is not updated and the modified bit is not set.
- Parameters:
t (int)
accessor (uvm_object)
- set_priority(uvm_resource_types::priority_e pri)
Function
set priority
Change the search priority of the resource based on the value of the priority enum argument, pri .
- Parameters:
- get_highest_precedence(uvm_resource_types::rsrc_q_t q)
Function
get_highest_precedence
In a queue of resources, locate the first one with the highest precedence whose type is T. This function is static so that it can be called from anywhere.
- Parameters:
- Return type:
Class
uvm_resource #(T)
Parameterized resource. Provides essential access methods to read from and write to the resource database.