Create*_transaction(), Executing transactions – Altera Mentor Verification IP Altera Edition AMBA AXI3/4TM User Manual

Page 212

Advertising
background image

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

194

VHDL API Overview
Executing Transactions

September 2013

slave transaction record. Refer to the

create_monitor_transaction()

procedure for default

protocol transaction field values.

Note

If you change a protocol transaction field value from its default, it is then valid for all
future transactions until a new value is set.

create*_transaction()

There are two master BFM API procedures available to create transactions,

create_read_transaction()

and

create_write_transaction()

, a

create_slave_transaction()

slave

BFM API procedure, and a

create_monitor_transaction()

monitor BFM API procedure.

For example, to create a simple write transaction with a start address of 1, and a single data
phase with a data value of 2, the master BFM test program would contain the following code:

-- * = axi| axi4
-- ** = AXI | AXI4
-- Define local variables to hold the transaction ID
-- and data word.
variable tr_id: integer;
variable data_words : std_logic_vector(**_MAX_BIT_SIZE-1 downto 0);

-- Create a master write transaction and set data_word value
create_write_transaction(1, tr_id, bfm_index, *_tr_if_0(bfm_index));
data_words(31 downto 0) := x"00000200";
set_data_words(data_words, tr_id, bfm_index, *_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, *_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 186 illustrates the internal BFM structure.

Advertising