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.
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 | |||||
| |||||
Class Declaration | |||||
| |||||
fifo | The abstract representation of the FIFO. | ||||
Initialization | |||||
new | Creates an instance of a FIFO register having size elements of n_bits each. | ||||
set_compare | Sets the compare policy during a mirror (read) of the DUT FIFO. | ||||
Introspection | |||||
size | The number of entries currently in the FIFO. | ||||
capacity | The maximum number of entries, or depth, of the FIFO. | ||||
Access | |||||
write | Pushes the given value to the DUT FIFO. | ||||
read | Reads the next value out of the DUT FIFO. | ||||
set | Pushes the given value to the abstract FIFO. | ||||
update | Pushes (writes) all values preloaded using <set(()> to the DUT>. | ||||
mirror | Reads the next value out of the DUT FIFO. | ||||
get | Returns the next value from the abstract FIFO, but does not pop it. | ||||
do_predict | Updates the abstract (mirror) FIFO based on write() and read() operations. | ||||
Special Overrides | |||||
pre_write | Special pre-processing for a write() or update(). | ||||
pre_read | Special post-processing for a write() or update(). |
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.
function new( string name = "reg_fifo", int unsigned size, int unsigned n_bits, int has_cover )
Creates an instance of a FIFO register having size elements of n_bits each.
function void set_compare( uvm_check_e check = UVM_CHECK )
Pushes the given value to the DUT FIFO. If auto-predition is enabled, the written value is also pushed to the abstract FIFO before the call returns. If auto-prediction is not enabled (see <uvm_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 #(BUSTYPE)> 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.
Reads the next value out of the DUT FIFO. If auto-prediction is enabled, the frontmost value in abstract FIFO is popped.
virtual function void set( uvm_reg_data_t value, string fname = "", int lineno = 0 )
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 )
Pushes (writes) all values preloaded using <set(()> to the DUT>. You must update after set before any blocking statements, else other reads/writes to the DUT FIFO may cause the mirror to become out of sync with the DUT.
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().
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.
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.
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
This special register models a DUT FIFO accessed via write/read, where writes push to the FIFO and reads pop from it.
class uvm_reg_fifo extends uvm_reg
The abstract representation of the FIFO.
rand uvm_reg_data_t fifo[$]
Creates an instance of a FIFO register having size elements of n_bits each.
function new( string name = "reg_fifo", int unsigned size, int unsigned n_bits, int has_cover )
Sets the compare policy during a mirror (read) of the DUT FIFO.
function void set_compare( uvm_check_e check = UVM_CHECK )
The number of entries currently in the FIFO.
function int unsigned size()
The maximum number of entries, or depth, of the FIFO.
function int unsigned capacity()
Pushes the given value to the abstract FIFO.
virtual function void set( uvm_reg_data_t value, string fname = "", int lineno = 0 )
Pushes (writes) all values preloaded using set(() to the DUT>.
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 )
Returns the next value from the abstract FIFO, but does not pop it.
virtual function uvm_reg_data_t get( string fname = "", int lineno = 0 )
Updates the abstract (mirror) FIFO based on write() and read() operations.
virtual function void do_predict( uvm_reg_item rw, uvm_predict_e kind = UVM_PREDICT_DIRECT, uvm_reg_byte_en_t be = -1 )
Special pre-processing for a write() or update().
virtual task pre_write( uvm_reg_item rw )
Special post-processing for a write() or update().
virtual task pre_read( uvm_reg_item rw )
Updates the register model mirror based on observed bus transactions
class uvm_reg_predictor #( type BUSTYPE = int ) extends uvm_component