[source]

Class uvm_resource_base

uvm_pkg::uvm_resource_base + access[string] : uvm_resource_types::access_t + default_precedence : int unsigned + precedence : int unsigned + convert2string(): string + do_print(): void + get_scope(): string + get_type_handle(): uvm_resource_base + init_access_record(): void + is_read_only(): bit + match_scope(): bit + print_accessors(): void + record_read_access(): void + record_write_access(): void + set_priority(): void + set_read_only(): void + set_read_write(): void + set_scope(): void + wait_modified() uvm_pkg::uvm_resource <T>

Inheritance Diagram of uvm_resource_base

Non-parameterized base class for resources. Supports interfaces for scope matching, and virtual functions for printing the resource and for printing the accessor list

Variables

Name

Type

Description

access

uvm_resource_types::access_t

precedence

int unsigned

This variable is used to associate a precedence that a resource has with respect to other resources which match the same scope and name. Resources are set to the default_precedence initially, and may be set to a higher or lower precedence as desired.

default_precedence

int unsigned

The default precedence for an resource that has been created. When two resources have the same precedence, the first resource found has precedence.

Constructors

function new ( string name, string s ) [source]

constructor for uvm_resource_base. The constructor takes two arguments, the name of the resource and a regular expression which represents the set of scopes over which this resource is visible.

Functions

virtual function uvm_resource_base get_type_handle ( ) [source]

Pure virtual function that returns the type handle of the resource container.

function void set_read_only ( ) [source]

Establishes this resource as a read-only resource. An attempt to call uvm_resource#(T)::write on the resource will cause an error.

function void set_read_write ( ) [source]

Implementation question

Not sure if this function is necessary.

Once a resource is set to read_only no one should be able to change that. If anyone can flip the read_only bit then the resource is not truly read_only.

function bit is_read_only ( ) [source]

Returns one if this resource has been set to read-only, zero otherwise

function void set_scope ( string s ) [source]

Set the value of the regular expression that identifies the set of scopes over which this resource is visible. If the supplied argument is a glob it will be converted to a regular expression before it is stored.

function string get_scope ( ) [source]

Retrieve the regular expression string that identifies the set of scopes over which this resource is visible.

function bit match_scope ( string s ) [source]

Using the regular expression facility, determine if this resource is visible in a scope. Return one if it is, zero otherwise.

virtual function void set_priority ( uvm_resource_types::priority_e pri ) [source]

Function

set priority

Change the search priority of the resource based on the value of the priority enum argument.

virtual function string convert2string ( ) [source]

function convert2string

Create a string representation of the resource value. By default we don't know how to do this so we just return a "?". Resource specializations are expected to override this function to produce a proper string representation of the resource value.

virtual function void do_print ( uvm_printer printer ) [source]

Implementation of do_print which is called by print().

function void record_read_access ( uvm_object accessor ) [source]

function void record_write_access ( uvm_object accessor ) [source]

virtual function void print_accessors ( ) [source]

Dump the access records for this resource

function void init_access_record ( uvm_resource_types::access_t access_record ) [source]

Initialize a new access record

Tasks

function wait_modified ( ) [source]

This task blocks until the resource has been modified -- that is, a uvm_resource#(T)::write operation has been performed. When a uvm_resource#(T)::write is performed the modified bit is set which releases the block. Wait_modified() then clears the modified bit so it can be called repeatedly.