xillybus_getting_started_zynq

合集下载

可扩展处理平台Zynq的启动过程

可扩展处理平台Zynq的启动过程

可扩展处理平台Zynq的启动过程
本文主要介绍zynq启动过程,主要包括BootROM和FSBL等的执行过程。

硬件启动过程
重新上电或POR复位后进行硬件启动过程
扫描启动引脚设置,并存入只读寄存器slcr.BOOT_MODE中
若使能pll,则等到pll输出时钟;若旁路pll,则直接使用ps_clk时钟
更详细硬件启动过程可以参考下图
BootROMBootROM在POR复位后经过硬件启动后自动运行,也可在非POR复位后直接运行(不经过硬件启动),其内容固化在内部ROM中,不能修改,主要初始化MMU和一些系统资源(以使其满足BootROM执行的要求)以及加载FSBL程序段等。

BootROM 在CPU 0执行,而CPU 1执行WFE指令
主要过程如下:
硬件启动后BootROM将初始化MMU、NAND、NOR、QSPI、SD和PCAP等基本外设判断启动设备(决定于硬件启动过程时扫描的启动模式引脚,即寄存器slcr.BOOT_MODE)并搜索boot镜像头信息,各启动模式搜索范围:
Quad-SPI,头16 MB空间搜索
NAND,头128MB空间搜索
NOR,头32MB
SD卡中只加载一次,不会搜索
BootROM会根据启动模式配置MIO,还会根据读取的boot镜像头信息的寄存器初始化参数部分配置时间优化寄存器
从指定启动设备中加载SFBL到OCM(加载时也会读取头部信息确定加密状态,文件长度等,若加密则还需解密后加载到OCM,BootROM头信息都不会加密),另外还支持直接在QSPI或NOR中执行(从头部信息中文件长度为0时,这时就不用加载到OCM了)。

zynq原理

zynq原理

zynq原理
Zynq是一款由Xilinx开发的可编程逻辑器件(FPGA)和ARM处理器(通常是Cortex-A9)集成在一起的系统级芯片(SoC)。

Zynq芯片结合了可编程逻辑的灵活性和ARM处理器的处理能力,使得它可以用于各种应用领域,包括通信、工业控制、嵌入式视觉等。

Zynq芯片采用了一种称为Programmable System Integration(PSI)的架构,该架构将FPGA和ARM处理器集成在一起,通过高速片内总线(AXI总线)进行通信。

Zynq芯片的主要组成部分是可编程逻辑部分和处理器系统部分。

可编程逻辑部分由Xilinx FPGA实现,可以根据用户的需求进行配置和重构。

处理器系统部分包括ARM Cortex-A9处理器、存储器控制器、高速IO接口等。

ARM Cortex-A9处理器是Zynq芯片的主处理器,它具有高性能和低功耗的特点。

它可以运行各种操作系统,如Linux和RTOS,提供强大的处理能力和丰富的软件支持。

Zynq芯片还包括一些外设接口,如以太网接口、USB接口、SD卡接口等,以便与外部设备进行通信和数据交换。

Zynq芯片的设计和开发可以使用Xilinx提供的开发工具套件,如Vivado 和SDSoC。

这些工具提供了完整的设计流程,包括硬件设计、软件开发和系统集成,使开发人员能够快速、高效地开发基于Zynq的应用系统。

微型嵌入式实时操作系统SmallRTOS在Xilinx(赛灵思)Zynq平台上的移植

微型嵌入式实时操作系统SmallRTOS在Xilinx(赛灵思)Zynq平台上的移植

微型嵌入式实时操作系统SmallRTOS在Xilinx(赛灵思)Zynq平台上的移植微型嵌入式实时操作系统SmallRTOS是一个源代码开放的、易于移植的、面向深度嵌入式应用的微内核实时操作系统,主要应用领域为工业控制,智能传感器开发,智能终端等。

其官方开源网址为:,下面我们逐步演示如何在Zynq平台移植SmallRTOS 实时操作系统。

我们从Vivado导出硬件顶层设计包开始,如下图所示点击菜单File‐>Export‐>Export HardwareVivado会弹出如下对话框,我们不做任何修改,直接点击OK按钮然后通过Vivado启动软件开发套件工具SDK,点击菜单File‐>Launch SDKVivado会弹出如下提示对话框,采用默认设置,直接点击OK按钮。

此时软件开发套件SDK会启动,并提示正在导入硬件顶层设计包,如下图所示:导入完毕,我们在SDK左侧栏可以看到导入的硬件顶层设计包design_1_wrapper_hw_platform_0在此基础上,我们创建板级支持包BSP工程,点击SDK菜单下的File‐>New‐>Board Support PackageSDK弹出如下配置对话框,采用默认命名,默认参数即可,直接点击Finish按钮。

接着弹出如下对话框,选择根据需要选择板级支持包的功能组件,我们选择如下三个组件:lwip,xilffs,xilrsa等点击OK按钮后,弹出如下进度提示框,表示正在生产BSP板级支持包。

生成完毕后,在左侧栏会出现如下所示的两个工程:接着,就可以创建应用程序了。

在SDK的菜单中点击File‐>New‐>Application Project,如下图所示:在SDK的弹出对话框中,填写应用程序的名字,比如SmallRTOSDemo等,板级支持包选择已经创建的工程standalone_bsp_0。

