Register abstraction base class
A register represents a set of fields that are accessible as a single entity.
A register may be mapped to one or more address maps, each with different access rights and policy.
uvm_reg | ||||
Register abstraction base class | ||||
Class Hierarchy | ||||
| ||||
Class Declaration | ||||
| ||||
Initialization | ||||
new | Create a new instance and type-specific configuration | |||
configure | Instance-specific configuration | |||
set_offset | Modify the offset of the register | |||
Introspection | ||||
get_name | Get the simple name | |||
get_full_name | Get the hierarchical name | |||
get_parent | Get the parent block | |||
get_regfile | Get the parent register file | |||
get_n_maps | Returns the number of address maps this register is mapped in | |||
is_in_map | Returns 1 if this register is in the specified address map | |||
get_maps | Returns all of the address maps where this register is mapped | |||
get_rights | Returns the accessibility (“RW, “RO”, or “WO”) of this register in the given map. | |||
get_n_bits | Returns the width, in bits, of this register. | |||
get_n_bytes | Returns the width, in bytes, of this register. | |||
get_max_size | Returns the maximum width, in bits, of all registers. | |||
get_fields | Return the fields in this register | |||
get_field_by_name | Return the named field in this register | |||
get_offset | Returns the offset of this register | |||
get_address | Returns the base external physical address of this register | |||
get_addresses | Identifies the external physical address(es) of this register | |||
Access | ||||
set | Set the desired value for this register | |||
get | Return the desired value of the fields in the register. | |||
get_mirrored_value | Return the mirrored value of the fields in the register. | |||
needs_update | Returns 1 if any of the fields need updating | |||
reset | Reset the desired/mirrored value for this register. | |||
get_reset | Get the specified reset value for this register | |||
has_reset | Check if any field in the register has a reset value specified for the specified reset kind. | |||
set_reset | Specify or modify the reset value for this register | |||
write | Write the specified value in this register | |||
read | Read the current value from this register | |||
poke | Deposit the specified value in this register | |||
peek | Read the current value from this register | |||
update | Updates the content of the register in the design to match the desired value | |||
mirror | Read the register and update/check its mirror value | |||
predict | Update the mirrored and desired value for this register. | |||
is_busy | Returns 1 if register is currently being read or written. | |||
Frontdoor | ||||
set_frontdoor | Set a user-defined frontdoor for this register | |||
get_frontdoor | Returns the user-defined frontdoor for this register | |||
Backdoor | ||||
set_backdoor | Set a user-defined backdoor for this register | |||
get_backdoor | Returns the user-defined backdoor for this register | |||
clear_hdl_path | Delete HDL paths | |||
add_hdl_path | Add an HDL path | |||
add_hdl_path_slice | Append the specified HDL slice to the HDL path of the register instance for the specified design abstraction. | |||
has_hdl_path | Check if a HDL path is specified | |||
get_hdl_path | Get the incremental HDL path(s) | |||
get_hdl_path_kinds | Get design abstractions for which HDL paths have been defined | |||
get_full_hdl_path | Get the full hierarchical HDL path(s) | |||
backdoor_read | User-define backdoor read access | |||
backdoor_write | User-defined backdoor read access | |||
backdoor_read_func | User-defined backdoor read access | |||
backdoor_watch | User-defined DUT register change monitor | |||
Coverage | ||||
include_coverage | Specify which coverage model that must be included in various block, register or memory abstraction class instances. | |||
build_coverage | Check if all of the specified coverage models must be built. | |||
add_coverage | Specify that additional coverage models are available. | |||
has_coverage | Check if register has coverage model(s) | |||
set_coverage | Turns on coverage measurement. | |||
get_coverage | Check if coverage measurement is on. | |||
sample | Functional coverage measurement method | |||
sample_values | Functional coverage measurement method for field values | |||
Callbacks | ||||
pre_write | Called before register write. | |||
post_write | Called after register write. | |||
pre_read | Called before register read. | |||
post_read | Called after register read. |
function new ( string name = "", int unsigned n_bits, int has_coverage )
Create a new instance and type-specific configuration
Creates an instance of a register abstraction class with the specified name.
n_bits specifies the total number of bits in the register. Not all bits need to be implemented. This value is usually a multiple of 8.
has_coverage specifies which functional coverage models are present in the extension of the register abstraction class. Multiple functional coverage models may be specified by adding their symbolic names, as defined by the uvm_coverage_model_e type.
function void configure ( uvm_reg_block blk_parent, uvm_reg_file regfile_parent = null, string hdl_path = "" )
Instance-specific configuration
Specify the parent block of this register. May also set a parent register file for this register,
If the register is implemented in a single HDL variable, its name is specified as the hdl_path. Otherwise, if the register is implemented as a concatenation of variables (usually one per field), then the HDL path must be specified using the add_hdl_path() or add_hdl_path_slice method.
virtual function void set_offset ( uvm_reg_map map, uvm_reg_addr_t offset, bit unmapped = 0 )
Modify the offset of the register
The offset of a register within an address map is set using the uvm_reg_map::add_reg() method. This method is used to modify that offset dynamically.
Modifying the offset of a register will make the register model diverge from the specification that was used to create it.
Get the simple name
Return the simple object name of this register.
virtual function string get_full_name()
Get the hierarchical name
Return the hierarchal name of this register. The base of the hierarchical name is the root block.
virtual function uvm_reg_file get_regfile ()
Get the parent register file
Returns null if this register is instantiated in a block.
virtual function int get_n_maps ()
Returns the number of address maps this register is mapped in
function bit is_in_map ( uvm_reg_map map )
Returns 1 if this register is in the specified address map
virtual function void get_maps ( ref uvm_reg_map maps[$] )
Returns all of the address maps where this register is mapped
virtual function string get_rights ( uvm_reg_map map = null )
Returns the accessibility (“RW, “RO”, or “WO”) of this register in the given map.
If no address map is specified and the register is mapped in only one address map, that address map is used. If the register is mapped in more than one address map, the default address map of the parent block is used.
Whether a register field can be read or written depends on both the field’s configured access policy (refer to uvm_reg_field::configure) and the register’s accessibility rights in the map being used to access the field.
If an address map is specified and the register is not mapped in the specified address map, an error message is issued and “RW” is returned.
virtual function int unsigned get_n_bits ()
Returns the width, in bits, of this register.
virtual function int unsigned get_n_bytes()
Returns the width, in bytes, of this register. Rounds up to next whole byte if register is not a multiple of 8.
static function int unsigned get_max_size()
Returns the maximum width, in bits, of all registers.
virtual function void get_fields ( ref uvm_reg_field fields[$] )
Return the fields in this register
Fills the specified array with the abstraction class for all of the fields contained in this register. Fields are ordered from least-significant position to most-significant position within the register.
virtual function uvm_reg_field get_field_by_name( string name )
Return the named field in this register
Finds a field with the specified name in this register and returns its abstraction class. If no fields are found, returns null.
virtual function uvm_reg_addr_t get_offset ( uvm_reg_map map = null )
Returns the offset of this register
Returns the offset of this register in an address map.
If no address map is specified and the register is mapped in only one address map, that address map is used. If the register is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the register is not mapped in the specified address map, an error message is issued.
virtual function uvm_reg_addr_t get_address ( uvm_reg_map map = null )
Returns the base external physical address of this register
Returns the base external physical address of this register if accessed through the specified address map.
If no address map is specified and the register is mapped in only one address map, that address map is used. If the register is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the register is not mapped in the specified address map, an error message is issued.
virtual function int get_addresses ( uvm_reg_map map = null, ref uvm_reg_addr_t addr[] )
Identifies the external physical address(es) of this register
Computes all of the external physical addresses that must be accessed to completely read or write this register. The addressed are specified in little endian order. Returns the number of bytes transferred on each access.
If no address map is specified and the register is mapped in only one address map, that address map is used. If the register is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the register is not mapped in the specified address map, an error message is issued.
virtual function void set ( uvm_reg_data_t value, string fname = "", int lineno = 0 )
Set the desired value for this register
Sets the desired value of the fields in the register to the specified value. Does not actually set the value of the register in the design, only the desired value in its corresponding abstraction class in the RegModel model. Use the uvm_reg::update() method to update the actual register with the mirrored value or the uvm_reg::write() method to set the actual register and its mirrored value.
Unless this method is used, the desired value is equal to the mirrored value.
Refer uvm_reg_field::set() for more details on the effect of setting mirror values on fields with different access policies.
To modify the mirrored field values to a specific value, and thus use the mirrored as a scoreboard for the register values in the DUT, use the uvm_reg::predict() method.
virtual function uvm_reg_data_t get( string fname = "", int lineno = 0 )
Return the desired value of the fields in the register.
Does not actually read the value of the register in the design, only the desired value in the abstraction class. Unless set to a different value using the uvm_reg::set(), the desired value and the mirrored value are identical.
Use the uvm_reg::read() or uvm_reg::peek() method to get the actual register value.
If the register contains write-only fields, the desired/mirrored value for those fields are the value last written and assumed to reside in the bits implementing these fields. Although a physical read operation would something different for these fields, the returned value is the actual content.
virtual function uvm_reg_data_t get_mirrored_value( string fname = "", int lineno = 0 )
Return the mirrored value of the fields in the register.
Does not actually read the value of the register in the design
If the register contains write-only fields, the desired/mirrored value for those fields are the value last written and assumed to reside in the bits implementing these fields. Although a physical read operation would something different for these fields, the returned value is the actual content.
virtual function bit needs_update()
Returns 1 if any of the fields need updating
See uvm_reg_field::needs_update() for details. Use the uvm_reg::update() to actually update the DUT register.
virtual function void reset( string kind = "HARD" )
Reset the desired/mirrored value for this register.
Sets the desired and mirror value of the fields in this register to the reset value for the specified reset kind. See uvm_reg_field.reset() for more details.
Also resets the semaphore that prevents concurrent access to the register. This semaphore must be explicitly reset if a thread accessing this register array was killed in before the access was completed
virtual function uvm_reg_data_t get_reset( string kind = "HARD" )
Get the specified reset value for this register
Return the reset value for this register for the specified reset kind.
virtual function bit has_reset( string kind = "HARD", bit delete = 0 )
Check if any field in the register has a reset value specified for the specified reset kind. If delete is TRUE, removes the reset value, if any.
virtual function void set_reset( uvm_reg_data_t value, string kind = "HARD" )
Specify or modify the reset value for this register
Specify or modify the reset value for all the fields in the register corresponding to the cause specified by kind.
virtual task write( output uvm_status_e status, input uvm_reg_data_t value, input uvm_path_e path = UVM_DEFAULT_PATH, input uvm_reg_map map = null, input uvm_sequence_base parent = null, input int prior = -1, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Write the specified value in this register
Write value in the DUT register that corresponds to this abstraction class instance using the specified access path. If the register is mapped in more than one address map, an address map must be specified if a physical access is used (front-door access). If a back-door access path is used, the effect of writing the register through a physical access is mimicked. For example, read-only bits in the registers will not be written.
The mirrored value will be updated using the uvm_reg::predict() method.
virtual task read( output uvm_status_e status, output uvm_reg_data_t value, input uvm_path_e path = UVM_DEFAULT_PATH, input uvm_reg_map map = null, input uvm_sequence_base parent = null, input int prior = -1, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Read the current value from this register
Read and return value from the DUT register that corresponds to this abstraction class instance using the specified access path. If the register is mapped in more than one address map, an address map must be specified if a physical access is used (front-door access). If a back-door access path is used, the effect of reading the register through a physical access is mimicked. For example, clear-on-read bits in the registers will be set to zero.
The mirrored value will be updated using the uvm_reg::predict() method.
virtual task poke( output uvm_status_e status, input uvm_reg_data_t value, input string kind = "", input uvm_sequence_base parent = null, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Deposit the specified value in this register
Deposit the value in the DUT register corresponding to this abstraction class instance, as-is, using a back-door access.
Uses the HDL path for the design abstraction specified by kind.
The mirrored value will be updated using the uvm_reg::predict() method.
virtual task peek( output uvm_status_e status, output uvm_reg_data_t value, input string kind = "", input uvm_sequence_base parent = null, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Read the current value from this register
Sample the value in the DUT register corresponding to this abstraction class instance using a back-door access. The register value is sampled, not modified.
Uses the HDL path for the design abstraction specified by kind.
The mirrored value will be updated using the uvm_reg::predict() method.
virtual task update( output uvm_status_e status, input uvm_path_e path = UVM_DEFAULT_PATH, input uvm_reg_map map = null, input uvm_sequence_base parent = null, input int prior = -1, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Updates the content of the register in the design to match the desired value
This method performs the reverse operation of uvm_reg::mirror(). Write this register if the DUT register is out-of-date with the desired/mirrored value in the abstraction class, as determined by the uvm_reg::needs_update() method.
The update can be performed using the using the physical interfaces (frontdoor) or uvm_reg::poke() (backdoor) access. If the register is mapped in multiple address maps and physical access is used (front-door), an address map must be specified.
virtual task mirror( output uvm_status_e status, input uvm_check_e check = UVM_NO_CHECK, input uvm_path_e path = UVM_DEFAULT_PATH, input uvm_reg_map map = null, input uvm_sequence_base parent = null, input int prior = -1, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Read the register and update/check its mirror value
Read the register and optionally compared the readback value with the current mirrored value if check is UVM_CHECK. The mirrored value will be updated using the uvm_reg::predict() method based on the readback value.
The mirroring can be performed using the physical interfaces (frontdoor) or uvm_reg::peek() (backdoor).
If check is specified as UVM_CHECK, an error message is issued if the current mirrored value does not match the readback value. Any field whose check has been disabled with uvm_reg_field::set_compare() will not be considered in the comparison.
If the register is mapped in multiple address maps and physical access is used (front-door access), an address map must be specified. If the register contains write-only fields, their content is mirrored and optionally checked only if a UVM_BACKDOOR access path is used to read the register.
virtual function bit predict ( uvm_reg_data_t value, uvm_reg_byte_en_t be = -1, uvm_predict_e kind = UVM_PREDICT_DIRECT, uvm_path_e path = UVM_FRONTDOOR, uvm_reg_map map = null, string fname = "", int lineno = 0 )
Update the mirrored and desired value for this register.
Predict the mirror (and desired) value of the fields in the register based on the specified observed value on a specified address map, or based on a calculated value. See uvm_reg_field::predict() for more details.
Returns TRUE if the prediction was successful for each field in the register.
function void set_frontdoor( uvm_reg_frontdoor ftdr, uvm_reg_map map = null, string fname = "", int lineno = 0 )
Set a user-defined frontdoor for this register
By default, registers are mapped linearly into the address space of the address maps that instantiate them. If registers are accessed using a different mechanism, a user-defined access mechanism must be defined and associated with the corresponding register abstraction class
If the register is mapped in multiple address maps, an address map must be specified.
function uvm_reg_frontdoor get_frontdoor( uvm_reg_map map = null )
Returns the user-defined frontdoor for this register
If null, no user-defined frontdoor has been defined. A user-defined frontdoor is defined by using the uvm_reg::set_frontdoor() method.
If the register is mapped in multiple address maps, an address map must be specified.
function void set_backdoor( uvm_reg_backdoor bkdr, string fname = "", int lineno = 0 )
Set a user-defined backdoor for this register
By default, registers are accessed via the built-in string-based DPI routines if an HDL path has been specified using the uvm_reg::configure() or uvm_reg::add_hdl_path() method.
If this default mechanism is not suitable (e.g. because the register is not implemented in pure SystemVerilog) a user-defined access mechanism must be defined and associated with the corresponding register abstraction class
A user-defined backdoor is required if active update of the mirror of this register abstraction class, based on observed changes of the corresponding DUT register, is used.
function uvm_reg_backdoor get_backdoor( bit inherited = 1 )
Returns the user-defined backdoor for this register
If null, no user-defined backdoor has been defined. A user-defined backdoor is defined by using the uvm_reg::set_backdoor() method.
If inherited is TRUE, returns the backdoor of the parent block if none have been specified for this register.
function void clear_hdl_path ( string kind = "RTL" )
Delete HDL paths
Remove any previously specified HDL path to the register instance for the specified design abstraction.
function void add_hdl_path ( uvm_hdl_path_slice slices[], string kind = "RTL" )
Add an HDL path
Add the specified HDL path to the register instance for the specified design abstraction. This method may be called more than once for the same design abstraction if the register is physically duplicated in the design abstraction
For example, the following register
1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 Bits: 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +-+---+-------------+---+-------+ |A|xxx| B |xxx| C | +-+---+-------------+---+-------+
add_hdl_path('{ '{"A_reg", 15, 1}, '{"B_reg", 6, 7}, '{'C_reg", 0, 4} } );
If the register is implemented using a single HDL variable, The array should specify a single slice with its offset and size specified as -1. For example:
r1.add_hdl_path('{ '{"r1", -1, -1} });
function void add_hdl_path_slice( string name, int offset, int size, bit first = 0, string kind = "RTL" )
Append the specified HDL slice to the HDL path of the register instance for the specified design abstraction. If first is TRUE, starts the specification of a duplicate HDL implementation of the register.
function bit has_hdl_path ( string kind = "" )
Check if a HDL path is specified
Returns TRUE if the register instance has a HDL path defined for the specified design abstraction. If no design abstraction is specified, uses the default design abstraction specified for the parent block.
function void get_hdl_path ( ref uvm_hdl_path_concat paths[$], input string kind = "" )
Get the incremental HDL path(s)
Returns the HDL path(s) defined for the specified design abstraction in the register instance. Returns only the component of the HDL paths that corresponds to the register, not a full hierarchical path
If no design abstraction is specified, the default design abstraction for the parent block is used.
function void get_hdl_path_kinds ( ref string kinds[$] )
Get design abstractions for which HDL paths have been defined
function void get_full_hdl_path ( ref uvm_hdl_path_concat paths[$], input string kind = "", input string separator = "." )
Get the full hierarchical HDL path(s)
Returns the full hierarchical HDL path(s) defined for the specified design abstraction in the register instance. There may be more than one path returned even if only one path was defined for the register instance, if any of the parent components have more than one path defined for the same design abstraction
If no design abstraction is specified, the default design abstraction for each ancestor block is used to get each incremental path.
virtual task backdoor_read( uvm_reg_item rw )
User-define backdoor read access
Override the default string-based DPI backdoor access read for this register type. By default calls uvm_reg::backdoor_read_func().
virtual task backdoor_write( uvm_reg_item rw )
User-defined backdoor read access
Override the default string-based DPI backdoor access write for this register type.
virtual function uvm_status_e backdoor_read_func( uvm_reg_item rw )
User-defined backdoor read access
Override the default string-based DPI backdoor access read for this register type.
virtual task backdoor_watch()
User-defined DUT register change monitor
Watch the DUT register corresponding to this abstraction class instance for any change in value and return when a value-change occurs. This may be implemented a string-based DPI access if the simulation tool provide a value-change callback facility. Such a facility does not exists in the standard SystemVerilog DPI and thus no default implementation for this method can be provided.
static function void include_coverage( string scope, uvm_reg_cvr_t models, uvm_object accessor = null )
Specify which coverage model that must be included in various block, register or memory abstraction class instances.
The coverage models are specified by OR’ing or adding the uvm_coverage_model_e coverage model identifiers corresponding to the coverage model to be included.
The scope specifies a hierarchical name or pattern identifying a block, memory or register abstraction class instances. Any block, memory or register whose full hierarchical name matches the specified scope will have the specified functional coverage models included in them.
The scope can be specified as a POSIX regular expression or simple pattern. See uvm_resource_base::Scope Interface for more details.
uvm_reg::include_coverage("*", UVM_CVR_ALL);
The specification of which coverage model to include in which abstraction class is stored in a uvm_reg_cvr_t resource in the uvm_resource_db resource database, in the “uvm_reg::” scope namespace.
protected function uvm_reg_cvr_t build_coverage( uvm_reg_cvr_t models )
Check if all of the specified coverage models must be built.
Check which of the specified coverage model must be built in this instance of the register abstraction class, as specified by calls to uvm_reg::include_coverage().
Models are specified by adding the symbolic value of individual coverage model as defined in uvm_coverage_model_e. Returns the sum of all coverage models to be built in the register model.
virtual protected function void add_coverage( uvm_reg_cvr_t models )
Specify that additional coverage models are available.
Add the specified coverage model to the coverage models available in this class. Models are specified by adding the symbolic value of individual coverage model as defined in uvm_coverage_model_e.
This method shall be called only in the constructor of subsequently derived classes.
virtual function bit has_coverage( uvm_reg_cvr_t models )
Check if register has coverage model(s)
Returns TRUE if the register abstraction class contains a coverage model for all of the models specified. Models are specified by adding the symbolic value of individual coverage model as defined in uvm_coverage_model_e.
virtual function uvm_reg_cvr_t set_coverage( uvm_reg_cvr_t is_on )
Turns on coverage measurement.
Turns the collection of functional coverage measurements on or off for this register. The functional coverage measurement is turned on for every coverage model specified using uvm_coverage_model_e symbolic identifiers. Multiple functional coverage models can be specified by adding the functional coverage model identifiers. All other functional coverage models are turned off. Returns the sum of all functional coverage models whose measurements were previously on.
This method can only control the measurement of functional coverage models that are present in the register abstraction classes, then enabled during construction. See the uvm_reg::has_coverage() method to identify the available functional coverage models.
virtual function bit get_coverage( uvm_reg_cvr_t is_on )
Check if coverage measurement is on.
Returns TRUE if measurement for all of the specified functional coverage models are currently on. Multiple functional coverage models can be specified by adding the functional coverage model identifiers.
See uvm_reg::set_coverage() for more details.
protected virtual function void sample( uvm_reg_data_t data, uvm_reg_data_t byte_en, bit is_read, uvm_reg_map map )
Functional coverage measurement method
This method is invoked by the register abstraction class whenever it is read or written with the specified data via the specified address map. It is invoked after the read or write operation has completed but before the mirror has been updated.
Empty by default, this method may be extended by the abstraction class generator to perform the required sampling in any provided functional coverage model.
virtual function void sample_values()
Functional coverage measurement method for field values
This method is invoked by the user or by the uvm_reg_block::sample_values() method of the parent block to trigger the sampling of the current field values in the register-level functional coverage model.
This method may be extended by the abstraction class generator to perform the required sampling in any provided field-value functional coverage model.
virtual task pre_write( uvm_reg_item rw )
Called before register write.
If the specified data value, access path or address map are modified, the updated data value, access path or address map will be used to perform the register operation. If the status is modified to anything other than UVM_IS_OK, the operation is aborted.
The registered callback methods are invoked after the invocation of this method. All register callbacks are executed before the corresponding field callbacks
virtual task post_write( uvm_reg_item rw )
Called after register write.
If the specified status is modified, the updated status will be returned by the register operation.
The registered callback methods are invoked before the invocation of this method. All register callbacks are executed before the corresponding field callbacks
virtual task pre_read( uvm_reg_item rw )
Called before register read.
If the specified access path or address map are modified, the updated access path or address map will be used to perform the register operation. If the status is modified to anything other than UVM_IS_OK, the operation is aborted.
The registered callback methods are invoked after the invocation of this method. All register callbacks are executed before the corresponding field callbacks
virtual task post_read( uvm_reg_item rw )
Called after register read.
If the specified readback data or status is modified, the updated readback data or status will be returned by the register operation.
The registered callback methods are invoked before the invocation of this method. All register callbacks are executed before the corresponding field callbacks
The uvm_void class is the base class for all UVM classes.
virtual class uvm_void
The uvm_object class is the base class for all UVM data and hierarchical classes.
virtual class uvm_object extends uvm_void
Register abstraction base class
virtual class uvm_reg extends uvm_object
Create a new instance and type-specific configuration
function new ( string name = "", int unsigned n_bits, int has_coverage )
Instance-specific configuration
function void configure ( uvm_reg_block blk_parent, uvm_reg_file regfile_parent = null, string hdl_path = "" )
Modify the offset of the register
virtual function void set_offset ( uvm_reg_map map, uvm_reg_addr_t offset, bit unmapped = 0 )
Get the hierarchical name
virtual function string get_full_name()
Get the parent block
virtual function uvm_reg_block get_parent ()
Get the parent register file
virtual function uvm_reg_file get_regfile ()
Returns the number of address maps this register is mapped in
virtual function int get_n_maps ()
Returns 1 if this register is in the specified address map
function bit is_in_map ( uvm_reg_map map )
Returns all of the address maps where this register is mapped
virtual function void get_maps ( ref uvm_reg_map maps[$] )
Returns the accessibility (“RW, “RO”, or “WO”) of this register in the given map.
virtual function string get_rights ( uvm_reg_map map = null )
Returns the width, in bits, of this register.
virtual function int unsigned get_n_bits ()
Returns the width, in bytes, of this register.
virtual function int unsigned get_n_bytes()
Returns the maximum width, in bits, of all registers.
static function int unsigned get_max_size()
Return the fields in this register
virtual function void get_fields ( ref uvm_reg_field fields[$] )
Return the named field in this register
virtual function uvm_reg_field get_field_by_name( string name )
Returns the offset of this register
virtual function uvm_reg_addr_t get_offset ( uvm_reg_map map = null )
Returns the base external physical address of this register
virtual function uvm_reg_addr_t get_address ( uvm_reg_map map = null )
Identifies the external physical address(es) of this register
virtual function int get_addresses ( uvm_reg_map map = null, ref uvm_reg_addr_t addr[] )
Set the desired value for this register
virtual function void set ( uvm_reg_data_t value, string fname = "", int lineno = 0 )
Return the desired value of the fields in the register.
virtual function uvm_reg_data_t get( string fname = "", int lineno = 0 )
Return the mirrored value of the fields in the register.
virtual function uvm_reg_data_t get_mirrored_value( string fname = "", int lineno = 0 )
Returns 1 if any of the fields need updating
virtual function bit needs_update()
Reset the desired/mirrored value for this register.
virtual function void reset( string kind = "HARD" )
Get the specified reset value for this register
virtual function uvm_reg_data_t get_reset( string kind = "HARD" )
Check if any field in the register has a reset value specified for the specified reset kind.
virtual function bit has_reset( string kind = "HARD", bit delete = 0 )
Specify or modify the reset value for this register
virtual function void set_reset( uvm_reg_data_t value, string kind = "HARD" )
Write the specified value in this register
virtual task write( output uvm_status_e status, input uvm_reg_data_t value, input uvm_path_e path = UVM_DEFAULT_PATH, input uvm_reg_map map = null, input uvm_sequence_base parent = null, input int prior = -1, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Read the current value from this register
virtual task read( output uvm_status_e status, output uvm_reg_data_t value, input uvm_path_e path = UVM_DEFAULT_PATH, input uvm_reg_map map = null, input uvm_sequence_base parent = null, input int prior = -1, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Deposit the specified value in this register
virtual task poke( output uvm_status_e status, input uvm_reg_data_t value, input string kind = "", input uvm_sequence_base parent = null, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Read the current value from this register
virtual task peek( output uvm_status_e status, output uvm_reg_data_t value, input string kind = "", input uvm_sequence_base parent = null, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Updates the content of the register in the design to match the desired value
virtual task update( output uvm_status_e status, input uvm_path_e path = UVM_DEFAULT_PATH, input uvm_reg_map map = null, input uvm_sequence_base parent = null, input int prior = -1, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Read the register and update/check its mirror value
virtual task mirror( output uvm_status_e status, input uvm_check_e check = UVM_NO_CHECK, input uvm_path_e path = UVM_DEFAULT_PATH, input uvm_reg_map map = null, input uvm_sequence_base parent = null, input int prior = -1, input uvm_object extension = null, input string fname = "", input int lineno = 0 )
Update the mirrored and desired value for this register.
virtual function bit predict ( uvm_reg_data_t value, uvm_reg_byte_en_t be = -1, uvm_predict_e kind = UVM_PREDICT_DIRECT, uvm_path_e path = UVM_FRONTDOOR, uvm_reg_map map = null, string fname = "", int lineno = 0 )
Returns 1 if register is currently being read or written.
function bit is_busy()
Set a user-defined frontdoor for this register
function void set_frontdoor( uvm_reg_frontdoor ftdr, uvm_reg_map map = null, string fname = "", int lineno = 0 )
Returns the user-defined frontdoor for this register
function uvm_reg_frontdoor get_frontdoor( uvm_reg_map map = null )
Set a user-defined backdoor for this register
function void set_backdoor( uvm_reg_backdoor bkdr, string fname = "", int lineno = 0 )
Returns the user-defined backdoor for this register
function uvm_reg_backdoor get_backdoor( bit inherited = 1 )
Delete HDL paths
function void clear_hdl_path ( string kind = "RTL" )
Add an HDL path
function void add_hdl_path ( uvm_hdl_path_slice slices[], string kind = "RTL" )
Append the specified HDL slice to the HDL path of the register instance for the specified design abstraction.
function void add_hdl_path_slice( string name, int offset, int size, bit first = 0, string kind = "RTL" )
Check if a HDL path is specified
function bit has_hdl_path ( string kind = "" )
Get the incremental HDL path(s)
function void get_hdl_path ( ref uvm_hdl_path_concat paths[$], input string kind = "" )
Get design abstractions for which HDL paths have been defined
function void get_hdl_path_kinds ( ref string kinds[$] )
Get the full hierarchical HDL path(s)
function void get_full_hdl_path ( ref uvm_hdl_path_concat paths[$], input string kind = "", input string separator = "." )
User-define backdoor read access
virtual task backdoor_read( uvm_reg_item rw )
User-defined backdoor read access
virtual task backdoor_write( uvm_reg_item rw )
User-defined backdoor read access
virtual function uvm_status_e backdoor_read_func( uvm_reg_item rw )
User-defined DUT register change monitor
virtual task backdoor_watch()
Specify which coverage model that must be included in various block, register or memory abstraction class instances.
static function void include_coverage( string scope, uvm_reg_cvr_t models, uvm_object accessor = null )
Check if all of the specified coverage models must be built.
protected function uvm_reg_cvr_t build_coverage( uvm_reg_cvr_t models )
Specify that additional coverage models are available.
virtual protected function void add_coverage( uvm_reg_cvr_t models )
Check if register has coverage model(s)
virtual function bit has_coverage( uvm_reg_cvr_t models )
Turns on coverage measurement.
virtual function uvm_reg_cvr_t set_coverage( uvm_reg_cvr_t is_on )
Check if coverage measurement is on.
virtual function bit get_coverage( uvm_reg_cvr_t is_on )
Functional coverage measurement method
protected virtual function void sample( uvm_reg_data_t data, uvm_reg_data_t byte_en, bit is_read, uvm_reg_map map )
Functional coverage measurement method for field values
virtual function void sample_values()
Called before register write.
virtual task pre_write( uvm_reg_item rw )
Called after register write.
virtual task post_write( uvm_reg_item rw )
Called before register read.
virtual task pre_read( uvm_reg_item rw )
Called after register read.
virtual task post_read( uvm_reg_item rw )
Add a register
virtual function void add_reg ( uvm_reg rg, uvm_reg_addr_t offset, string rights = "RW", bit unmapped = 0, uvm_reg_frontdoor frontdoor = null )
Instance-specific configuration
function void configure( uvm_reg parent, int unsigned size, int unsigned lsb_pos, string access, bit volatile, uvm_reg_data_t reset, bit has_reset, bit is_rand, bit individually_accessible )
Set the desired value for this field
virtual function void set( uvm_reg_data_t value, string fname = "", int lineno = 0 )
Check if the abstract model contains different desired and mirrored values.
virtual function bit needs_update()
Reset the desired/mirrored value for this field.
virtual function void reset( string kind = "HARD" )
Sets the compare policy during a mirror update.
function void set_compare( uvm_check_e check = UVM_CHECK )
Update the mirrored and desired value for this field.
function bit predict ( uvm_reg_data_t value, uvm_reg_byte_en_t be = -1, uvm_predict_e kind = UVM_PREDICT_DIRECT, uvm_path_e path = UVM_FRONTDOOR, uvm_reg_map map = null, string fname = "", int lineno = 0 )
All of the functions in uvm_resource_db#(T) are static, so they must be called using the :: operator.
class uvm_resource_db #( type T = uvm_object )
Functional coverage measurement method for field values
virtual function void sample_values()