Table of Contents
AXI (Advanced eXtensible Interface) is the bus protocol from ARM’s AMBA family that connects the CPU to everything else in the hardware system. The ARM CPU (ps7_0) talks to axi_interconnect_0, which routes each read or write to the peripheral that owns that address.
You have already been using AXI without seeing it:
- In Lab 2, every register read and write your userspace drivers made to the GPIO and interrupt controller became an AXI4-Lite transaction.
- In Lab 6, you build the other side: an AXI4-Lite slave that the CPU reads and writes.
- In Lab 8, the AXI CDMA is an AXI master that moves data over the bus without the CPU.
The Specification
- AMBA AXI and ACE Protocol Specification - alternate link. This is issue D (ARM IHI 0022D). The reading assignments and page numbers below refer to this version.
- Latest version on ARM’s website. Newer issues renumber the sections and pages, and use the terms Manager and Subordinate in place of master and slave. You will see both sets of terms in vendor documentation.
- AMD Vivado AXI Reference Guide (UG1037) describes how AMD’s IP and Vivado tools use AXI.
Channels
AXI has five independent channels. Every signal name starts with the prefix of the channel it belongs to (for example, AWADDR is the address on the write address channel).
| Prefix | Channel | Direction | Carries |
|---|---|---|---|
| AW | Write address | master → slave | Address and control for a write |
| W | Write data | master → slave | Write data and byte strobes |
| B | Write response | slave → master | Status of the completed write |
| AR | Read address | master → slave | Address and control for a read |
| R | Read data | slave → master | Read data and the status of the read |
A write uses AW, W and B; a read uses AR and R. The two global signals, ACLK and ARESETn, are shared by every channel. The leading A in their names stands for AXI, not “address”; ARESETn is not part of the read address channel.
AXI4-Lite
The PIT in Lab 6 uses AXI4-Lite, a subset of AXI4 for simple register-based peripherals (see Chapter B1 of the spec). Most of the signals in the Chapter A2 tables (IDs, burst length/size/type, lock, cache, QoS, region and user signals) do not exist in AXI4-Lite. An AXI4-Lite slave has only these signals:
| Channel | Signals |
|---|---|
| Global | ACLK, ARESETn |
| AW | AWADDR, AWPROT, AWVALID, AWREADY |
| W | WDATA, WSTRB, WVALID, WREADY |
| B | BRESP, BVALID, BREADY |
| AR | ARADDR, ARPROT, ARVALID, ARREADY |
| R | RDATA, RRESP, RVALID, RREADY |
Designing an AXI4-Lite Slave
The PIT logic is simple; getting the AXI interface right is the hard part of Lab 6. Check your design against these rules from Chapter A3 of the spec:
- No combinational paths from inputs to outputs (A3.1.1, A3.2.1). For example, AWREADY cannot be assigned directly from AWVALID.
- Reset (A3.1.2): while ARESETn is low, your slave must drive RVALID and BVALID low.
- Hold what you assert (A3.2.1): once your slave raises RVALID or BVALID, it must keep it high, and keep RDATA, RRESP and BRESP stable, until the master’s RREADY or BREADY completes the handshake.
- Never wait for READY to raise VALID (A3.3.1): your slave must not wait for BREADY before asserting BVALID, or for RREADY before asserting RVALID. Doing so can deadlock the bus.
- Write data can arrive before, after, or with the write address (A3.3). Your slave must handle all three orderings of the AW and W handshakes.
- Respond only after the request is accepted (A3.3.1): assert RVALID only after the AR handshake, and BVALID only after both the AW and W handshakes.
- Reads and writes can arrive at the same time. Decide what your slave does when they do.
Test these cases in simulation; see Simulating AXI IP.
Reading Assignments and Study Questions
AXI Bus I
Please read the following sections of the specification:
- Chapter A1
- Chapter A2, which is mostly about signal definitions. You don’t need to understand what all of the signals do at this point, but make sure that you do understand what the VALID, READY, ADDR, LEN, and SIZE signals do within each of the channels. For example, ADDR refers to the AWADDR in the Write Address Channel, and ARADDR in the Read Address Channel, and so forth.
- Chapter A3 (A3.1-A3.3), which is largely about protocol. Make sure that you understand how the handshaking works in each channel.
Study Questions
- How many transaction channels are in the AXI architecture?
- How many of the transaction channels are related to read transactions? How many are related for write transactions?
- What is the purpose of the Write Response Channel?
- What is the allowable minimum width for the read data bus? for the write data bus?
- What is the maximum allowable width for the read data bus? for the write data bus?
- (T or F) The master can perform write transactions without slave acknowledgement for previous write transaction.
- (T or F) AXI supports multiple address and data busses.
- (T or F) AXI channels are bidirectional.
- What is a register slice? What advantage do they provide?
- Why is it important that reset deassertion occur on the rising edge of ACLK?
- All 5 channels use the same VALID/READY handshake process. Please explain exactly when the handshake occurs.
- (T or F) A slave can assert a VALID signal.
- (T or F) A master can assert a READY signal.
- (T or F) The source can wait for the READY signal before asserting VALID.
- (T or F) The destination can assert the READY signal before a VALID signal arrives.
- Who (Master or Slave) sources AWVALID?
- Who (Master or Slave) sources RVALID?
- Who (Master or Slave) sources ARREADY?
- How many channels are involved in every read operation?
- How many channels are involved in every write operation?
- (T or F) The master can wait for the slave to assert ARREADY before asserting ARVALID.
- (T or F) The slave can wait for ARVALID to be asserted before it asserts ARREADY.
- Name the signals involved in the handshake for the Read Data Channel.
These are extra questions that can be ignored for the quiz but we may discuss them if we have time.
- (T or F) The slave can assert BVALID as soon as WVALID and WREADY are asserted.
- What is a “beat”?
- (T or F) The slave can terminate a burst if an error occurs.
- (T or F) The master can terminate a burst if an error occurs.
- (T or F) All bus transactions are bursts.
- How does the slave indicate the success or failure of a read or write transaction?
In-Class Exercise
AXI Bus II
Please read the following sections of the specification:
- Write Transaction Dependencies: Pages A3-41 - A3-42
- Transaction Structure: Pages A3-44 - A3-55 (skip Byte invariance)
- Multiple Transactions: Pages A5-75 - A5-82 (skip A5-81 and A5.3.3, which discuss AXI3 legacy issues).
- Ordering Model: A6-84 - A6-88.
- Chapter B1, AMBA AXI4-Lite: B1-121 - B1-126.
Study Questions
- A burst length of 256 is supported for what type of burst?
- Why must you be careful when discarding data when accessing a FIFO?
- How do you reduce the number of data transfers in a write burst?
- What value must you assign to ARSIZE if you want to read 128 bytes in a single transfer?
- What values are possible for ARSIZE if you want to read 128 bytes over multiple transactions (think about it, what is the difference between a transfer and a transaction)? Assume that the data read bus is 1024 wires wide.
- What limits the maximum number of bytes that can be transferred in a beat?
- Explain the difference between a FIXED and INCR burst type.
- Explain how to specify a INCR burst type?
- How many write strobes are there for a 512-bit bus? a 256-bit bus? an 8-bit bus?
- What is a byte lane?
- When does the master use different strobes for each beat of a transfer?
- Assume a starting address of 0X4, a 64-bit bus, and a 32-bit transfer. Which bits of the data bus will be written during the first transfer? Is this an aligned access?
- How does the slave indicate the success or failure of a read or write transaction?
- (T or F) The slave terminates the bus transaction by transmitting an error response.
- (T or F) A slave can signal different responses for different beats of a burst write transaction.
- The AXI bus is asymmetric with regard to read and write channels, e.g., reads can have a response per transfer and writes have a single response per transaction. Why do you think they did things this way?
- How does AXI control ordering of transactions?
- Why does performing transactions out of order potentially improve performance?
- What is the read reordering depth? How is it used?
- How can you force order between read and write operations?
- (T or F) Once the master has sent all of the write data, the write transaction is complete.
- Why do master transaction IDs vary in bit-width?
- (T or F) Transactions issued by multiple masters with the same IDs must be performed in order.
The questions below correspond to the section on AMBA AXI4-Lite.
- What is the burst length for a transaction?
- (T or F) All accesses must be 32 or 64 bits wide.
- (T or F) Masters don’t have to support byte slaves.
- (T or F) AXI-Lite doesn’t support multiple outstanding transactions because it does not support transaction IDs.