之后点击按钮Next此时会出现示例工程选择对话框,如下所示,可以根据需要自行选择,我们选择Empty Application点击按钮Finish后,应用工程就创建完毕了,不过此时应用工程是空的,还无法使用。

ZYNQ的启动原理和配置

ZYNQ的启动原理和配置

ZYNQ的启动原理和配置启动过程设备配置包含用于初始化和配置ps和pl的所有方法及过程。

在软件控制下,ps内的DevC 提供用于初始化和配置ps和pl的手段和方法,在zynq中提供两个模块用于控制配置过程:BootROM,一个静态存储块器块,当上电复位和暖复位后,有Cortex-A9的CPU执行这个内置程序;设备配置单元:用于控制JTAG调试访问和提供连接到AES、HMAC和PCAP模块的接口,用于实现对芯片内的pl的配置及数据的解密。

在ps的控制下,可以实现安全或非安全的配置所有ps和pl。

通过zynq提供的JTAG接口,用户可以在外部主机的控制下对zynq进行配置,zynq不支持最开始就配置pl的过程。

对zynq的配置过程至少包含两个阶段,但是通常要求3个阶段。

阶段0:该阶段也称为BootROM,该阶段控制初始设备的启动。

BootROM是上电复位或暖复位后,处理器所执行的用户不可修改的代码,该代码已经固化到zynq的BootROM中;阶段1:在该阶段,通常执行第一级启动引导程序。

但是,它也可以是任何用户控制的代码;在该阶段,通常执行用户自己编写的软件程序,但是,也可以是第二级的启动引导程序,该阶段完全是在用户的控制下实现的。

zynq的BootROMBootROM特性:提供3种不同的方法,用于配置PS:两个主模式和一个从模式,即安全、加密的镜像、主模式;非安全的主模式;通过JTAG的非安全从模式;支持4种不同的外部启动源:Quad-SPI Flash、NAND Flash、NOR Flash、SD;支持使用AES-256和HMAC(SHA-256)的PS安全配置;支持Soc调试安全性;从NOR和QSPI芯片内执行配置过程。

Xilinx Vivado zynq7000 入门笔记

Xilinx Vivado zynq7000 入门笔记

Xilinx Vivado zynq7000 入门笔记IP Integrator flow 1. 创建RTL工程2. 创建IP Integrator Block Design3. 添加zynq 处理器ip中搜索zynq,添加zynq7 Processing System,其中的BFM版本为先前的IP处理器版本。

鼠标右键点击FIXED_IO和DDR接口,选择make external,连接到芯片外部。

但此时处理是完全未经过配置的,双击处理器进行配置。

自动添加的外部接口:(参考ug585文档)FIXED_IO, 是专用的内部固化的外设IO,作用?54个MIO口,DDR_VRN,DDR_VRP: DDR DCI voltage reference pins, refer to UG933, Zynq-7000 AP SoC PCB Design and Pin Planning Guide.PS_SRSTB: Debug system reset, active Low. Forces the system to enter a reset sequence.PS_CLK: System reference clock PS_PORB: Power on reset, active lowDDR接口,处理器ddr内存寻址接口; M_AXI_GP0_ACLK,M_AXI_GP0,在PS-PL Configuration中可取消对GP Master AXI Tnterface的选择FCLK_CLK0: PL Pabric Clocks,不使用可在Clock Configuration 中disable。

FCLK_RESET0_N:时钟复位使能,可在General中disable 。

4. 配置processing System,配置处理器内部控制模块的详细功能与特性查看:Soc Technical Reference manual /support/documentation/user_guides/ug585-Zynq-7000-TRM.pdf通用配置:(1)MIO配置:Bank0与Bank1分区的IO对应FPGA处理器可配置的IO,由硬件决定电平还是芯片已经指定电平?由硬件决定。

XILINX_zynq_详解(1)

XILINX_zynq_详解(1)

XILINX_zynq_详解(1)Xinlix的FPGA确实做的是⼜⼤⼜强,接触FPGA有5、6年的时间,从没有详细的了解⼀下FPGA是什么?FPGA可以做什么?FPGA的溯源在哪⾥?FPGA的⼚商有哪些?FPGA的选型该怎么进⾏?FPGA在⼈⼯智能上会有什么发展前景?FPGA该如何学习?FPGA的着⼒点该在什么地⽅? 接着新开园的新鲜劲,做⼀下总结,因为涉及内容较多,为了能浅显易懂的介绍好各个问题,有必要也必须拉出⼀条主线来。

稍微⾛个神,为什么写博客?很多⼈在写,我个⼈意见,写博客不是⽬的,⽬的是能够将知识系统的总结⼀下。

在⽹络上泛泛的看来的东西,太杂太不系统,如果不整理⼀下、消化⼀下,可能还是没有⼀点进步,所以要写出来,总结下来。

