AXI5 new feature: support atomic transaction

AXI (Advanced extensible Interface) 协议是ARM公司提出的AMBAAdvanced Microcontroller Bus Architecture)协议中最重要的部分,是一种面向高性能、高带宽、低延迟的片内总线。当前最新为 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 发送出去, 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发送 addr、length、atomic type and operation,都需要从memory读取addr位置的原始数据,都需要进行ALU运算,然后将新的value再存入addr位置。两者的主要区别体现在 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发出的数据

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发出的数据

• 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.

 

 

 

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

123axj

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值