Advanced slave test program api definition, Initial block(), Example 11-6. initialization – Altera Mentor Verification IP Altera Edition AMBA AXI4-Stream User Manual

Page 187

Advertising
background image

VHDL Tutorials

Verifying a Master DUT

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

187

April 2014

Note

In addition to the above procedures and variables, you can configure other aspects of the
slave BFM by using these procedures:

set_config()

and

get_config()

.

Advanced Slave Test Program API Definition

The remaining section of this tutorial presents a walk-through of the Advanced Slave Test
Program API within the slave BFM test program. It consists of a single

initial block()

process

that receives protocol transfers, inserting a delay in the assertion of the TREADY signal as
detailed in the

Basic Slave Test Program API Definition

.

initial block()

Within a process, the slave test program defines a local variable trans to hold the

Transaction

Record

of the transaction, as shown in

Example 11-6

. The initial wait for the ARESETn signal

to be deactivated, followed by a positive ACLK edge, satisfies the protocol requirement detailed
in Section 2.7.2 of the AMBA 4 AXI4-Stream Protocol Specification.

Example 11-6. Initialization

--/////////////////////////////////////////////////////////////////////
-- Code user do not need to edit
--/////////////////////////////////////////////////////////////////////
process

variable trans: integer;
variable i : integer;
variable last : integer;

begin

--*******************
--** Initialisation **
--********************
wait_on(AXI4STREAM_RESET_POSEDGE, index, axi4stream_tr_if_0(index));
wait_on(AXI4STREAM_CLOCK_POSEDGE, index, axi4stream_tr_if_0(index));

To receive protocol transfers, you must create a slave transaction. Within a loop, the

create_slave_transaction()

procedure is called to create a slave transaction, returning the

transaction_id field of the transaction via the trans variable, as shown in

Example 11-7

.

An inner while loop iterates until the last transfer has been received. On each iteration, a delay is
inserted before the TREADY signal is set to 1 by calling the

ready_delay()

procedure if

m_insert_wait

is set to 1. After any TREADY delay, the blocking

get_transfer()

procedure is

called and waits for a transfer to be received.

If further analysis of the received transfer is required, then you need to edit the Advanced Slave
API to achieve this. You can obtain details of the

Transaction Record

for the received transfer

using the

get*()

procedures within the

VHDL Slave BFM

.

Advertising