ARM之AXI总线协议初试

Posted on 2020-06-03 20:20  绿叶落秋风  阅读(1503)  评论(0编辑  收藏  举报

AXI总线协议的学习

1、AXI总线的初步认识

What is AXI?
AXI is part of ARM AMBA, a family of micro controller buses first introduced in 1996. The
first version of AXI was first included in AMBA 3.0, released in 2003. AMBA 4.0, released in
2010, includes the second major version of AXI, AXI4.
There are three types of AXI4 interfaces:
• AXI4: For high-performance memory-mapped requirements.
• AXI4-Lite: For simple, low-throughput memory-mapped communication (for example,
to and from control and status registers).
• AXI4-Stream: For high-speed streaming data.

这段是摘自xilinx的ug1037的对于AXI的简介。大概意思就是AXI是ARM AMBA的一部分,有常用的三种形式。感觉读完后还是什么都不知道。作为一个传输协议,主要的目的还是传输数据。如何能够快速地理解一个协议呢?找到这个协议的传输特点。

由于AXI的种类有多种,具体的设计一般只会使用一种(会一种基本上就可以会其他的)。所以,先看一下AXI4总线的优势。

Summary of AXI4 Benefits
AXI4 is widely adopted in Xilinx product offerings, providing benefits to Productivity,
Flexibility, and Availability:
• Productivity: By standardizing on the AXI interface, developers need to learn only a
single protocol for IP.
• Flexibility: Providing the right protocol for the application:
° AXI4 is for memory-mapped interfaces and allows high throughput bursts of up to
256 data transfer cycles with just a single address phase.
° AXI4-Lite is a light-weight, single transaction memory-mapped interface. It has a
small logic footprint and is a simple interface to work with both in design and
usage.
° AXI4-Stream removes the requirement for an address phase altogether and allows
unlimited data burst size. AXI4-Stream interfaces and transfers do not have address
phases and are therefore not considered to be memory-mapped.
• Availability: By moving to an industry-standard, you have access not only to the
Vivado IP Catalog, but also to a worldwide community of ARM partners.
° Many IP providers support the AXI protocol.
° A robust collection of third-party AXI tool vendors is available that provide many
verification, system development, and performance characterization tools. As you
begin developing higher performance AXI-based systems, the availability of these
tools is essential.

这里谈到了AXI4的效率、灵活性、可用性。简单来说,就是AXI对于设计者来说只需要知道IP协议,对于传输来说是应用程序协议,可以直接由程序调用。由于是ARM家族的,自然可以适用于各种ARM器件。这里就可以大致的了解AXI协议是什么了。AXI支持直接的硬件设计,可以由硬件描述语言构建发送和接受的模块。同时,该协议还支持APPLICATION直接调用,相当于实现了数据有硬件层向软件层跨越。对比串口协议,串口的数据只能通过软件端的库函数接受和发送,直接的软件是不能够直接访问传输中的数据的。换言之,软件无法直接操控传输。

2、AXI总线的设计思路

Both AXI4 and AXI4-Lite interfaces consist of five different channels:
• Read Address Channel
• Write Address Channel
• Read Data Channel
• Write Data Channel
• Write Response Channel

这是AXI总线的工作通道。从这里就可以看出AXI总线的复杂之处。同样对比串口,串口没有地址,数据通道的读写共用。写响应也是夹杂在数据位中。另外一个有代表性的通信协议是SCCB协议。SCCB协议的双向口具有数据、地址、响应这三个模块,加上状态线sio_e也是可以进行多机通信的。但是,显然,过于集中的数据流向限制了通信效率。而AXI作为内部总线协议,效率的考量是大于面积的。毕竟在芯片内部的布线资源要远大于IO口的资源。

作为协议,基本的功能就是数据传输。和其他协议一样,AXI的读操作也是需要读地址和读数据两个步骤。写操作需要写数据、写地址和写响应三个部分的操作。这只是单向操作。设计到多个从属设备时,情况会更加复杂。可以在后面的设计中有所体现。

3、AXI总线的开发概念

为什么会学到AXI,在ZYNQ内部集成了ARM内核,是一个可以搭载微型操作系统的内核。而FPGA被作为外设资源置于外围。这种片上系统的操作是明确的。通过FPGA设计出足够灵活的外设,将信号处理后传递到ARM,有ARM的稳定架构加工,即可快速实现各种功能。而在内部,PS和PL的连接协议就是芯片内部常用的AXI总线协议。使用这个协议的原因前面已经分析过了。

这种结构的优势是将ARM的稳定性和FPGA的灵活性融合在一起,用于实现特定的目的。所以,如果想要掌握这种设计方法,AXI总线会是躲不开的坎。你总不能用IO口去连接ARM和FPGA,这个太奢侈了。

小结一下,就是使用AXI是ARM结合FPGA的灵魂。