Introduction to AXI – Custom IP
C r i s t i a n S i s t e r n a U n i v e r s i d a d N a c i o n a l d e S a n J u a n A r g e n t i n a
Custom IP C r i s t i a n S i s t e r n a U n i v e r s i d a d N - - PowerPoint PPT Presentation
Introduction to AXI Custom IP C r i s t i a n S i s t e r n a U n i v e r s i d a d N a c i o n a l d e S a n J u a n A r g e n t i n a Agenda Describe the AXI4 transactions Summarize the AXI4 valid/ready acknowledgment model
C r i s t i a n S i s t e r n a U n i v e r s i d a d N a c i o n a l d e S a n J u a n A r g e n t i n a
ICTP - IAEA AXI - Custom IP
design of Zynq based systems
standard developed by ARM, called AXI (ARM eXtended Interface):
ICTP - IAEA
3
AXI - Custom IP
ICTP - IAEA
4
CPU Vide Controller Ethernet Controller USB SPI DDR Controller Shared DRAM Memory General Purpose I/O DAC ADC
AXI - Custom IP
ICTP - IAEA
5
Processor
P1 P2 P3 Arbiter
Peripherals
PLBv46 – Bus Spec
PLB PLB PLB PLB
Processor AXI Inteconnect
P1 P2 P3
M_AXI M_AXI M_AXI M_AXI S_AXI S_AXI S_AXI
AXI4 Defines a Point to Point Master/Slave Interface
S_AXI S_AXI M_AXI
AXI - Custom IP
ICTP - IAEA
6
AXI - Custom IP
ICTP - IAEA
7
AXI - Custom IP
ICTP - IAEA
AMBA APB AHB
AXI
Older
Performance Newer AMBA 3.0
(2003)
AMBA: Advanced Microcontroller Bus Architecture AXI: Advanced Extensible Interface
8
AXI - Custom IP
ICTP - IAEA
AMBA
APB AHB AXI AXI-4 Memory Map AXI-4 Stream AXI-4 Lite ATB
AMBA 3.0
(2003)
AMBA 4.0
(2010)
Same Spec Enhancements for FPGAs
Interface Features Burst Data Width Applications
AXI4 Traditional Address/Data Burst (single address, multiple data) Up to 256 32 to 1024 bits Embedded, Memory AXI4-Stream Data-Only, Burst Unlimited Any Number DSP, Video, Communications AXI4-Lite Traditional Address/Data—No Burst (single address, single data) 1 32 or 64 bits Small Control Logic, FSM
9
AXI - Custom IP
Channel
Interface
Bus
Transfer
Transaction
Burst
ICTP - IAEA
10
AXI - Custom IP
ICTP - IAEA
11
AXI Slave
AXI Master Read Transaction Write Transaction Transactions: transfer of data from one point on the hardware to another point Responds to the initiate transaction Initiates the transaction
AXI - Custom IP
ICTP - IAEA
12
AXI Slave
AXI Master
AXI Slave
AXI Master AXI Master
AXI Slave
AXI - Custom IP
AXI is an interconnect system used to tie processors to peripherals
resources)
ICTP - IAEA
13
AXI - Custom IP
ICTP - IAEA
14
AXI Master DMA AXI Master CPU
AXI Slave SPI AXI Slave GPIO AXI Slave BRAM
AXI Interconnect
M_AXI S_AXI M_AXI S_AXI S_AXI M_AXI S_AXI M_AXI S_AXI M_AXI
AXI - Custom IP
ICTP - IAEA
15
Address Range: 4K Address Offset: 0X4000_0000 Addresses: 0X4000_0000 – 0X4000_0FFF Address Range: 4K Address Offset: 0X4000_1000 Addresses: 0X4000_0000 – 0X4000_1FFF Address Range: 64K Address Offset: 0X4001_0000 Addresses: 0X4001_0000 – 0X4001_FFFF
Address Decoding Table GPIO: 0X4000_0000 SPI: 0X4000_1000 BRAM: 0X4001_0000
AXI - Custom IP
ICTP - IAEA
16
AXI - Custom IP
ICTP - IAEA AXI - Custom IP
ICTP - IAEA
18
AXI - Custom IP
ICTP - IAEA
19
AXI - Custom IP
ICTP - IAEA
20
AXI - Custom IP
AXI - Custom IP ICTP - IAEA
21
Master asserts and hold VALID when data is available
ICTP - IAEA
22
Master sends next DATA/other signals or deasserts VALID Data and other signals transferred when VALID and READY = ‘1’
DATA VALID READY
AXI Master AXI Slave
ACLK
AXI - Custom IP
1 1 2 2 2 2 5 3 3 3 4 4 4 1 3 3 5 5 5
Slave asserts READY if able to accept data Slave deasserts READY if no longer able to accept data
ICTP - IAEA
23
AXI4 Read AXI4 Master AXI4 Slave
Read Address Channel Read Data Channel Write Address Channel Write Data Channel Write Response Channel Address and Control Read Data Read Data Read Data Read Data Address and Control Write Data Write Data Write Data Write Data Write Response
AXI4 Master AXI4 Slave AXI4 Write
AXI - Custom IP
ICTP - IAEA
24
AXI - Custom IP
ICTP - IAEA
25
AXI Master AXI Slave
Read Address Channel Read Data Channel Address and Control Read Data Read Data Read Data Read Data
bits
Write Address Channel Write Data Channel Write Response Channel Address and Control Write Data Write Data Write Data Write Data Write Response
AXI Master AXI Slave
AXI - Custom IP
ICTP - IAEA
26
Write Data Channel Write Data Write Data Write Data Write Data
AXI Master AXI Slave
and write, always just Master to Slave
aligned, unaligned streams
AXI - Custom IP
ICTP - IAEA
27
AXI Master AXI Slave AXI Slave Data Data AXIS_S AXIS_S AXIS_M
AXI - Custom IP
ICTP - IAEA
28
AXI Master AXI Slave
Read Address Channel Read Data Channel Address and Control Read Data Read Data Read Data Read Data
(Xilinx IP only support 32)
automatically generated
Write Address Channel Write Data Channel Write Response Channel Address and Control Write Data Write Data Write Data Write Data Write Response
AXI Master AXI Slave
AXI - Custom IP
ICTP - IAEA
29
AXI Master AXI Slave
Read Address Channel Read Data Channel Address and Control Read Data Read Data Read Data Read Data
AXI - Custom IP
ICTP - IAEA
30
Write Address Channel Write Data Channel Write Response Channel Address and Control Write Data Write Data Write Data Write Data Write Response
AXI Master AXI Slave
AXI - Custom IP
AXI - Custom IP ICTP - IAEA
31
AXI - Custom IP ICTP - IAEA
32
ICTP - IAEA
33
AXI - Custom IP
ICTP - IAEA
34
AXI - Custom IP
Vivado tools can be used to map each AXI signal
when creating the IP
designer much easier, the signal names shown here are recommended when designing a custom AXI slave in VHDL
design tools to automatically detect the signal names during the “create and package IP” step (described later on).
ICTP - IAEA
35
AXI - Custom IP
it was necessary for each IP peripheral connected to the processor to individually decode all transactions that were presented by a master on the bus (“multi-drop”). it was the responsibility
placed on the address bus.
each transaction from the master(s) is specifically routed to a single slave IP depending on the address provided by the master.
a slave IP, in that any transactions which reach the slave’s interface ports are already known to be destined for that peripheral.
the registers in the slave IP should be read or written
ICTP - IAEA
36
Address Decode & Write Enable AXI4-Lite IP
AXI - Custom IP
ICTP - IAEA
37
AXI - Custom IP
ICTP - IAEA
38
AXI - Custom IP
which can receive data values written by a master on the AXI4-lite interconnect. The following extract of code shows how an individual register can be quickly and easily implemented (in this case mapped to BASEADDR + 0x00, as has been coded in the previous VHDL snippet).
Read Transaction WriteTransaction
ICTP - IAEA
39
AXI - Custom IP
logic to control the AXI transactions.
state machine. Here, it is an example of a (simplified) state machine, showing the implementation of some of the states, and how a read transaction might be handled in the design.
the states required to implement read and write transactions, but should help to illustrate a style of coding suitable for creating the FSM.
ICTP - IAEA
40
AXI - Custom IP
IP from many sources can be packaged and made available in Vivado All IP available in the Vivado IP Catalog can be used to create IP Integrator designs Any IP Integrator diagram can be quickly packaged as a single complex IP
AXI - Custom IP ICTP - IAEA
Creating Custom IP 14- 41
IP Packager
Source (C, RTL, IP, etc) Simulation Models Documentation Example Designs Test Bench
Vivado IP Integrator
Standardized IP-XACT representation Xilinx IP 3rd Party IP User IP
Consistent, easy access Support for multiple physical locations, including
shared network drives
Access to the latest version of Xilinx-delivered IP Access to IP customization and generation using the
Vivado IDE
IP example designs Catalog filter options that let you filter by Supported
Output Products, Supported Interfaces, Licensing, Provider, or Status
ICTP - IAEA
42
AXI - Custom IP
43 Creating Custom IP 14- 43
ICTP - IAEA
The IP Packager allows a core to be packaged and included in the IP Catalog, or
for distribution
IP-XACT Complete set of files include
Source code, Constraints, Test Benches (simulation files), documentation
IP Packager can be run from Vivado on the current project, or on a specified
directory
does not replace HDL or Software.
AXI - Custom IP ICTP - IAEA
44
ICTP - IAEA
45
AXI - Custom IP
46
ICTP - IAEA
included in the IP Catalog, or for distribution
files), documentation
project, or on a specified directory
Create and Package IP Wizard Generates HDL template for
Slave/Master AXI Lite/Full/Stream
Optionally Generates
ICTP - IAEA AXI - Custom IP
ICTP - IAEA
48
AXI - Custom IP
ICTP - IAEA
49
AXI - Custom IP
ICTP - IAEA
50
AXI - Custom IP
ICTP - IAEA
51
AXI - Custom IP
ICTP - IAEA
52
AXI - Custom IP
ICTP - IAEA
53
AXI - Custom IP
ICTP - IAEA
54
AXI - Custom IP
ICTP - IAEA
55
AXI - Custom IP
ICTP - IAEA
56
AXI - Custom IP
ICTP - IAEA
57
AXI - Custom IP
(This ends the Works on the edit_ip environment)
ICTP - IAEA
58
AXI - Custom IP
These steps shold be done in the Vivado Environment
ICTP - IAEA
59
AXI - Custom IP
component.xml
.bd
drivers
functionality
hdl
xgui
Creating Custom IP 14- 60
ICTP - IAEA AXI - Custom IP
Slave/Master ‘device’
ICTP - IAEA
61
project
registers
AXI - Custom IP