[source]

Class uvm_pkg::uvm_reg_fifo

Class

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.

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.

Variables

Name

Type

Description

fifo

uvm_reg_data_t

Variable

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.

Constraints

Name

Description

valid_fifo_size

Constructors

new(string name = "reg_fifo", int unsigned size, int unsigned n_bits, int has_cover)

Function

new

Creates an instance of a FIFO register having size elements of n_bits each.

Parameters:
  • name (string)

  • size (int unsigned)

  • n_bits (int unsigned)

  • has_cover (int)

Functions

build()

Funtion

build

Builds the abstract FIFO register object. Called by the instantiating block, a uvm_reg_block subtype.

set_compare(uvm_check_e check = UVM_CHECK)

Function

set_compare

Sets the compare policy during a mirror (read) of the DUT FIFO. The DUT read value is checked against its mirror only when both the check argument in the <mirror()> call and the compare policy for the field is .

Parameters:

check (uvm_check_e)

size()

Function

size

The number of entries currently in the FIFO.

capacity()

Function

capacity

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

set(uvm_reg_data_t value, string fname = "", int lineno = 0)

Function

set

Pushes the given value to the abstract FIFO. You may call this method several times before an update() as a means of preloading the DUT FIFO. Calls to set() to a full FIFO are ignored. You must call update() to update the DUT FIFO with your set values.

Parameters:
get(string fname = "", int lineno = 0)

Function

get

Returns the next value from the abstract FIFO, but does not pop it. Used to get the expected value in a <mirror()> operation.

Parameters:
  • fname (string)

  • lineno (int)

Return type:

uvm_reg_data_t

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

Function

do_predict

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.

Parameters:

Tasks

update(uvm_status_e status, uvm_path_e path = UVM_DEFAULT_PATH, uvm_reg_map map = null, uvm_sequence_base parent = null, int prior = -1, uvm_object extension = null, string fname = "", int lineno = 0)

Function

update

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.

Parameters:
pre_write(uvm_reg_item rw)

Task

pre_write

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.

Parameters:

rw (uvm_reg_item)

pre_read(uvm_reg_item rw)

Task

pre_read

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.

Parameters:

rw (uvm_reg_item)