cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AXI Basics 1 - Introduction to AXI

Moderator
Moderator
16 2 12.3K

Introduction

These days, nearly every Xilinx IP uses an AXI Interface. Zynq® , Zynq MP, MicroBlaze™ and the new Versal™ Processors all use AXI interfaces. Thus AXI interfaces are part of nearly any new design on Xilinx devices. Understanding the basics of it can be useful to design and debug designs on Xilinx devices.

This blog entry will cover some of the basics of AXI3/AXI4 on Xilinx devices. First we will start with the less exciting parts, the theory and the terminology.


What is AXI?

AXI, which means Advanced eXtensible Interface, is an interface protocol defined by ARM as par of the AMBA (Advanced Microcontroller Bus Architecture) standard.

The AXI3/AXI4 specification are freely-available on the ARM website (link) so I encourage anybody who is interested to download it.

1.png

There are 3 types of AXI4-Interfaces (AMBA 4.0):

  • AXI4 (Full AXI4): For high-performance memory-mapped requirements.
  • AXI4-Lite: For simple, low-throughput memory-mapped communication (for example, to and from control and status registers).
  • AXI4-Stream: For high-speed streaming data.
    • Note: AXI4-Stream is not covered in this entry. "AXI" here will refer to AXI3, AXI4 and AXI4-Lite.

Note: The AXI3 Interface is close to the full AXI interface.


AXI Read and Write Channels

The AXI protocol defines 5 channels:

  • 2 are used for Read transactions
    • read address
    • read data
  • 3 are used for Write transactions
    • write address
    • write data
    • write response

2.png

 


A channel is an independent collection of AXI signals associated with the VALID and READY signals.

Note: An AXI4/AXI3/AXI4-Lite Interface can be read only (only includes the 2 Read channels) or write only (only includes the 3 Write channels).

A piece of data transmitted on a single channel is called a transfer. A transfer happens when both the VALID and READY signal are high while there is a rising edge of the clock. For example, in the figure below, the transfer is happening on T3:

 

3.png

 


AXI Read Transactions

An AXI Read transactions requires multiple transfers on the 2 Read channels.

  • First, the Address Read Channel is sent from the Master to the Slave to set the address and some control signals.
  • Then the data for this address is transmitted from the Slave to the Master on the Read data channel.

Note that, as per the figure below, there can be multiple data transfers per address. This type of transaction is called a burst.

4.png


AXI Write Transactions

An AXI Write transactions requires multiple transfers on the 3 Read channels.

  • First, the Address Write Channel is sent Master to the Slave to set the address and some control signals.
  • Then the data for this address is transmitted Master to the Slave on the Write data channel.
  • Finally the write response is sent from the Slave to the Master on the Write Response Channel to indicate if the transfer was successful.

 

5.png

 

The possible response values on the Write Response Channel are:

  • OKAY (0b00): Normal access success. Indicates that a normal access has been successful
  • EXOKAY (0b01): Exclusive access okay.
  • SLVERR (0b10): Slave error. The slave was reached successfully but the slave wishes to return an error condition to the originating master (for example, data read not valid).
  • DECERR (0b11): Decode error. Generated, typically by an interconnect component, to indicate that there is no slave at the transaction address

Note: Read transactions also have a response value but this response is transmitted as part of the Read Response Channel


AXI4 Interface requirements

There are some requirement documented in the AXI4 Specification.

The ones you absolutely want to remember are:

  • When a VALID (AxVALID/xVALID) signal is asserted, it must remain asserted until the rising clock edge after the slave asserts AxREADY/xREADY.

  • the VALID signal of the AXI interface sending information must not be dependent on the READY signal of the AXI interface receiving that information
    • However, the state of the READY signal can depend on the VALID signal

  • A write response must always follow the last write transfer in the write transaction of which it is a part

  • Read data must always follow the address to which the data relates

  • A slave must wait for both ARVALID and ARREADY to be asserted before it asserts RVALID to indicate that valid data is available

 

In the next article of the AXI Basics Series we will simulate AXI4 Interfaces using the AXI Verification IP (AXI VIP).

Tags (1)
2 Comments
Scholar
Scholar

A nice summary. But it implies that for a write transaction, an address must be provided before the data - this is not the case. A slave device is allowed to accept the write data before the address, because at least for AXI4 AWADDR transactions and WDATA transactions must be in order (no re-ordering is allowed). It can be quite useful to provide the data before address (eg. putting packets into a packet buffer, where the address is generated from packet headers several words into the packet).

 

It might also be worth pointing out that there is no requirement to wait for write or read responses before providing more AXADDR or WDATA transactions. Doing so can throttle your maximum potential bandwidth. Again, if there is enough buffering in the system, several read/write requests can be queued without yet receiving a response (again, with AXI4 at least, all responses are in order of request).

Moderator
Moderator

Hi @richardhead 

Thanks for your comment

You are absolutely right. Even if this is not clearly mentionned in the spec, a write data can happen before a write address. The spec only mentions that there is no relashionship between the write address and write data channels, which implies that the write data can be transmitted before the write address (even if it is not a common case). The spec also mentions that "the write data can appear at an interface before the write address for the transaction.". But as this is only an introduction, I tried to keep things simple.

And yes you do not need to to wait for the response before starting a new transaction. Again this is only an introduction, so I was focusing on what is an AXI transaction. But I am planning to discuss about Write/Read Issuing/Acceptance and outstanding transactions in a future article which should cover the multiple transactions at the same time case.