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

SystemVerilog Tutorials
Verifying a Master DUT
Mentor Verification IP AE AMBA AXI4-Stream User Guide, V10.3
73
April 2014
Advanced Slave Test Program API Definition
Note
You are not required to edit the following Advanced Slave Test Program API unless
further analysis of the protocol transfer is required.
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
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 an initial block, the slave test program defines a transaction variable trans of type
axi4stream_transaction 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 AXI4-Stream
Protocol Specification.
Example 6-6. Initialization
initial
begin
int i;
bit last;
axi4stream_transaction trans;
/*******************
** Initialisation **
*******************/
bfm.wait_on(AXI4STREAM_RESET_POSEDGE);
bfm.wait_on(AXI4STREAM_CLOCK_POSEDGE);
To receive protocol transfers, you must create a slave transaction. Within a forever loop, the
function is used to create a slave transaction and assigned to the
transaction variable trans, 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
task if
is set to 1. After any TREADY delay, the blocking
task is called
and waits for a transfer to be received.
If further analysis of the received transfer is required, you need to edit the Advanced Slave API
to achieve this. You can obtain details of the
using the