*Download AMBA 4 AXI4-Stream Protocol Spec document here (Source: arm).
- AXI Stream protocol is used to transfer the data from one device to another, or from Master device to the Slave device.
- Master is the main initiator of the data transfer and Slave is the main receiver.
- There are a set of rules which this protocol follows to send the data (data has to be kept safe).
TABLE Source: arm's spec document |
- "ACLK", "ARESET", "TVALID", "TREADY" are the mandatory signals and the others are optional signals.
Clock and Reset:
- Clock: Each component uses a single clock signal, ACLK. All input signals are sampled on the rising edge of ACLK. All output signal changes after the rising edge of ACLK.
- The system is working on the rising edge of the clock.
- Reset: The protocol includes a signal active-LOW reset signal (in AXI all reset signals are active-LOW), ARESETn. The reset signal can be asserted asynchronously, but de-assertion must be synchronous after the rising edge of ACLK.
- During reset, TVALID must be driven LOW.
- All other signals can be driven to any value.
- A master interface must only begin driving TVALID at rising ACLK edge following a rising edge at which ARESETn is asserted HIGH. (The above timing diagram shows the first point after reset that TVALID can be driven HIGH.)
Handshake Process:
FIG: TVALID before TREADY handshake. When TVALID goes HIGH (Master wants to send data) but TREADY is LOW (Slave is not ready), the system waits until TREADY goes HIGH. Arrow shows the Handshake process. |
FIG: TREADY before TVALID handshake |
FIG: TVALID with TREADY handshake |
- Limitation of AXI Master: A master is not permitted to wait until TREADY is asserted before asserting TVALID. Once TVALID is asserted it must remain asserted until the handshake occurs. (When Master has data to send, it should immediately activate TVALID without paying attention to TREADY).
- Slave is more flexible. A Slave is permitted to wait for TVALID to be asserted before asserting the corresponding TREADY, If a slave asserts TREADY, it is permitted to deassert TREADY before TVALID is asserted.
- When AXI Master needs to send some data to Slave, it activates TVALID (makes it HIGH). Similarly, when Slave is ready to accept data from Master, it activates the TREADY signal.
- When both TVALID and TREADY are HIGH, data sending process occurs. This process is called Handshake.
Data Signaling:
- TDATA (main carrier of the information) is the primary payload of the AXI-Stream interface and is used to transport data from a source to a destination.
- In a data stream, the low order bytes of the data bus are the earlier bytes in the stream.
- The AXI4-Stream protocol defines three byte types:
- Data byte: A data byte must be transmitted from source to destination. This is the actual data that Master needs to send to Slave.
- Position byte: A position byte must be transmitted from source to destination. Defines the address.
- Null byte: A null byte contains no information.
Byte Qualifiers:
Source - documentation on arm's website. |
- It qualifies the bytes that need to be set.
- TKEEP: A byte used to indicate whether the content of the associated byte must be transported to the destination.
- TSTRB: A byte qualifier used to indicate whether the content of the associated byte is a data byte or a position byte.
Packet Boundaries:
Let us assume, we have an AXI Stream Master, which is gating data from two sensors: S1 and S2. The data is further sent to Slave which send the data further to Memory1 and Memory2. Now, {S1, S2} - Packet1 in one time is one packet and a similar packet of {S1, S2} - Packet2 in a different time is another packet. Let's see what values of TID, TDEST, and TLAST are assigned.
=> Packet1: While sending data from S1, TID = S1, TDEST = Memory1, TLAST = 0 and when S2 sends the data, then TID = S2, TDEST = Memory1, TLAST = 1 (since this is the end of the Packet).
Can you find out what would be the values for Packet2 ?
Let us assume, we have an AXI Stream Master, which is gating data from two sensors: S1 and S2. The data is further sent to Slave which send the data further to Memory1 and Memory2. Now, {S1, S2} - Packet1 in one time is one packet and a similar packet of {S1, S2} - Packet2 in a different time is another packet. Let's see what values of TID, TDEST, and TLAST are assigned.
=> Packet1: While sending data from S1, TID = S1, TDEST = Memory1, TLAST = 0 and when S2 sends the data, then TID = S2, TDEST = Memory1, TLAST = 1 (since this is the end of the Packet).
Can you find out what would be the values for Packet2 ?
FIG: Indicating end of the packet. |
- A Packet is a way to organize data that has to be sent.
- A Packet is a group of bytes that are transmitted together across the interface.
- The signals to be considered during a packet transfer are TID, TDEST, and TLAST.
- TID provides a stream identifier and can be used to differentiate between multiple streams of data that are being transferred across the same interface.
- TDEST provides coarse routing information for the data stream.
The uses of TLAST are:
- When asserted, TLAST can be used by a destination to indicate a packet boundary.
- When asserted, TLAST indicates an efficient point to make an arbitration change on a shared link.
No explicit signaling of the start of a packet boundary is given in the protocol. The start of a packet is determined as:
- The first occurence of a TID and TDEST pair after reset.
- The first transfer after the end of the preceding packet for any unique set of TID and TDEST values.
User Signaling: When there is a need of sending extra data between Master and Slave TUSER is used. User is able to send extra information from M to S.
- Typical uses of a streaming interface require some User sideband signaling.
- To ensure a consistent method of transporting User information the protocol defines that User signaling is transferred on a byte basis.
- TUSER can be used to convey information that is relevant to an entire transfer rather than to individual bytes.
Comments
Post a Comment