Access transaction record, Set*(), Get*() – Altera Mentor Verification IP Altera Edition AMBA AXI4-Stream User Manual

Page 83: Example 7-9. master test program, Example 7-10. slave test program

Advertising
background image

VHDL API Overview

Access Transaction Record

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

83

April 2014

Access Transaction Record

Each BFM API has procedures that can access a complete or partially complete

Transaction

Record

. The

set*()

and

get*()

procedures are used in a test program to set and get information

from the transaction record.

set*()

Example 7-9

shows the master test program calling the

set_byte_type()

procedure to set the first

byte_type in the transaction.

Example 7-9. Master Test Program

set_byte_type()

Procedure

-- Define a local variable trans to hold the transaction record.
variable trans: integer;

-- Create a master transaction with 10 transfers.
create_master_transaction(10, trans, bfm_index,

axi4stream_tr_if_0(bfm_index));

-- Set the first byte_type in the transfer.
set_byte_type(AXI4STREAM_DATA_BYTE, 0, trans, bfm_index,

axi4stream_tr_if_0(bfm_index));

In the above example, the bfm_index specifies the actual master BFM.

get*()

Example 7-10

shows the slave test program calling the

get_byte_type()

procedure to get the first

data byte_type of a transaction.

Example 7-10. Slave Test Program

get_byte_type()

Procedure

-- Define a local variable trans to hold the transaction record.
variable trans: integer;

-- Define a local variable to hold the transaction byte type
variable byte_type: integer;

-- Create a slave transaction
create_slave_transaction(trans, bfm_index,

axi4stream_tr_if_0(bfm_index));

-- Get the first byte_type of a transaction.
get_byte_type(byte_type, 0, trans, bfm_index,

axi4stream_tr_if_0(bfm_index));

In the above example, the bfm_index specifies the actual slave BFM.

Advertising