Handle_read, Example 11-13. process_read, In the slave test program, as shown in – Altera Mentor Verification IP Altera Edition AMBA AXI4-Lite User Manual

Page 346

Advertising
background image

Mentor Verification IP AE AXI4-Lite User Guide, V10.3

346

VHDL Tutorials
Verifying a Master DUT

April 2014

The maximum number of outstanding read transactions is configured before the processing of
read transactions begins an ACLK period after the ARESETn signal is inactive, as shown in

Example 11-13

.

Each slave transaction has a unique transaction_id number associated with it that is
automatically incremented for each new slave transaction created. In a loop, the

create_slave_transaction()

procedure call returns the transaction_id for the slave BFM,

indexed by the index argument. A read_trans variable is previously defined to hold the
transaction_id.

A call to the

get_read_addr_phase()

procedure blocks the code until a read address phase has

completed. The call to the

push_transaction_id()

procedure pushes read_trans into the

AXI4_QUEUE_ID_1 queue.

The loop completes and restarts by creating a new slave transaction and blocks for another write
address phase to occur.

Example 11-13. process_read

-- process_read : read address phase through path 3
-- This process keep receiving read address phase and push
-- the transaction into queue through push_transaction_id API.
process

variable read_trans: integer;

begin

wait_on(AXI4_RESET_0_TO_1, index, AXI4_PATH_3,

axi4_tr_if_3(index));

wait_on(AXI4_CLOCK_POSEDGE, index, AXI4_PATH_3,

axi4_tr_if_3(index));

loop

create_slave_transaction(read_trans, index, AXI4_PATH_3,

axi4_tr_if_3(index));

get_read_addr_phase(read_trans, index, AXI4_PATH_3,

axi4_tr_if_3(index));

get_config(AXI4_CONFIG_NUM_OUTSTANDING_RD_PHASE,

tmp_config_num_outstanding_rd_phase, index,
AXI4_PATH_3, axi4_tr_if_3(index));

push_transaction_id(read_trans, AXI4_QUEUE_ID_1, index,

AXI4_PATH_3, axi4_tr_if_3(index));

end loop;
wait;

end process;

handle_read

The handle_read process gets read data from the

Internal Memory

as a phase (beat). It uses

unique path and queue identifiers to work concurrently with other processes.

In a loop, the

pop_transaction_id()

procedure call returns the transaction_id from the queue for

the slave BFM, indexed by the index argument, as shown in

Example 11-14

. A read_trans

Advertising