Virtual Registers

UVMkit » 1800.2-2020

A virtual register is a collection of fields, overlaid on top of a memory, usually in an array.  The semantics and layout of virtual registers comes from an agreement between the software and the hardware, not any physical structures in the DUT.

Contents
Virtual RegistersA virtual register is a collection of fields, overlaid on top of a memory, usually in an array.
uvm_vregVirtual register abstraction base class
uvm_vreg_cbsPre/post read/write callback facade class

uvm_vreg

Virtual register abstraction base class

A virtual register represents a set of fields that are logically implemented in consecutive memory locations.

All virtual register accesses eventually turn into memory accesses.

A virtual register array may be implemented on top of any memory abstraction class and possibly dynamically resized and/or relocated.

Summary
uvm_vreg
Virtual register abstraction base class
Class Hierarchy
uvm_vreg
Class Declaration
class uvm_vreg extends uvm_object
Initialization
Introspection
get_nameGet the simple name
get_full_nameGet the hierarchical name
get_sizeReturns the size of the virtual register array.
get_n_bytesReturns the width, in bytes, of a virtual register.
get_n_memlocsReturns the number of memory locations used by a single virtual register.
get_incrReturns the number of memory locations between two individual virtual registers in the same array.
HDL Access
Callbacks

get_name

Get the simple name

Return the simple object name of this register.

get_full_name

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.

get_size

virtual function int unsigned get_size()

Returns the size of the virtual register array.

get_n_bytes

virtual function int unsigned get_n_bytes()

Returns the width, in bytes, of a virtual register.

The width of a virtual register is always a multiple of the width of the memory locations used to implement it.  For example, a virtual register containing two 1-byte fields implemented in a memory with 4-bytes memory locations is 4-byte wide.

get_n_memlocs

virtual function int unsigned get_n_memlocs()

Returns the number of memory locations used by a single virtual register.

get_incr

virtual function int unsigned get_incr()

Returns the number of memory locations between two individual virtual registers in the same array.

uvm_vreg_cbs

Pre/post read/write callback facade class

Summary
uvm_vreg_cbs
Pre/post read/write callback facade class
Class Hierarchy
Class Declaration
virtual class uvm_vreg_cbs extends uvm_callback
Types
uvm_vreg_cbConvenience callback type declaration
uvm_vreg_cb_iterConvenience callback iterator type declaration

uvm_vreg_cb

Convenience callback type declaration

Use this declaration to register virtual register callbacks rather than the more verbose parameterized class

uvm_vreg_cb_iter

Convenience callback iterator type declaration

Use this declaration to iterate over registered virtual register callbacks rather than the more verbose parameterized class

class uvm_vreg extends uvm_object
Virtual register abstraction base class
virtual class uvm_vreg_cbs extends uvm_callback
Pre/post read/write callback facade class
virtual class uvm_void
The uvm_void class is the base class for all UVM classes.
virtual class uvm_object extends uvm_void
The uvm_object class is the base class for all UVM data and hierarchical classes.
virtual function string get_full_name()
Get the hierarchical name
virtual function int unsigned get_size()
Returns the size of the virtual register array.
virtual function int unsigned get_n_bytes()
Returns the width, in bytes, of a virtual register.
virtual function int unsigned get_n_memlocs()
Returns the number of memory locations used by a single virtual register.
virtual function int unsigned get_incr()
Returns the number of memory locations between two individual virtual registers in the same array.
class uvm_callback extends uvm_object
The uvm_callback class is the base class for user-defined callback classes.