好,来拉⼀条主线?什么是FPGA【定义】→FPGA的⼚家有哪些【选型】→FPGA是什么、FPGA可以做什么【应⽤】—————————————我是分隔符———————————————————————————①什么是FPGA? FPGA-Field Programmable Gate Array,现场可编程门阵列,它是在其他可编程器件,如PAL\GAL\CPLD的基础上进⼀步发展的产物,也是为ASIC(专⽤集成电路)领域中的⼀种半定制电路⽽出现的,克服了原有可编程器件门电路书有限的缺点,FPGA⼀般来说⽐ASIC(专⽤集成电路)的速度要慢,实现同样的功能⽐ASIC电路⾯积要⼤。

但是他们也有很多的优点⽐如可以快速成品,可以被修改来改正程序中的错误和更便宜的造价。

⼚商也可能会提供便宜的但是编辑能⼒差的FPGA。

因为这些有⽐较差的可编辑能⼒,所以这些设计的开发是在普通的FPGA上完成的,然后将设计转移到⼀个类似于ASIC的芯⽚上。

另外⼀种⽅法是⽤CPLD(Complex Programmable Logic Device,复杂可编程逻辑器件)。

【摘⾃度娘】 看来很成功的产物,发展壮⼤的过程不可避免的会经历艰难困苦,FPGA也不例外,1985年的冬天,全球⾸款FPGA产品⽐我早2年出⽣了,起名:XC2064,诞⽣宣⾔:未来⼗年内每⼀个电⼦设备都将有⼀个可编程逻辑芯⽚!当时呱呱落地的它可能想不到,今天的它确实实现了这个理想。

AC7Z100核心板用户手册说明书

AC7Z100核心板用户手册说明书

ZYNQ7000开发平台用户手册AC7Z100核心板2 / 31芯驿电子科技(上海)有限公司文档版本控制目录文档版本控制 (2)(一)简介 (4)(二)ZYNQ芯片 (5)(三)DDR3 DRAM (8)(四)QSPI Flash (14)(五)eMMC Flash (15)(六)时钟配置 (16)(七)LED灯 (19)(八)复位电路 (20)(九)电源 (20)(十)结构图 (23)(十一)连接器管脚定义 (23)3 / 314 / 31芯驿电子科技(上海)有限公司(一) 简介AC7Z100(核心板型号,下同)核心板,ZYNQ 芯片是基于XILINX 公司的ZYNQ7000系列的XC7Z100-2FFG900。

ZYNQ 芯片的PS 系统集成了两个ARM Cortex™-A9处理器,AMBA®互连,内部存储器,外部存储器接口和外设。

ZYNQ 芯片的FPGA 内部含有丰富的可编程逻辑单元,DSP 和内部RAM 。

这款核心板使用了4片Micron 的512MB 的DDR3芯片MT41J256M16HA-125,总的容量达4GB 。

其中PS 和PL 端各挂载两片,分别组成32bit 的总线宽度。

PS 端的DDR3 SDRAM 的最高运行速度可达533MHz(数据速率1066Mbps),PL 端的DDR3 SDRAM 的最高运行速度可达800MHz(数据速率1600Mbps)。

另外核心板上也集成了2片256MBit 大小的QSPI FLASH 和8GB 大小的eMMC FLASH 芯片,用于启动存储配置和系统文件。

为了和底板连接,这款核心板的4个板对板连接器扩展出了PS 端的USB 接口,千兆以太网接口,SD 卡接口及其它剩余的MIO 口;也扩展出了ZYNQ 的16对高速收发器GTX 接口;以及PL 端的几乎所有IO 口(114个3.3V IO 和48个1.8V IO ),其中BANK10和BANK11的IO 的电平可以通过更换核心板上的LDO 芯片来修改,满足用户不用电平接口的要求。

Zynq启动流程

Zynq启动流程

Zynq启动流程前⾔Zynq启动流程和ARM处理器类似,PS部分是启动和配置过程的主设备,芯⽚引导必须由处理器驱动,系统上电复位后会读取设备模式引脚来决定从什么设备启动芯⽚。

如下表Boot Devices条⽬所⽰,其中黄⾊代表该条⽬下的默认设置,⽐如Boot Devices默认设置是SD Card,默认从SD卡启动芯⽚下图中的JP7-JP11的5个条线帽就是⽤于设置设备模式引脚电平的启动步骤PS确定好从什么设备启动后,接着的启动过程分为以下三个阶段0. Stage-0 执⾏BootROM代码,不可修改1. Stage-1 执⾏FSBL(first boot loader)代码,⽤户可修改。

如果是裸机程序也可以不需要这个阶段直接跳到下⼀阶段。

2. Stage-2 执⾏⽤户裸机程序或者操作系统的启动引导程序SSBL(second boot loader)关于BootROM:位于Zynq⽚内,功能是初始化L1 cache和基本的总线系统,以及从指定的外部存储器加载Stage-1的FSBL代码到⽚内存储器(OCM)。

但是要使Stage-0之后的代码被Stage-0的BootROM识别,还需要为Stage-0之后的代码(可能是Stage-1的FSBL,也可能是Stage-2的裸机程序,因为没有调⽤BSP函数的裸机程序是可以不需要FSBL的)添加⼀个头部,制作成引导镜像。

可以使⽤SDK的BootGen⼯具为裸机程序elf⽂件创建引导镜像Boot.bin,将其复制到SD卡中,并且设置板⼦从SD卡启动就可以执⾏程序。

