AXI5 new feature: support atomic transaction
AXI (Advanced extensible Interface) 協(xié)議是ARM公司提出的AMBA(Advanced Microcontroller Bus Architecture)協(xié)議中最重要的部分,是一種面向高性能、高帶寬、低延遲的片內總線。當前最新為 AXI 5.0 (2020年)。
AXI5 Spec download AMBA
AXI5 的一個重要更新,就是增加了對atomic transaction (或稱之為 atomic operation,原子操作)的支持。
Atomic transactions are suited to situations where the data is located a significant distance from the agent that must perform the operation. Compared with using Exclusive Accesses, this approach reduces the amount of time during which the data must be made inaccessible to other agents in the system.
AXI5支持4大類的atomic,分別為atomic store、atomic load、atomic swap和atomic compare。其中,atomic store和atomic load 會再細分為多種不同的atomic operation,比如ADD、CLR等等;atomic swap和atomic compare則沒有細分的atomic operation,因為其操作是固定的。
atomic的request 會通過AW和W channel 發(fā)送出去, atomic response 會通過 B 和R channel 進行返回。其中AW channel會在AXI4的基礎上增加AWATOP[5:0]的signal,用來標識atomic的類型和具體的operation類型;W channel會傳遞 原始的操作數(operand)。如上的read modify write 操作,atomic 類型為store atomic,atomic operation為ADD,原始的操作數 就是 1。
atomic store和atomic load都需要通過AW 和W channel發(fā)送 addr、length、atomic type and operation,都需要從memory讀取addr位置的原始數據,都需要進行ALU運算,然后將新的value再存入addr位置。兩者的主要區(qū)別體現(xiàn)在 atomic 操作完成的response和data返回上:atomic store會通過B channel返回一個 atomic response;而 atomic load會通過R channel 返回 訪問地址空間的 原始數據(也就是進行atomic operation之前的數據)。
如下是spec中對atomic 四大類的描述,其中outbound和inbound 的表述都是站在 master的角度來看的。
| Atomic type | Description |
| Atomic store | ? Sends a single data value with an address and the atomic operation to be performed. ? The target performs the operation using the sent data and value at the addressed location as operands. ? The result is stored in the address location. ? A single response is given without data. ? Outbound data size is 1, 2, 4, or 8 bytes. 也就是master發(fā)出的數據 |
| atomic load | ? Sends a single data value with an address and the atomic operation to be performed. ? The original data value at the addressed location is returned. 一定要注意,此處返回的不是 ALU計算后的數據,而是addr位置的原始數據。 ? The target performs the operation using the sent data and value at the addressed location as operands. ? The result is stored in the address location. ? Outbound data size is 1, 2, 4, or 8 bytes. 也就是master發(fā)出的數據 ? Inbound data size is the same as the outbound data size.也就是 memory需要返回的數據 |
| atomic swap | ? Sends a single data value with an address. 不需要 atomic operation ? The target swaps the value at the addressed location with the data value that is supplied in the transaction. ? The original data value at the addressed location is returned. ? Outbound data size is 1, 2, 4, or 8 bytes. ? Inbound data size is the same as the outbound data size |
| atomic compare | ? Sends two data values, the compare value and the swap value, to the addressed location. The compare and swap values are of equal size. 不需要 atomic operation。 ? The data value at the addressed location is checked against the compare value: — If the values match, the swap value is written to the addressed location. — If the values do not match, the swap value is not written to the addressed location. ? The original data value at the addressed location is returned. ? Outbound data size is 2, 4, 8, 16, or 32 bytes. Compare需要攜帶 兩個操作數,一個為compare value,一個是 swap value。 ? Inbound data size is half of the outbound data size because the outbound data contains both compare and swap values, whereas the inbound data has only the original data value. |
?
?
?
總結
以上是生活随笔為你收集整理的AXI5 new feature: support atomic transaction的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Kinect+unity 实现体感格斗闯
- 下一篇: 安消一体智能分析终端服务器