Axi3 basic slave api definition, Axi3 basic slave api, Definition – Altera Mentor Verification IP Altera Edition AMBA AXI3/4TM User Manual

Page 643

Advertising
background image

VHDL Tutorials

Verifying a Master DUT

Mentor VIP AE AXI3/4 User Guide, V10.2b

623

September 2013

AXI3 Basic Slave API Definition

The Slave Test Program Basic API contains:

Procedures that read and write a byte of data to

internal memory

do_byte_read()

and

do_byte_write()

, respectively.

Procedures to configure the AXI3 protocol channel handshake delays

set_read_address_ready_delay()

,

set_write_address_ready_delay()

,

set_write_data_ready_delay()

,

set_read_data_valid_delay()

and

set_wr_resp_valid_delay()

.

Procedures to process read and write transactions,

process_read

and

process write

,

respectively. If you need to create other responses, such as EXOKAY, DECERR, or
SLVERR, then you must edit these procedures to provide the required response.

A

slave_mode

transaction field to control the behavior of reading and writing to the

internal memory.

Configuration variables m_max_outstanding_read_trans and
m_max_outstanding_write_trans back-pressure a master from transmitting additional
read and write transactions when the configured value has been reached.

The internal memory for the slave is defined as an array of 8-bits, so that each byte of data is
stored as an address/data pair.

Example 11-16. internal memory

type memory_t is array (0 to 2**16-1) of std_logic_vector(7 downto 0);
shared variable mem : memory_t;

The

do_byte_read()

procedure, when called, reads a data byte from the

internal memory

mem,

given an address location addr, as demonstrated in

Example 11-17

.

You can edit this procedure to modify the way the read data is extracted from the internal
memory.

Example 11-17. do_byte_read()

-- Procedure : do_byte_read
-- Procedure to provide read data byte from memory at particular input
-- address
procedure do_byte_read
(

addr : in std_logic_vector(AXI_MAX_BIT_SIZE-1 downto 0);
data : out std_logic_vector(7 downto 0)

) is
begin

data := mem(to_integer(addr));

end do_byte_read;

Advertising