AXI4: Data Interleaving

 

Scenario:

Consider a system where we have a master device that issues read commands to a slave device (like memory). The master wants to read two blocks of data:

  1. Transaction A: The master sends a read request to get 4 data words from memory location A.
  2. Transaction B: The master also sends a read request to get 4 data words from memory location B.

In the AXI protocol, each of these transactions is assigned a unique ID.

  • Transaction A is given ID 0x01.
  • Transaction B is given ID 0x02.

The master can issue both read requests at nearly the same time, meaning that both transactions are "outstanding" — they are active and awaiting responses from the slave.

Without Interleaving (No Overlapping)

In a simple system without interleaving, the slave would:

  1. Send data for Transaction A first:
    • Send the 4 data words for Transaction A (ID 0x01).
  2. Then, send data for Transaction B:
    • After Transaction A is complete, the slave sends the 4 data words for Transaction B (ID 0x02).

This leads to sequential handling of the two transactions. There is some idle time while the master waits for one transaction to finish before starting the next.

With Data Interleaving (Overlapping of Data Beats)

With data interleaving, the slave can send data for both transactions at the same time, interleaving the data beats from Transaction A and Transaction B.

Let’s visualize how the slave might respond to the two requests with interleaving:

  1. The slave begins by sending the first data word from Transaction A (ID 0x01).
  2. Next, the slave immediately sends the first data word from Transaction B (ID 0x02).
  3. Then, the slave sends the second data word from Transaction A (ID 0x01).
  4. Next, it sends the second data word from Transaction B (ID 0x02), and so on.

This interleaving continues until all data beats (words) from both transactions have been sent.

Example Table of Interleaved Data

Let’s assume each transaction consists of 4 data words (A1, A2, A3, A4 for Transaction A and B1, B2, B3, B4 for Transaction B). The table below shows how data interleaving would look:

CycleData WordTransaction ID
1A10x01
2B10x02
3A20x01
4B20x02
5A30x01
6B30x02
7A40x01
8B40x02

In each cycle, a word from either Transaction A or B is sent, alternating between them. The key point is that the master receives a mixture of data from both transactions but knows which data belongs to which transaction by using the ID signal that accompanies each word.

How Does the Master Keep Track?

The master relies on the ID associated with each data word to keep track of which transaction it belongs to. For example, when it receives A1 with ID 0x01, it knows that this data belongs to Transaction A. When it receives B1 with ID 0x02, it knows that data belongs to Transaction B.

Benefits of Data Interleaving

  1. Increased Throughput: Since the bus is constantly active, interleaving maximizes bus utilization by keeping it busy with data from multiple transactions.
  2. Lower Latency: The master doesn't have to wait for one transaction to finish before starting another. Both transactions can make progress simultaneously.
  3. Efficient Resource Utilization: The interleaving mechanism ensures better parallel processing, which is particularly useful in high-performance systems.

Conclusion

In the example above, AXI data interleaving allows the system to handle multiple transactions at the same time by interleaving their data beats on the bus. The master tracks these transactions using their unique IDs, ensuring that the data from different transactions is not confused. This mechanism increases system performance by reducing idle times and improving overall bus efficiency.

Comments