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

custom ip
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2
  • Describe the AXI4 transactions
  • Summarize the AXI4 valid/ready acknowledgment model
  • Discuss the AXI4 transactional modes of overlap and simultaneous operations
  • Describe the operation of the AXI4 streaming protocol

Agenda

ICTP - IAEA AXI - Custom IP

slide-3
SLIDE 3
  • There is a need to get familiar with the way that different devices communicate each
  • ther in an Embedded System like a Zynq based system
  • Learning and understanding the communication among devices will facilitate the

design of Zynq based systems

  • All the devices in a Zynq system communicate each other based in a device interface

standard developed by ARM, called AXI (ARM eXtended Interface):

  • AXI define a Point to Point Master/Slave Interface

ICTP - IAEA

3

Need to Understand Device’s Connectivity

AXI - Custom IP

slide-4
SLIDE 4

ICTP - IAEA

4

Today’s System-On On-Chip

CPU Vide Controller Ethernet Controller USB SPI DDR Controller Shared DRAM Memory General Purpose I/O DAC ADC

AXI - Custom IP

slide-5
SLIDE 5

Interface Options

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

slide-6
SLIDE 6
  • A standard
  • All units talk based on the same standard (same protocol, same language)
  • All units can easily talk to each other
  • Maintanence
  • Design is easily maintined/updated
  • Facilitate debug tasks
  • Re-Use
  • Developed cores can easily re-used in other systems

ICTP - IAEA

6

Connectivity -> Standard

AXI - Custom IP

slide-7
SLIDE 7
  • Core Connect (IBM)
  • PLB/OPB (Power PC-FPGA bus interface)
  • WishBone
  • OpenCore Cores
  • AXI
  • ARM standard (more to come . . . )

ICTP - IAEA

7

Common SoC Interfaces

AXI - Custom IP

slide-8
SLIDE 8

ICTP - IAEA

AXI is Part of ARM’s AMBA

AMBA APB AHB

AXI

Older

Performance Newer AMBA 3.0

(2003)

AMBA: Advanced Microcontroller Bus Architecture AXI: Advanced Extensible Interface

8

AXI - Custom IP

slide-9
SLIDE 9

ICTP - IAEA

AXI is Part of AMBA

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

slide-10
SLIDE 10

Channel

  • Independent collection of AXI signals associated to a VALID signal

Interface

  • Collection or more channles that expose an IP core’s connectin a master to a slave
  • Each IP core may have multiple interfaces

Bus

  • Multiple-bit signal (not an interface or channel)

Transfer

  • Single clock cycle where information is communicated, qualified by a a VALID handshake

Transaction

  • Complete communication operation across a channel, composed of a one or more transfers

Burst

  • Transaction that consists of more than one transfer

AXI – Vocabulary

ICTP - IAEA

10

AXI - Custom IP

slide-11
SLIDE 11

AXI Transactions / Master-Slave

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

slide-12
SLIDE 12

More than One-to to-One

ICTP - IAEA

12

AXI Slave

AXI Master

AXI Slave

?

AXI Master AXI Master

AXI Slave

?

AXI - Custom IP

slide-13
SLIDE 13

AXI is an interconnect system used to tie processors to peripherals

  • AXI Full memory map: Full performance bursting interconnect
  • AXI Lite: Lower performance non bursting interconnect (saves programmable logic

resources)

  • AXI Streaming: Non-addressed packet based or raw interface

ICTP - IAEA

AXI Interconnect

13

AXI - Custom IP

slide-14
SLIDE 14

ICTP - IAEA

14

AXI Interconnect

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

slide-15
SLIDE 15

ICTP - IAEA

15

AXI Interconnect – Addressing & Decoding

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

slide-16
SLIDE 16
  • Different Number of (up to 16)
  • Slave Ports
  • Master Ports
  • Data Width Conversion
  • Conversion from AXI3 to AXI4
  • Register Slices, Input/Output FIFOs
  • Clock Domains Transfer

ICTP - IAEA

16

AXI Interconnect Main Features

AXI - Custom IP

slide-17
SLIDE 17
  • axi_interconnect component
  • Highly configurable
  • Pass Through
  • Conversion Only
  • N-to-1 Interconnect
  • 1-to-N Interconnect
  • N-to-M Interconnect – full crossbar
  • N-to-M Interconnect – shared bus structure
  • Decoupled master and slave interfaces
  • Xilinx provides three configurable
  • AXI4 Lite Slave
  • AXI4 Lite Master
  • AXI4 Slave Burst
  • Xilinx AXI Reference Guide(UG761)

AXI Interconnect

ICTP - IAEA AXI - Custom IP

slide-18
SLIDE 18

AXI Interface Example

ICTP - IAEA

18

