Register Access Methods
Table of Contents
UVM RAL library classes have builtin methods implemented in it, these methods can be used for accessing the registers. These methods are referred to as Register Access Methods.
The register model has methods to read, write, update and mirror DUT registers and register field values, these methods are called API (application programming interface).
APIs can either use front door access or back door access to DUT registers and register fields.
- Front door access involves using the bus interface and it is associated with the timing
- Back door access uses simulator database access routines and this happens in zero simulation time
read and write
- read() returns and updates the value of the DUT register.
- write() writes and updates the value of the DUT register.
- both read and write can be used for front door access or back door access.
- In read or write value will be updated by the bus predictor on completion of the front door read or write cycle and automatically in back door read or write cycle.
peek and poke
- peek() reads the DUT register value using a backdoor
- poke() writes a value to DUT register using backdoor
set and get
- set() and get() writes and reads directly to the desired value.
- set and get methods operates on the register model desired value, not accesses to DUT register value. The desired value can be updated to the DUT using the update method.
- if there is a difference between desired value and mirrored value,update() will initiate a write to register.update method can be used after the set method.
- mirror() reads the updated DUT register values. The mirroring can be performed in the front door or back door( peek() ).
- randomize() randomizes register or field values with or without constraints.as per the requirement register values can be modified in post_randomize().after randomization update() can be used to update the DUT register values.
reset() sets the register desired and mirrored value to the pre-defined reset value.
|Method||Front door access||Back door access|
register access methods at a different level
* B – Block R – Register F – Field