uvm_reg_fifo

UVMkit » 1800.2-2020

This special register models a DUT FIFO accessed via write/read, where writes push to the FIFO and reads pop from it.

Backdoor access is not enabled, as it is not yet possible to force complete FIFO state, i.e. the write and read indexes used to access the FIFO data.

Summary
uvm_reg_fifo
This special register models a DUT FIFO accessed via write/read, where writes push to the FIFO and reads pop from it.
Class Hierarchy
uvm_reg_fifo
Class Declaration
class uvm_reg_fifo extends uvm_reg
fifoThe abstract representation of the FIFO.
Initialization
Introspection
sizeThe number of entries currently in the FIFO.
capacityThe maximum number of entries, or depth, of the FIFO.
Access
writePushes the given value to the DUT FIFO.
readReads the next value out of the DUT FIFO.
mirrorReads the next value out of the DUT FIFO.
do_predictUpdates the abstract (mirror) FIFO based on write() and read() operations.
Special Overrides
pre_writeSpecial pre-processing for a write() or update().
pre_readSpecial post-processing for a write() or update().

fifo

rand uvm_reg_data_t fifo[$]

The abstract representation of the FIFO.  Constrained to be no larger than the size parameter.  It is public to enable subtypes to add constraints on it and randomize.

size

function int unsigned size()

The number of entries currently in the FIFO.

capacity

function int unsigned capacity()

The maximum number of entries, or depth, of the FIFO.

write

Pushes the given value to the DUT FIFO.  If auto-prediction is enabled, the written value is also pushed to the abstract FIFO before the call returns.  If auto-prediction is not enabled (via <uvm_reg_map::set_auto_predict>), the value is pushed to abstract FIFO only when the write operation is observed on the target bus.  This mode requires using the uvm_reg_predictor class.  If the write is via an update() operation, the abstract FIFO already contains the written value and is thus not affected by either prediction mode.

read

Reads the next value out of the DUT FIFO.  If auto-prediction is enabled, the frontmost value in abstract FIFO is popped.

mirror

Reads the next value out of the DUT FIFO.  If auto-prediction is enabled, the frontmost value in abstract FIFO is popped.  If the check argument is set and comparison is enabled with <set_compare()>.

do_predict

virtual function void do_predict( uvm_reg_item  rw,   
uvm_predict_e  kind  =  UVM_PREDICT_DIRECT,
uvm_reg_byte_en_t  be  =  -1 )

Updates the abstract (mirror) FIFO based on write() and read() operations.  When auto-prediction is on, this method is called before each read, write, peek, or poke operation returns.  When auto-prediction is off, this method is called by a uvm_reg_predictor upon receipt and conversion of an observed bus operation to this register.

If a write prediction, the observed write value is pushed to the abstract FIFO as long as it is not full and the operation did not originate from an update().  If a read prediction, the observed read value is compared with the frontmost value in the abstract FIFO if <set_compare()> enabled comparison and the FIFO is not empty.

pre_write

virtual task pre_write( uvm_reg_item  rw )

Special pre-processing for a write() or update().  Called as a result of a write() or update().  It is an error to attempt a write to a full FIFO or a write while an update is still pending.  An update is pending after one or more calls to set().  If in your application the DUT allows writes to a full FIFO, you must override pre_write as appropriate.

pre_read

virtual task pre_read( uvm_reg_item  rw )

Special post-processing for a write() or update().  Aborts the operation if the internal FIFO is empty.  If in your application the DUT does not behave this way, you must override pre_write as appropriate.

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.
class uvm_reg extends uvm_object
This is an implementation of uvm_reg as described in 1800.2 with the addition of API described below.
class uvm_reg_fifo extends uvm_reg
This special register models a DUT FIFO accessed via write/read, where writes push to the FIFO and reads pop from it.
rand uvm_reg_data_t fifo[$]
The abstract representation of the FIFO.
function int unsigned size()
The number of entries currently in the FIFO.
function int unsigned capacity()
The maximum number of entries, or depth, of the FIFO.
virtual function void do_predict( uvm_reg_item  rw,   
uvm_predict_e  kind  =  UVM_PREDICT_DIRECT,
uvm_reg_byte_en_t  be  =  -1 )
Updates the abstract (mirror) FIFO based on write() and read() operations.
Pushes the given value to the DUT FIFO.
Reads the next value out of the DUT FIFO.
virtual task pre_write( uvm_reg_item  rw )
Special pre-processing for a write() or update().
virtual task update( output  uvm_status_e  status,   
input  uvm_door_e  path  =  UVM_DEFAULT_DOOR,
input  uvm_sequence_base  parent  =  null,
input  int  prior  =  -1,
input  uvm_object  extension  =  null,
input  string  fname  =  "",
input  int  lineno  =  0 )
Batch update of register.
virtual task pre_read( uvm_reg_item  rw )
Special post-processing for a write() or update().
class uvm_reg_predictor #( type  BUSTYPE  =  int ) extends uvm_component
Updates the register model mirror based on observed bus transactions
static function void set( uvm_component  cntxt,
string  inst_name,
string  field_name,
value )
Create a new or update an existing configuration setting for field_name in inst_name from cntxt.