A fork-join block, as demonstrated in, Example 6-26 – Altera Mentor Verification IP Altera Edition AMBA AXI3/4TM User Manual

Page 181

Advertising
background image

SystemVerilog Tutorials

Verifying a Master DUT

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

163

September 2013

Example 6-26. Initialization and Transaction Processing

initial
begin

// Initialisation
bfm.set_config
(

AXI_CONFIG_MAX_OUTSTANDING_RD,m_max_outstanding_read_trans

);
bfm.set_config
(

AXI_CONFIG_MAX_OUTSTANDING_WR,m_max_outstanding_write_trans

);

bfm.wait_on(AXI_RESET_0_TO_1);
bfm.wait_on(AXI_CLOCK_POSEDGE);

// Traffic generation
fork
process_read;
process_write;
join
end

The

process_read

task loops forever, processing read transactions as they occur from the

master. It defines a local transaction variable read_trans of type axi_transaction to store a
record of the read transaction while it is being processed. It then uses the Slave BFM function
create_slave_transaction() to create a read transaction and assign it to the local read_trans
record.

The

set_read_address_ready_delay()

function is called to configure the delay for the

ARREADY signal before getting the read address phase using the Slave BFM
get_read_addr_phase() task.

The subsequent fork-join_none block performs a nonblocking statement so that the

process_read

task can begin again to create another read transaction and get another read

address phase before the current read transaction has completed. This permits concurrent read
transactions to occur if the master issues a series of read address phases before any previous
read transactions have completed.

In the fork-join_none block, the read_trans record is passed into the handle_read() function via
the variable t.

Advertising