Helper functions, Get_write_addr_data(), Example – Altera Mentor Verification IP Altera Edition AMBA AXI4-Lite User Manual
Page 111
SystemVerilog Monitor BFM
Helper Functions
Mentor Verification IP AE AXI4-Lite User Guide, V10.3
111
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 using the size, length, and type transaction
fields. 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 is used in a monitor test program as a helper function to store a byte of data at
a particular address in the monitor 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
Array element number.
Note: ‘0’ for AXI4-Lite
addr
Write address array
data
Write data array
Returns
bit
Flag to indicate existence of index array element;
0 = array element non-existent.
1 = array element exists.