AXI - Custom IP

slide-19
SLIDE 19

AXI Interface Example

ICTP - IAEA

19

AXI - Custom IP

slide-20
SLIDE 20

AXI Slave Signals

ICTP - IAEA

20

AXI - Custom IP

slide-21
SLIDE 21

Basic AXI Rd/Wr Process

AXI - Custom IP ICTP - IAEA

21

slide-22
SLIDE 22

Master asserts and hold VALID when data is available

ICTP - IAEA

AXI Channels Use A Basic “VALID/READY” Handshake

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

slide-23
SLIDE 23

ICTP - IAEA

23

AXI Channels (AXI4 and AXI Lite)

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

slide-24
SLIDE 24

AXI Slave - Channels

ICTP - IAEA

24

AXI - Custom IP

slide-25
SLIDE 25

ICTP - IAEA

25

(Full) AXI4

AXI Master AXI Slave

Read Address Channel Read Data Channel Address and Control Read Data Read Data Read Data Read Data

  • Sometimes called “Full AXI”
  • r “AXI Memory Mapped”
  • Single address multiple data
  • Burst up to 256 data
  • Data Width parameterizable
  • 32, 64, 128, 256, 512, 1024

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

slide-26
SLIDE 26

ICTP - IAEA

26

AXI4 Stream

Write Data Channel Write Data Write Data Write Data Write Data

AXI Master AXI Slave

  • No address channel, no read

and write, always just Master to Slave

  • Just an AXI4 Write Channel
  • Unlimited burst length
  • Supports sparse, continuous,

aligned, unaligned streams

AXI - Custom IP

slide-27
SLIDE 27

ICTP - IAEA

27

AXI Stream

AXI Master AXI Slave AXI Slave Data Data AXIS_S AXIS_S AXIS_M

AXI - Custom IP

slide-28
SLIDE 28

ICTP - IAEA

28

AXI4 Lite

AXI Master AXI Slave

Read Address Channel Read Data Channel Address and Control Read Data Read Data Read Data Read Data

  • No Burst
  • Single address, single data
  • Data Width 32 or 64 bits

(Xilinx IP only support 32)

  • Very small size
  • The AXI Interconnect is

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

slide-29
SLIDE 29

ICTP - IAEA

29

AXI4 Lite Read

AXI Master AXI Slave

Read Address Channel Read Data Channel Address and Control Read Data Read Data Read Data Read Data

AXI - Custom IP

slide-30
SLIDE 30

ICTP - IAEA

30

AXI4 Lite Write

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

slide-31
SLIDE 31

AXI - Custom IP ICTP - IAEA

31

AXI4 – AXI Lite: Signals Available

slide-32
SLIDE 32

AXI4-Lite Custom IP The VHDL Underneath

AXI - Custom IP ICTP - IAEA

32

slide-33
SLIDE 33

AXI4-Lite Signal Names

ICTP - IAEA

33

AXI - Custom IP

slide-34
SLIDE 34

AXI4-Lite Signal Names

ICTP - IAEA

34

AXI - Custom IP

  • During the creation of a Xilinx IP block, the

Vivado tools can be used to map each AXI signal

  • nto the signal name that the designer used

when creating the IP

  • However in order to make the life of the

designer much easier, the signal names shown here are recommended when designing a custom AXI slave in VHDL

  • Using these signal names will allow the Vivado

design tools to automatically detect the signal names during the “create and package IP” step (described later on).

slide-35
SLIDE 35

AXI4-Lite Address Decoding

ICTP - IAEA

35

AXI - Custom IP

  • In previous versions of the Xilinx design flow (where PLB and OPB peripherals were typically used)

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

  • f each peripheral to accept or reject each bus transaction depending on the address that was

placed on the address bus.

  • With AXI4-lite, the interconnect does not use a multi-drop architecture, but uses a scheme where

each transaction from the master(s) is specifically routed to a single slave IP depending on the address provided by the master.

  • This premise permits a completely different design methodology to be adopted by the creator of

a slave IP, in that any transactions which reach the slave’s interface ports are already known to be destined for that peripheral.

  • The designer merely needs to decode enough of the incoming address bus to determine which of

the registers in the slave IP should be read or written

slide-36
SLIDE 36

ICTP - IAEA

36

My VHDL Code – Address Decoding

Address Decode & Write Enable AXI4-Lite IP

AXI - Custom IP

slide-37
SLIDE 37

AXI4-Lite Address Decoding – VHDL Example

ICTP - IAEA

37

AXI - Custom IP

slide-38
SLIDE 38

AXI4-Lite – Implementing Addressable Registers

ICTP - IAEA

38

AXI - Custom IP

  • Using the address decoding scheme above, it is extremely simple to implement registers in VHDL

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

