本篇以ARM官方AXI4手册:
AMBA ® AXI and ACE Protocol Specification

https://documentation-service.arm.com/static/5f915b62f86e16515cdc3b1c

注:如无特殊说明,下文中AXI默认表示AXI4协议

为参考手册,简单记录AXI总线的实现注意事项。

AXI4-Lite operation:

The key functionality of AXI4-Lite operation is:
• all transactions are of burst length 1
• all data accesses use the full width of the data bus — AXI4-Lite supports a data bus width of 32-bit or 64-bit.
• all accesses are Non-modifiable, Non-bufferable
• Exclusive accesses are not supported.

手册重要章节:Chapter A3 – Single Interface Requirements

AXI握手机制总结:

  1. 五个信号传输通道(W, R, AW, AR, B)使用相同的VALID/READY握手机制(复位后第一个上升沿的初值设置有所不同)。数据的传输只会发生在VALID和READY同时为高电平时。
  2. 所有接口信号必须是寄存器输出。
  3. 发送方(Source)的 VALID 信号,禁止等待 READY。必须独立、率先断言。
    接收方(Destination)的 READY 信号,允许等待 VALID。甚至可以根据 VALID 的状态来决定何时断言。

时序要求

A source is not permitted to wait until READY is asserted before asserting VALID.
Once VALID is asserted it must remain asserted until the handshake occurs, at a rising clock edge at which VALID and READY are both asserted.

A destination is permitted to wait for VALID to be asserted before asserting the corresponding READY.
If READY is asserted, it is permitted to deassert READY before VALID is asserted

信息的发送方不能通过“窥探”接收方的 READY 信号,来决定是否断言自己的 VALID 信号。
一旦发送方断言 VALID,其信号必须保持,直到完成握手握手。

信息的接收方被允许,甚至可以有意地等待发送方先断言 VALID 信号,然后再断言自己的 READY 信号。
即使接收方已经断言了 READY 信号(表明自己准备好接收数据),它也完全被允许在发送方的 VALID 信号到来之前,再次取消断言这个 READY 信号。

the slave must wait for both ARVALID and ARREADY to be asserted before it asserts RVALID to indicate that valid data is available

上述内容摘自手册A3.3.1。即一次读数据事务(R channel)必须发生在一次读地址(AR channel)事务后。

为什么手册没有对写数据(W channel)和写地址(AW channel)作同样的要求?

因为W和WA都是主发给从的,而对于读来说只有AR是主发给从的,按常理来说在读的时候你没有地址发出去就不应该返回读的数据,而写的时候写地址和写数据都是发给从机的,两个可以不相关,可以写数据给从机然后过几个周期再把写地址给从机,从机完成写操作之后返回B通道的信号,所以对B通道会有限制

——cosin

典型握手Timing Diagram:

各Channel Signal Pair详细规范

AXI协议共有如下五组握手信号

  • Write address channel: AWVALID, AWREADY
  • Write data channel: WVALID, WREADY
  • Write response channel: BVALID, BREADY
  • Read address channel: ARVALID, ARREADY
  • Read data channel: RVALID, RREADY

Write address channel
The master can assert the AWVALID signal only when it drives valid address and control information. When
asserted, AWVALID must remain asserted until the rising clock edge after the slave asserts AWREADY.
The default state of AWREADY can be either HIGH or LOW. This specification recommends a default state of
HIGH. When AWREADY is HIGH the slave must be able to accept any valid address that is presented to it.

……

上述内容摘自手册A3.2.2,现总结如下

VALIDREADY
AW保持断言直到握手默认建议为高电平
W
B
AR
R

握手信号顺序要求:

AXI Backward Response

OKAY
Normal access success. Indicates that a normal access has been successful. Can also indicate an
exclusive access has failed.
……

上述内容摘自手册A3.4.4,现总结如下:

  • OKAY:正常的响应,表示一次非exclusive请求传输成功,或可以表示exclusive请求的失败,也表示从机不支持exclusive access。
  • EXOKAY:表示一次读/写的exclusive access成功
  • SLVERR:表示请求已经被从机成功接收,但是从机希望返回一个错误来提示主机处理
  • DECERR:Decode Error,表示事物总线地址上没有相应从机

由 Redbean

《AXI4协议学习随记1-时序要求》有一个想法
  1. NOTE: 现在latest的axi协议手册中对handshake signals 的依赖关系的描述可在A2.3 Valid-Ready查阅

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注