使⽤SDK⼯具创建SD卡启动镜像BOOT.BIN= f(FSBL.elf+PL.bit+PS.elf)PL.b it和PS.e lf采⽤中⽣成的PL.bit和PS.elf。

制作F SB L.e lf 新建Zynq FSBL⼯程等待⼯程建⽴完毕,FSBL.elf就在⼯程⽂件夹的Debug⽂件夹下制作B OOT.B I N使⽤SDK的Create Boot Image选择好output路径放置⽣成的BOOT.BIN和output.bif。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Getting started with Xillinux for Zynq-7000EPP v1.3Xillybus Ltd.Version3.11Introduction41.1The Xillinux distribution (4)1.2The Xillybus IP core (5)2Prerequisites72.1Hardware (7)2.2Downloading the distribution (8)2.3Development software (9)2.4Experience with FPGA design (9)3Building Xillinux103.1Overview (10)3.2Unzipping the boot partition kit (11)3.3Generating the processor netlist (12)3.4Generating Xilinx IP cores (13)3.5Generating the bitstreamfile (14)3.5.1Using ISE (14)3.5.2Using Vivado (16)3.6Loading the(Micro)SD with the image (18)Xillybus 3.6.1General (18)3.6.2Loading the image(Windows) (19)3.6.3Loading the image(Linux) (20)3.6.4Using the Zynq board for loading the image (21)3.7Copying thefiles into the boot partition (22)3.8Thefiles in the boot partition (23)4Booting up244.1Jumper settings (24)4.1.1Zedboard (24)4.1.2MicroZed (26)4.1.3Zybo (26)4.2Attaching peripherals (26)4.3Powering up the board (27)4.3.1Initial diagnostics (27)4.3.2When boot completes (28)4.3.3U-boot environment variables (29)4.3.4Setting a custom Ethernet MAC address (31)4.3.5Sample boot transcript (31)4.4T o do soon after thefirst boot (33)4.4.1Resize thefile system (33)4.4.2Allow remote SSH access (36)4.4.3Compiling locale definitions (37)4.5Using the desktop (38)4.6Shutting down/rebooting (38)4.7T aking it from here (39)5Making modifications405.1Integration with custom logic (40)5.2Using other boards (41)Getting started with Xillinux for Zynq-7000EPP v1.32Xillybus 5.3Changing the system’s clock frequencies (42)5.4T aking over GPIO I/O pins for PL logic (43)6Linux notes466.1General (46)6.2Compiling the Linux kernel (46)6.3Compiling kernel modules (47)6.4Sound support (48)6.4.1General (48)6.4.2Usage details (48)6.4.3Related boot scripts (49)6.4.4Accessing/dev/xillybus audio directly (49)6.4.5Pulseaudio details (50)6.5The OLED utility(Zedboard only) (50)7Troubleshooting527.1Implementation errors (52)7.2Problems with USB keyboard and mouse (53)7.3File system mount issues (53)7.4“startx”fails(Graphical desktop won’t start) (54)Getting started with Xillinux for Zynq-7000EPP v1.33Xillybus 1 Introduction1.1The Xillinux distributionXillinux is a complete,graphical,Ubuntu12.04LTS-based Linux distribution for theZynq-7000EPP device,intended as a platform for rapid development of mixed soft-ware/logic projects.The currently supported boards are Zedboard,MicroZed andZybo.Like any Linux distribution,Xillinux is a collection of software which supports roughlythe same capabilities as a personal desktop computer running Linux.Unlike commonLinux distributions,Xillinux also includes some of the hardware logic,in particular theVGA adapter.With Zedboard and Zybo,the distribution is organized for a classic keyboard,mouseand monitor setting.It also allows command-line control from the USB UART port,butthis feature is made available mostly for solving problems.When used with MicroZed,which lacks a VGA/DVI output,only the USB UART func-tions as a console.Xillinux is also a kickstart development platform for integration between the device’sFPGA logic fabric and plain user space applications running on the ARM processors.With its included Xillybus IP core and driver,no more than basic programming skillsand logic design capabilities are needed to complete the design of an applicationwhere FPGA logic and Linux-based software work together.The bundled Xillybus IP cores eliminate the need to deal with the low-level internalsof kernel programming and interface with the processor,by presenting a simple andyet efficient working environment to the application designers.Getting started with Xillinux for Zynq-7000EPP v1.34Xillybus 1.2The Xillybus IP coreXillybus is a straightforward,portable,intuitive,efficient DMA-based end-to-end turnkeysolution for data transport between an FPGA and a host running Linux or MicrosoftWindows.It’s available for personal computers and embedded systems using the PCIdard FIFOs.For example,writing data to the lower FIFO in the diagram makes the Xillybus IP coresense that data is available for transmission in the FIFO’s other end.Soon,the Xillybusreads the data from the FIFO and sends it to the host,making it readable by theuserspace software.The data transport mechanism is transparent to the applicationlogic in the FPGA,which merely interacts with the FIFO.On its other side,the Xillybus IP core implements the dataflow utilizing the AXI bus,generating DMA requests on the processor core’s bus.The application on the computer interacts with devicefiles that behave like namedpipes.The Xillybus IP core and driver stream data efficiently and intuitively betweenthe FIFOs in the FPGAs and their respective devicefiles on the host.The IP core is built instantly per customer’s spec,using an online web interface.It’srecommended to build and download your custom IP core at /custom-ip-factory after walking through the demo bundleflow described in this guide.The number of streams,their direction and other attributes are defined by customerto achieve an optimal balance between bandwidth performance,synchronization,and Getting started with Xillinux for Zynq-7000EPP v1.35Xillybus design simplicity.This guide explains how to rapidly set up the Xillinux distribution including a demoXillybus IP core,which can be attached to user-supplied sources or sinks for realapplication scenario testing.The IP core is“demo”in the sense it’s not tailored to anyspecific application.Nevertheless,the demo core allows creating a fully functional link with the host.Replacing the demo IP core with one tailored for special applications is a quick pro-cess,and requires the replacement of one binaryfile and the instantiation of onesingle module.More information about using the Xillybus IP core can be found in these documents:•Getting started with Xillybus on a Linux host•Xillybus host application programming guide for Linux•The guide to defining a custom Xillybus IP coreGetting started with Xillinux for Zynq-7000EPP v1.36Xillybus 2 Prerequisites2.1HardwareThe Xillybus for Zynq Linux distribution(Xillinux)currently supports the Zedboard,MicroZed and Zybo boards.Owners of other boards may run the distribution on their own hardware,but certainchanges,some of which may be nontrivial,may be necessary.More about this insection5.2.In order to use the board(MicroZed excluded)as a desktop computer with a monitor,keyboard and mouse,the following items are required:•A monitor capable of displaying VESA-compliant1024x768@60Hz with ananalog VGA input(i.e.virtually any PC monitor).•An analog VGA cable for the monitor•A USB keyboard•A USB mouse•A USB hub recognized by Linux3.12.0,if the keyboard and mouse are notcombined in a single USB plugWhen Zybo is used,the monitor can be connected to the HDMI port,which outputsthe same monitor image in DVI format.Most monitors having an HDMI input willdisplay the image correctly when connected with a plain HDMI cable to the board.Alternatively,a passive HDMI/DVI adapter or cable can be used to connect to virtuallyany monitor’s DVI input for correct operation.Getting started with Xillinux for Zynq-7000EPP v1.37Xillybus Zedboard’s HDMI output port is not supported.A wireless keyboard/mouse combo is recommended,since it eliminates the need fora USB hub,and prevents possible physical damage to the USB port on the board,asa result of accidentally pulling the USB cables.On the Zedboard,the connection of the keyboard and mouse is done through a Mi-cro B to T ype A female USB cable,which arrives with the board.On the other twoboards,a standard USB type A female connector(like a PC’s USB plug)is availablefor connection of peripherals.Also required:•A reliable SD card(for Zedboard)or MicroSD(for MicroZed/Zybo)with2GB ormore,preferably Sandisk.The card that(possibly)came with the board is notrecommended,as problems have been reported using it with Xillinux.•Recommended:A USB adapter between an(Micro)SD card and PC,for writingthe image and bootfile to the card.This may be unnecessary if the PC computerhas a built-in slot for SD cards.The Zynq board itself can also be used as aflashwriter,but this is somewhat trickier.2.2Downloading the distributionThe Xillinux distribution is available for download at Xillybus site’s download page:/xillinux/The distribution consists of two parts:A raw image of the(Micro)SD card consistingof thefile system to be seen by Linux at bootup,and a set offiles for implementationwith the Xilinx tools to populate the boot partition.More about this is section3.The distribution includes a demo of the Xillybus IP core for easy communication be-tween the processor and logic fabric.The specific configuration of this demo bundlemay perform relatively poorly on certain applications,as it’s intended for simple tests.Custom IP cores can be configured,automatically built and downloaded using the IPCore Factory web interface.Please visit /custom-ip-factory for usingthis tool.The material available for download at the site assumes the use of Xilinx’ISE suite.An experimental kit for Vivado is available per request.Any downloaded bundle,including the Xillybus IP core,and the Xillinux distribution,is free for use,as long as this use reasonably matches the term“evaluation”.This Getting started with Xillinux for Zynq-7000EPP v1.38Xillybus includes incorporating the core in end-user designs,running real-life data andfieldtesting.There is no limitation on how the core is used,as long as the sole purpose ofthis use is to evaluate its capabilities andfitness for a certain application.2.3Development softwareThe recommended tool for compiling the logic fabric parts of the Xillinux distribution isXilinx ISE Design Suite ter releases should work properly as well.An experimental bundle supporting Vivado2014.1is also available per request.This software can be downloaded directly from Xilinx’website().Any of the design suite’s editions is suitable,including•the WebP ACK Edition,which can be downloaded and used with no license feefor an unlimited time,assuming that the target device is covered.XC7Z020andXC7Z010,which are used on the Zedboard,MicroZed and Zybo,are covered bythis edition.•the Logic Edition(or Design Edition for Vivado),which requires a purchasedlicense(but a30-day trial is available).•any target-locked edition that may have been licensed specifically along with apurchased board.•the DSP and Embedded Editions arefine as well,but have a higher license fee.All of these editions cover the Xilinx-supplied IP cores necessary to implement Xillybusfor Zynq,with no extra licensing required.2.4Experience with FPGA designWhen targeting Zedboard,MicroZed or Zybo,no previous experience with FPGA de-sign is necessary to have the distribution running on the platform.T argeting anotherboard requires some knowledge with using Xilinx’tools,and possibly some basic ca-pabilities related to the Linux kernel.T o make the most of the distribution,a good understanding of logic design techniques,as well as mastering an HDL language(Verilog or VHDL)are necessary.Neverthe-less,the Xillybus distribution is a good starting point for learning these,as it presentsa simple starter design to experiment with.Getting started with Xillinux for Zynq-7000EPP v1.39Xillybus 3 Building Xillinux3.1OverviewThe Xillinux distribution is intended as a development platform,and not just a demo:Aready-for-use environment for custom logic development and integration is built duringits preparation for running on hardware.This makes the preparation for thefirst testrun somewhat timely(typically30minutes,most of which consist of waiting for Xilinx’tools)but significantly shortens the cycle for integrating custom logic.T o boot the Xillinux distribution from an(Micro)SD card,it must have two components:•A FA T32filesystem in a boot partition,consisting of boot loaders,a configurationbitstream for FPGA part(known as PL),and the binaries for booting the Linuxkernel.•An ext4rootfile system mounted by Linux.The downloaded raw Xillinux image has almost everything set up already.There arejust threefiles missing in the boot partition,one of which needs to be generated withXilinx’tools,and two that are copied from the boot partition kit.The various operations for preparing the(Micro)SD are detailed step by step in thissection.Thisflow consists of the following steps,which must be done in the order outlinedbelow.Note that two of the steps listed below are skipped when using Vivado.•Unzipping the boot partition kit•ISE suite only:Generating the processor netlistGetting started with Xillinux for Zynq-7000EPP v1.310Xillybus •ISE suite only:Generating Xilinx’IP cores•Implementing the main PL(FPGA)project•Writing the raw Xillinux image to the(Micro)SD card•Copying threefiles into the(Micro)SD card’s boot partitionHow to target other boards is discussed in paragraph5.2.3.2Unzipping the boot partition kitUnzip the previously downloaded xillinux-eval-board-XXX.zipfile into a working direc-tory.The bundle consists of the following directories:•verilog–Contains the projectfile for the main logic and some sources in Verilog(in the’src’subdirectory)•vhdl–Contains the projectfile for the main logic and some sources,with theuser-editable sourcefile in VHDL(in the’src’subdirectory)•cores–Precompiled binaries of the Xillybus IP cores•system–Directory for generating processor-related logic•runonce–Directory for generating general-purpose logic(CoreGen FIFO IPcores).•bootfiles–Contains two board-specificfiles,to be copied to the boot partition.•vivado-essentials–Definitionfiles and build directories for processor-relatedand general-purpose logic for use by Vivado(only in bundles supporting Vivado).Note that both’src’directories also contain the UCFfile for the targeted board.Thisfile must be edited if a board,which isn’t among the three supported,is targeted.Also note that the vhdl directory contains Verilogfiles,but none of them should needediting by user.Getting started with Xillinux for Zynq-7000EPP v1.311Xillybus The interface with the Xillybus IP core takes place in the xillydemo.v or xillydemo.vhdfiles in the respective’src’subdirectories.This is thefile to edit in order to try Xillybuswith your own data sources and sinks.3.3Generating the processor netlistThis part is relevant only when using the ISE suite.The Vivadoflow starts in paragraph3.5.2.Within the boot partition kit,double-click the system.xmpfile in the“system”directory.This opens the Xilinx Platform Studio(XPS).Click“Generate Netlist”to the left(as shown in the image below).The process takes up to10minutes,depending on the computer running it.Sev-eral warnings are generated,but no errors should be tolerated(which is unlikely tohappen).The console output says“XST completed”and“Done!”upon a successful completionof the process.At this point,close the XPS completely.Getting started with Xillinux for Zynq-7000EPP v1.312Xillybus There is no need to repeat this process in the future.It’s possible that a Xilinx License Error dialog box followed by a Xilinx License Configu-ration Manager window will appear upon invocation of XPS.These should be ignored(with“OK”and“Close”,respectively),since a license for XPS targeting certain Zynqdevices is actually included in the WebPack license group.Some versions of XPSissue an error despite this.If licensing errors continue to appear,preventing the generation of a netlist,make surea WebPack(or broader)license is installed on the machine.3.4Generating Xilinx IP coresThis part is relevant only when using the ISE suite.The Vivadoflow starts in paragraph3.5.2.Within the boot partition kit,double-click the runonce.xisefile in the“runonce”direc-tory.This opens the Xilinx’ISE Project Navigator.On the opened window’s top left,click onfifo32x512,then expand the“CORE Gen-erator”line in the process window below(clicking on the“+”),andfinally,double click“Regenerate Core”,as shown in the image below.Getting started with Xillinux for Zynq-7000EPP v1.313Xillybus The process produces a handful of warnings,but no errors,and ends with a messagesaying:Process“Regenerate Core”completed successfully.Repeat this for the two other IP cores:fifo8x2048and vgafifo.At this point,close the ISE Project Navigator completely.There is no need to everrepeat this process.3.5Generating the bitstreamfile3.5.1Using ISEGetting started with Xillinux for Zynq-7000EPP v1.314Xillybus Depending on your preference,double-click the’xillydemo.xise’file in either the’ver-ilog’or’vhdl’subdirectory.Both directories are in the boot partition kit.In the absenceof preference,pick the’verilog’subdirectory.The Project Navigator will launch and open the project with the correct settings.Justclick“Generate Programming File”.The procedure will produce several warnings(FPGA implementations always do)butshould not present any errors.The process should end with the output“ProcessGenerate Programming File completed successfully”.The result can be found as xil-lydemo.bit in the’verilog’or’vhdl’directory(whatever was chosen)along with severalotherfiles.If an error occurs,please check that the steps of paragraphs3.3and3.4were carriedout fully,in particular that the latter was carried out for all three IP cores.Most notably,if the bottom line at the console is“Process T ranslate failed”,with a previous errormessage complaining about not being able to resolve some logical block,the propercompletion of the the two previous steps should be verified.Close the ISE Project Navigator completely when this task is completed successfully. Getting started with Xillinux for Zynq-7000EPP v1.315Xillybus 3.5.2Using VivadoVivado’s outline of intermediatefiles is relatively complex and difficult to control.Inorder to keep thefile structure in the bundle compact,a script in Tcl is supplied forcreating the Vivado project.This script creates a new subdirectory,“vivado”,andpopulates this directory withfiles as necessary.The project relies on thefiles in the src/subdirectory(no copies of thesefiles aremade).The processor,its interconnect and peripherals,as well as the FIFOs used bythe logic are defined in vivado-essentials/,which is also populated with intermediatefiles by Vivado as the project is implemented.As with the ISE bundle,the project can be implemented based upon Verilog or VHDL.If VHDL is chosen,vhdl/src/xillydemo.vhd must be edited to remove the followingthree lines in the beginning(Xillydemo’s entity port list):PS_CLK:IN std_logic;PS_PORB:IN std_logic;PS_SRSTB:IN std_logic;also,uncomment the following lines in the architecture definition(remove the“--”comment marks):--signal PS_CLK:std_logic;--signal PS_PORB:std_logic;--signal PS_SRSTB:std_logic;There is no need to make changes in any Verilog sourcefile.Start Vivado2014.1.With no project open,Pick T ools>Run Tcl Script...and choosexillydemo-vivado.tcl in the verilog/or vhdl/subdirectory,depending on your prefer-ence.A sequence of events takes place for less than a minute.The success of theproject’s deployment can be verified by choosing the“Tcl Console”tab at Vivado’swindow’s bottom,and verify that it saysINFO:Project created:xillydemoGetting started with Xillinux for Zynq-7000EPP v1.316Xillybus If this is not the bottom line of the Tcl console,something went wrong,most likelybecause the wrong revision of Vivado is used.Critical warnings will appear during this stage,but no errors.However if the projecthas already been generated(i.e.the script has been run already),attempting to runthe script again will result in the following error:ERROR:[Common17-53]User Exception:Project already exists on disk,please use’-force’option to overwrite:After the project has been created,run an implementation:Click“Generate Bitstream”on the Flow Navigator bar to the left.A popup window asking if it’s OK to launch synthesis and implementation is likely toappear–pick“Y es”.Vivado runs a sequence of processes.This takes normally takes a few minutes.Several warnings are issued,none of which are classified critical(but some criticalwarning may still remain in the logs from the execution of the Tcl script).A popup window,informing that the bitstream generation was completed successfullywill appear,giving choices of what to do next.Any option isfine,including picking“Cancel”.The bitstreamfile,xillydemo.bit,can be found at vivado/xillydemo.runs/impl1/The implementation is never expected to fail.There are however a few error conditionsworth mentioning:•The Placer fails on“IO placement is infeasible”on a VHDL design.If this hap-pens on an VHDL implementation,please make sure that xillydemo.vhd wasedited as required above.Getting started with Xillinux for Zynq-7000EPP v1.317Xillybus •write bitstream fails with DRC errors complaining about PS CLK,PS PORB andPS SRSTB being unspecified,unrouted and unconstrained,then again–pleasemake sure that xillydemo.vhd was edited as required above.•Error saying“Timing constraints weren’t met”.This can happen when customlogic has been integrated,causing the tools to fail meeting the timing require-ments.This means that the design is syntactically correct,but needs correctionsto make certain paths fast enough with respect to given clock rates and/or I/Orequirements.The process of correcting the design for better timing is oftenreferred to as timing closure.A timing constraint failure is commonly announced as a critical warning,allow-ing the user to produce a bitstreamfile with which the FPGA’s behavior is notguaranteed.T o prevent the generation of such a bitstream,a timing failure is pro-moted to the level of an error by virtue of a small Tcl script,“showstopper.tcl”,which is automatically executed at the end of a route run.T o turn this safetymeasure off,click“Project Settings”under“Project Manager”in the Flow Navi-gator.Choose the“Implementation”button,and scroll down to the settings for“route design”.Then remove showstopper.tcl from tcl.post.•Any other error is most likely a result of changes made by the user,and shouldbe handled per case.3.6Loading the(Micro)SD with the image3.6.1GeneralThe purpose of this task is to write the downloaded(Micro)SD card imagefile to the(micro)SD device.The image was downloaded as afile named xillinux.img.gz(orsimilar),and is a gzip-compressed image of the(Micro)SD card,which is ready forbooting,except for threefiles,which are added later.This image should be uncompressed and then written to the(Micro)SD card’sfirstsector and on.There are several ways and tools to accomplish this.A few methodsare suggested next.The image contains a partition table,a partly populated FA Tfile system for placinginitial bootfiles,and the Linux rootfile system of ext4type.The second partition isignored by almost all Windows computers,so the(Micro)SD card may appear to bevery small in capacity(16MB or so).Writing a full disk image is not an operation intended for plain computer users,and Getting started with Xillinux for Zynq-7000EPP v1.318Xillybus therefore requires special software on Windows computers and extra care on Linux.The following paragraphs explain how to do this on either operating system.If there’s no USB adapter for the(Micro)SD card(or a dedicated slot on a computer),the board itself can be used to write the image,as described in paragraph3.6.4.3.6.2Loading the image(Windows)On Windows,a special application is needed to copy the image,such as the USBImage T ool.This tool is suitable when a USB adapter is used to access the(Micro)SDcard.Some computers(laptops in particular)have an(Micro)SD slot built in,and may needto use another tool,e.g.Win32Disk Imager.This may also be the case when runningWindows7.Both tools are available free for downloading from various sites on the web.Thefollowing walkthrough assumes using the USB Image T ool.For a Graphical interface,run“USB Image T ool.exe”.When the main window showsup,plug in the USB adapter,select the device icon which appears at the top left.Makesure that you’re in“Device Mode”(as opposed to“Volume Mode”)on the top left dropdown menu.Click Restore and set thefile type to“Compressed(gzip)imagefiles”.Select the downloaded imagefile(xillinux.img.gz).The whole process should takeabout4-5minutes.Whenfinished,unmount the device(”safely remove hardware”)and unplug it.On some machines,the GUI will fail to run with an error saying the software initial-ization failed.In that case,the command line alternative can be used,or a Microsoft.NET framework component needs to be installed.Alternatively,this can be done from the command line(which is a quick alternative ifthe attempt to run GUI fails).This is done in two stages.First,obtain the device’snumber.On a DOS Window,change directory to where the application was unzippedto and go(typical session follows):C:\usbimage>usbitcmd lGetting started with Xillinux for Zynq-7000EPP v1.319Xillybus USB Image Tool 1.57COPYRIGHT2006-2010Alexander Beughttp://www.alexpage.deDevice|Friendly Name|Volume Name|Volume Path|Size------------------------------------------------------------------------------2448|USB Mass Storage Device||E:\|2014MB(That was the letter“l”as in“list”after”usbitcmd”,not thefigure“one”)Now,when we have the device number,we can actually do the writing(”restore”):C:\usbimage>usbitcmd r2448\path\to\xillinux.img.gz/d/gUSB Image Tool 1.57COPYRIGHT2006-2010Alexander Beughttp://www.alexpage.deRestoring backup to"USB Mass Storage Device USB Device"(E:\)...okAgain,this should take about4-5minutes.And of course,change the number2448to whatever device number you got in thefirst stage,and replace\path\to with thepath to where the(Micro)SD card’s image is stored on your computer.3.6.3Loading the image(Linux)As just mentioned,it’s important to detect the correct device as the(Micro)SD card.This is best done by plugging in the USB connector,and looking for something likethis is the main logfile(/var/log/messages or/var/log/syslog):Sep510:30:59kernel:sd1:0:0:0:[sdc]7813120512-byte logical blocks Getting started with Xillinux for Zynq-7000EPP v1.320Xillybus Sep510:30:59kernel:sd1:0:0:0:[sdc]Write Protect is offSep510:30:59kernel:sd1:0:0:0:[sdc]Assuming drive cache:write throughSep510:30:59kernel:sd1:0:0:0:[sdc]Assuming drive cache:write throughSep510:30:59kernel:sdc:sdc1Sep510:30:59kernel:sd1:0:0:0:[sdc]Assuming drive cache:write throughSep510:30:59kernel:sd1:0:0:0:[sdc]Attached SCSI removable diskSep510:31:00kernel:sd1:0:0:0:Attached scsi generic sg0type0The output may vary slightly,but the point here is to see what name the kernel gavethe new disk.“sdc”in the example above.Uncompress the imagefile:#gunzip xillinux.img.gzCopying the image to the(Micro)SD card is simply:#dd if=xillinux.img of=/dev/sdc bs=512Y ou should point at the disk you found to be theflash drive,of course.And verify#cmp xillinux.img/dev/sdccmp:EOF on xillinux.imgNote the response:The fact that EOF was reached on the imagefile means thateverything else compared correctly,and that theflash has more space than actuallyused.If cmp says nothing(which would normally be considered good)it actuallymeans something is wrong.Most likely,a regularfile“/dev/sdc”was generated ratherthan writing to the device.3.6.4Using the Zynq board for loading the imageParagraph3.6.3above described how to load the image with a Linux machine and aUSB adapter.The Zynq board itself can be used,running the sample Linux systemGetting started with Xillinux for Zynq-7000EPP v1.321。

相关文档
最新文档