Executing transactions, Execute_transaction(), execute*_phase() – Altera Mentor Verification IP Altera Edition AMBA AXI4-Lite User Manual

Page 144

Advertising
background image

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

144

VHDL API Overview
Executing Transactions

April 2014

-- Define local variables to hold the transaction ID
-- and data word.
variable tr_id: integer;
variable data_words : std_logic_vector(AXI4_MAX_BIT_SIZE-1 downto 0);

-- Create a master write transaction and set data_word value
create_write_transaction(1, tr_id, bfm_index, axi4_tr_if_0(bfm_index));
data_words(31 downto 0) := x"00000200";
set_data_words(data_words, tr_id, bfm_index, axi4_tr_if_0(bfm_index));

For example, to create a simple slave transaction the slave BFM test program would contain the
following code:

-- Define a local variable write_trans to hold the transaction ID
variable write_trans : integer;

-- Create a slave transaction

create_slave_transaction(write_trans, bfm_index,
axi4_tr_if_0(bfm_index));

In the above examples, the bfm_index specifies the BFM.

Executing Transactions

Executing a transaction in a master/slave BFM test program initiates the transaction onto the
protocol signals. Each master/slave BFM API has execution tasks that push transactions into the
BFM internal transaction queues.

Figure 7-1

on page 138 illustrates the internal BFM structure.

execute_transaction(), execute*_phase()

If the DUT is a slave then the execute_transaction() procedure is called in the master BFM test
program. If the DUT is a master, then the execute*_phase() procedures are is called in the slave
BFM test program.

For example, to execute a master write transaction the master BFM test program would contain
the following code:

-- By default the execution of a transaction will block
execute_transaction(tr_id, bfm_index, axi4_tr_if_2(bfm_index));

For example, to execute a slave write response phase, the slave BFM test program would
contain the following code:

-- By default the execution of a phase will block
execute_write_response_phase(write_trans, bfm_index,
axi4_tr_if_2(bfm_index));

In the above example, the bfm_index specifies the BFM.

Advertising