Get_transfer(), Example – Altera Mentor Verification IP Altera Edition AMBA AXI4-Stream User Manual

Page 64

Advertising
background image

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

64

SystemVerilog Monitor BFM
get_transfer()

April 2014

get_transfer()

This blocking task gets a monitor transfer previously created by the

create_monitor_transaction()

function and identified by the optional index argument.

It sets the transfer_done array index element field to 1 when the transfer completes.

If this is the last transfer of the transaction, then it sets the transaction_done field to 1 and
returns the last argument set to 1 to indicate the whole transaction is complete.

Example

// Declare a local variable to hold the transaction record.
axi4stream_transaction trans;

// Create a monitor transaction and assign it to the local
// trans variable.
trans = bfm.create_monitor_transaction();

....

// Get the first transfer of the trans transaction.
bfm.get_transfer(trans, 0, last);

// Get the second transfer of the trans transaction.
bfm.get_transfer(trans, 1, last);

Prototype

task automatic get_transfer
(

axi4stream_transaction trans,
int index = 0, // Optional
output bit last

);

Arguments

trans

The axi4stream_transaction record.

index

(Optional) Transfer number.

last

Flag to indicate the last transfer in the packet.

Returns

last

Advertising