Process_read, Task loops forever, processing read, Task can begin – Altera Mentor Verification IP Altera Edition AMBA AXI3/4TM User Manual

Page 182

Advertising
background image

Mentor VIP AE AXI3/4 User Guide, V10.2b

164

SystemVerilog Tutorials
Verifying a Master DUT

September 2013

Example 6-27. process_read

// Task : process_read
// This method keep receiving read address phase and calls another
// method to process received transaction.
task process_read;
forever
begin
axi_transaction read_trans;

read_trans = bfm.create_slave_transaction();
set_read_address_ready_delay(read_trans);
bfm.get_read_addr_phase(read_trans);

fork
begin
automatic axi_transaction t = read_trans;
handle_read(t);
end
join_none
#0;
end
endtask

The

set_read_data_ready()

function calls the set_data_valid_delay() function in the Slave

BFM. It configures the delay for the assertion of ARVALID signal for each read data phase
(beat) of a read burst.

Example 6-28. set_read_data_ready()

// Function : set_read_data_valid_delay
// This is used to set read response phase valid delays to start
// driving read data/response phases after specified delay.
function void set_read_data_valid_delay(axi_transaction trans);
for (int i = 0; i < trans.data_valid_delay.size(); i++)
trans.set_data_valid_delay(i, i);
endfunction

The

handle_read

task gets the data from the

internal memory

in either bursts or phases

depending on the

slave_mode

configuration. It's read_trans argument contains the record of the

read transaction up to the point of this task call, namely the content of the read address phase.

The call to

set_read_data_valid_delay()

configures the assertion of the ARVALID signal delay.

The task then loops for the number of addresses defined by calling the

get_read_addr()

helper

function in the Slave BFM, assigning the local mem_data variable with read data by calling the

do_byte_read()

function.

Advertising