slide-39
SLIDE 39

AXI4-Lite – Controlling AXI Transactions

ICTP - IAEA

39

AXI - Custom IP

  • Usually there is a need to implement some

logic to control the AXI transactions.

  • This can be achieved by the use of a finite

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 example is not designed to cover all of

the states required to implement read and write transactions, but should help to illustrate a style of coding suitable for creating the FSM.

slide-40
SLIDE 40

Custom AXI IPs Use of MGPO & MGP1

ICTP - IAEA

40

AXI - Custom IP

slide-41
SLIDE 41

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

Reusing Your 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

slide-42
SLIDE 42

 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

IP Catalog Main Features

AXI - Custom IP

slide-43
SLIDE 43

43 Creating Custom IP 14- 43

ICTP - IAEA

IP Packager

 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

slide-44
SLIDE 44
  • Industry Standard (IEEE) XML format to describe IP using meta-data
  • Ports
  • Interfaces
  • Configurable Parameters
  • Files, documentation
  • IP-XACT only describes high level information about IP, not low level description, so

does not replace HDL or Software.

  • Enables automatic connection, configuration and integration
  • Enables integration of 3rd Party IP
  • (And Export of your own IP)

IP IP-XACT

AXI - Custom IP ICTP - IAEA

44

slide-45
SLIDE 45
  • Use of MGPO & MGP1 to transfer data from the PS to a AXI Slave in the PL
  • Write transaction to PL through MGP0
  • Read transaction from PL through MGP1

Transfer Data from ARM Bus to PL Logic

ICTP - IAEA

45

AXI - Custom IP

slide-46
SLIDE 46

46

ICTP - IAEA

IP Packager

  • 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

slide-47
SLIDE 47

 Create and Package IP Wizard  Generates HDL template for

Slave/Master AXI Lite/Full/Stream

 Optionally Generates

  • Software Driver
  • Only for AXI Lite and Full slave interface
  • Test Software Application
  • AXI4 BFM Example

IP Manager

ICTP - IAEA AXI - Custom IP

slide-48
SLIDE 48

ICTP - IAEA

48

Create Custom AXI4 IP

AXI - Custom IP

slide-49
SLIDE 49

ICTP - IAEA

49

Create Custom AXI4 IP

AXI - Custom IP

slide-50
SLIDE 50

ICTP - IAEA

50

Create Custom AXI4 IP

AXI - Custom IP

slide-51
SLIDE 51

ICTP - IAEA

51

Edit Created Custom AXI4 IP

AXI - Custom IP

slide-52
SLIDE 52

ICTP - IAEA

52

Edit Created Custom AXI4 IP

AXI - Custom IP

slide-53
SLIDE 53

ICTP - IAEA

53

Hierarchy of My IP

AXI - Custom IP

slide-54
SLIDE 54

ICTP - IAEA

54

Package the IP

AXI - Custom IP

slide-55
SLIDE 55

ICTP - IAEA

55

Compatibility of My IP

AXI - Custom IP

slide-56
SLIDE 56

ICTP - IAEA

56

Updating Generated Files

AXI - Custom IP

slide-57
SLIDE 57

ICTP - IAEA

57

Checking Parameters and I/O Ports

AXI - Custom IP

(This ends the Works on the edit_ip environment)

slide-58
SLIDE 58

ICTP - IAEA

58

Add My IP to the Repository

AXI - Custom IP

These steps shold be done in the Vivado Environment

slide-59
SLIDE 59

ICTP - IAEA

59

led_ip Now Available in the IP List

AXI - Custom IP

slide-60
SLIDE 60

component.xml

  • IP XACT description

.bd

  • Block Diagram tcl file

drivers

  • SDK and software files (c code)
  • Simple register/memory read/write

functionality

  • Simple SelfTest code

hdl

  • Verilog/VHDL source

xgui

  • GUI tcl file

Creating Custom IP 14- 60

Files created

ICTP - IAEA AXI - Custom IP

slide-61
SLIDE 61
  • Create an AXI Slave/Master IP Core
  • Use the Wizard to generate an AXI

Slave/Master ‘device’

  • Set the number of registers
  • Building the Complete Zynq system
  • Creating a Zynq based System
  • Adding the necessary Ips
  • Adding our custom AXI IP Core
  • Edit Address Space

ICTP - IAEA

61

Steps for Custom IP - Summary

  • Customize the IP Core
  • File structure of the IP Cores
  • Edit the HDL generated by the wizard
  • Updating the IP Core and repack
  • Rebuild the system
  • Programming the device
  • Open SDK. Creating a Application and BSP

project

  • Write the “C” code to Wr/Rd the IP Cores

registers

  • Edit Space

AXI - Custom IP