Helper functions, Get_write_addr_data(), Example – Altera Mentor Verification IP Altera Edition AMBA AXI3/4TM User Manual
Page 118

Mentor VIP AE AXI3/4 User Guide, V10.2b
100
SystemVerilog AXI3 and AXI4 Slave BFMs
Helper Functions
September 2013
Helper Functions
AMBA AXI protocols typically provide a start address only in a transaction, with the following
addresses for each byte of a data burst calculated using the size, length, and type transaction
fields of the transaction. Helper functions are available to provide you with a simple interface to
set and get address/data values.
get_write_addr_data()
This nonblocking function returns the actual address addr and data of a particular byte in a
write data burst . It also returns the maximum number of bytes (dynamic_size) in the write data
phase (beat). It is used in a slave test program as a helper function to store a byte of data at a
particular address in the slave memory. If the corresponding index does not exist, then this
function returns false, otherwise it returns true.
Example
bfm.get_write_addr_data(write_trans, 0, addr, data);
Prototype
// * = axi | axi4
// ** = AXI | AXI4
function bit get_write_addr_data
(
input *_transaction trans,
input int index = 0,
output bit [((**_ADDRESS_WIDTH) - 1): 0] addr[],
output bit [7:0] data[]
);
Arguments
trans
The *_transaction record.
index
Data words array element number.
Returns
addr
Write address.
data
Write data byte.
bit
Flag to indicate existence of data at index array
element number;
0 = array element nonexistent.
1 = array element exists.