Helper functions, Get_write_addr_data(), Example – Altera Mentor Verification IP Altera Edition AMBA AXI4-Lite User Manual
Page 87

SystemVerilog Slave BFM
Helper Functions
Mentor Verification IP AE AXI4-Lite User Guide, V10.3
87
April 2014
Helper Functions
AMBA AXI protocols typically provide a start address only in a transaction, with the following
addresses for each byte of a data beat calculated. Helper functions 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 beat. 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
function bit get_write_addr_data
(
input axi4_transaction trans,
input int index = 0,
output bit [((AXI4_ADDRESS_WIDTH) - 1): 0] addr[],
output bit [7:0] data[]
);
Arguments
trans
The axi4_transaction record.
index
Data words array element number.
Note: ‘0’ for AXI4-Lite
Returns
addr
Write address.
data
Write data byte.
bit
Flag to indicate existence of data;
0 = nonexistent.
1 = exists.