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

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:
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
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
of the transaction, as shown in
. 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
procedure is called to create a slave transaction, returning the
transaction_id field of the transaction via the trans variable, as shown in
.
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
procedure if
is set to 1. After any TREADY delay, the blocking
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
using the
procedures within the
.