XilinxFPGA的PROM配置
- 格式:doc
- 大小:370.00 KB
- 文档页数:16
Xilinx-FPGA配置的一些细节Xilinx FPGA配置的一些细节2010年07月03日星期六 14:260 参考资料(1) Xilinx: Development System Reference Guide. dev.pdf, v10.1在Xilinx的doc目录下有。
(2) Xilinx: Virtex FPGA Series Configuration and Readback. XAPP138 (v2.8) March 11, 2005在Xilinx网站上有,链接/bvdocs/appnotes/xap p138.pdf(3)Xilinx: Using a Microprocessor to Configure Xilinx FPGAs via Slave Serial or SelectMAP Mode.XAPP502 (v1.5) December 3, 2007在Xilinx网站上有,链接/bvdocs/appnotes/xap p502.pdf注:此外xapp139和xapp151也是和配置相关的。
(4)Xilinx: Virtex-4 Configuration Guide. UG071 (v1.5) January 12, 2007(5) Tell me about the .BIT file format.链接:/FAQ_Pages/0026_Tell_me_about_bit_files.htm1 Xilinx配置过程主要讲一下Startup Sequence。
Startup Sequence由8个状态组成.除了7是固定的之外,其它几个的顺序是用户可设置的,而且Wait for DCM和DCI是可选的。
其中默认顺序如下:这些在ISE生成bit文件时通过属性页设定。
这几个状态的具体含义如下:Release_DONE : DONE信号变高GWE : 使能CLB和IOB,FPGA的RAMs和FFs可以改变状态GTS : 激活用户IO,之前都是高阻。
Xilinx spartan3e FPGA掉电配置及应用程序引导Xilinx公司的spartan3e开发板上面有丰富的外围器件,就存储器来说有一个16M并行flash,一个4Mbits串行flash,还又一个64M的DDR,在嵌入式开发中,一般我们可能会在FPGA中嵌入cpu软核,让C语言程序在里面运行。
这就涉及到FPGA配置文件的引导,如果C语言程序太大,需要在DDR里面运行的话也涉及到应用程序的引导的问题。
我刚接触到xinlinx的spartan3e开发板时,只会将FPGA配置文件(.bit)直接通过JTAG口下载到芯片里。
后来编写的程序大了,如果将程序直接放到内部的RAM里面就装不下了,这时就只有将程序放到DDR里面运行,如果仅仅是调试应用程序不需要重启开发板后程序也可以运行,那么可以直接用EDK里面的XDM工具通过dow命令直接下载到DDR里面,然后就可以执行了。
但是但我们的应用程序和硬件配置调试通过,达到了我们的要求以后我们就想到可不可以将让程序在板子上电时就可以自动运行呢。
因为FPGA是掉电要丢失的,重新上电就必须重新配置。
我们通过查找相关资料,找到了解决烧写问题的解决办法。
首先是配置文件的烧写。
spartan3e提供了3个掉电不丢失的外部存储器,就是上面提到的并行flash,串行flash和Flash PROM。
配置文件都可以烧写到其中任何一个储存器里面。
但是,在我看来,一般的配置问件都是烧写到Flash PROM里面。
烧写方法有很多,可以用Xilinx公司的专门的烧写.mcs文件的工程烧写,也可以用iMPACT烧写。
一般用iMPACT工具烧写,烧写过程如下:打开iMPACT,弹出新建工程时选择Cancle,然后双击窗口左边的PROM File Formater如下图:弹出的窗口中选择Xilinx PROM文件格式选择mcs,PROM File name为:test.mcs,选择好保存路径点击下一步如下图:上步中点击Next,Select a PROM(bits)选择xcf->xcf04s,点击Add,然后点下一步如下图:上图中点击Next后出现窗口中点击filinsh,弹出消息框点OK,会有一个选择bit问件的窗口,选择一个已经编写好的EDK或者ISE工程生成的.bit文件,OK后提示是否加入其他器件,选择NO,然后双击窗口右边的Generate File,生成.mcs文件如下图所示:然后,双击Boundary Scan,在中间空白处,点击鼠标右键,选择Initialize chain,弹出的第一个窗口中选择Bypass,第二个选择刚才生成的.mcs文件,第三个也选择Bypass,然后选中中间那个模块,点击窗口左下角的program如下图:弹出窗口中选中OK就可以了,烧写完后会看到,Program Successful 提示。
Step by step 学习下载配置Xilinx之FPGA配合Mars-XC2S50-Core FPGA核心板,用图文方式向大家详细讲述如何下载配置Xilinx的FPGA。
FPGA下载模式说明S1为FPGA下载模式选择跳线,断开配置FPGA为JTAG模式,短接则FPGA配置方式为Master Serial Mode下面我们利用Spartan2核心板介绍一下通过JTAG菊花链方式下载FPGA和烧录PROM.硬件跳线选择1. 跳线S1: 此时要求M0 M1 M2 = 100, 断开即可设置FPGA的下载方式为Boundary-scan mode。
2. 将Xilinx下载线和核心板上JTAG mode接口J2相连,连接到计算机并口。
3. 目标板上电。
软件操作一、产生PROM配置文件在烧写PROM之前,需要将ISE生成的*.bit文件转换成prom格式的文件才能下载Xilinx 专用的配置PROM中。
1. 启动iMPACT2. 出现下面画面选择Prepare Configuration Files,点击下一步。
3.出现如下界面,选择PROM File,点击下一步。
4.界面如下,选择PROM类型,和文件格式,填写生成文件名称路径,下一步5.指定使用的PROM类型,并添加,下一步。
6.下一步7点击Add File按钮。
8.选上需要转换的*.bit文件打开。
9.出现如下对话框,提示要不要添加另外的.bit文件。
选择否10界面如下,点击完成11.出现要不要现在生成配置文件,选择是,至此,PROM的文件已经生成。
12.OK.二.菊花链方式下载配置FPGA和PROM 1.打开iMPACT配置2.出现如下界面,选择Configure Device, 下一步。
3.选择Boundary-Scan Mode,下一步。
4.选自动监测扫描链,完成。
5.出现如下界面,检测到两个器件:xc2s50和xcf01s,并提示是否为每个器件添加配置文件。
复位和上电复位1 在上电时,这器件要求VCCINT在精确的上升时间内,单调的上升到标准工作电压值。
2 如果电压没满足要求,这器件就不能执行合适的上电复位。
3 上电运行的顺序:先PROM的OE/RESET保持低电平,在配置开始以前要求电源能达到它们各自的POR(上电复位电压)门限,OE/RESET被定时释放后对稳定电源的应用有更多的余地。
4 在系统利用慢上升电源时,另外增加一个电源监控电路能被用做延时配置直到系统电源达到最小的操作电源在OE/RESET一直为低电平。
5 当OE/RESET被释放,INIT就被上拉为高电平,允许FPGA有次序的配置。
6 如果电压低于POR门限时,PROM复位,OE/RESET再为低,直到达到POR 门限。
7 对于PROM电压正常时,只要OE/RESET=0或CE=1,复位就开始,当地址计数器复位时,CEO输出高电平,其它的数据输出脚为高阻态。
8 XCFXXS PROM 只要求OE/RESET被释放以前,VCCINT上升到POR门限就行了。
9 XFCXXP PROM 在OE/RESET被释放以前,不但要求VCCINT上升到POR 门限,而且还要求VCCO达到被推荐的正常工作电压。
配置1 当JTAG配置指令在PROM里被更新时,PROM暂时给CF一个低电平,接着就给CF一个高电平。
结合CF脚在外部加了上拉电阻,此时在CF脚输出一个‘高-低-高’的脉冲个FPGA的PROGRAM 脚。
此次FPGA就依次的开始配置。
2 在CF脚外部必须加个上拉电阻,防止CF脚产生一个浮动到低电平的值而引起复位。
3 当XCFXXP的PROM存有多重设计文件时,CF脚必须连接到FPGA的PROGRAM_B脚去保证重新安放那些被选中的设计文件(配置有效)。
4 对于XCFXXS的PROM,CF脚只是个输出,如果没有由于的功能的话,可以不用连接FPGA。
在SPARTAN FPGA系列中,INIT_B脚使用内部下拉有典型的补偿,外部上拉电阻在INIT_B脚时,能产生一个不明确的信号给PROM的OE/RESET脚,鉴别一个错误的配置,CRC错误在INIT_B脚。
FPGA配置电路模式有主模式、从模式和JTAG模式。
【1】主模式在主模式下,FPGA上电后,自动将配置数据从相应的外存储器读入到SRAM中,实现内部结构映射。
主模式根据比特流的位宽又可以分为:串行模式( 单比特流) 和并行模式( 字节宽度比特流) 两大类。
如:主串行模式、主SPI Flash 串行模式、内部主SPI Flash串行模式、主BPI 并行模式以及主并行模式,如下图:【2】从模式在从模式下,FPGA 作为从属器件,由相应的控制电路或微处理器提供配置所需的时序,实现配置数据的下载。
从模式也根据比特流的位宽不同分为串、并模式两类,具体包括:从串行模式、JTAG模式和从并行模式三大类。
(此处的JTAG模式与下面要说的JTAG模式有所不同)如下图:【3】JTAG模式在JTAG模式中,PC和FPGA通信的时钟为JTAG接口的TCLK,数据直接从TDI进入FPGA,完成相应功能的配置。
主串模式是最常用的配置模式在FPGA主串配置模式下,会发现两种不同的连接方式:一种是FPGA在前,PROM在后。
即JTAG接口的DTI连接至FPGA的DTI,FPGA的DTO连接至PROM的DTI,PROM的DTO连接至JTAG接口的DTO。
另一种是PROM在前,FPGA在后。
即JTAG接口的DTI连接至PROM的DTI,PROM的DTO 连接至FPGA的DTI,FPGA的DTO连接至JTAG接口的DTO。
这两种连接方式都是正确的,都可以。
但是,由于PC机配置JTAG链的时候需要和第一级JTAG 设备同步,如果FPGA放在第一级,那么其配置速度较高,导致对PROM配置可能会不稳定,所以推荐的配置是将PROM作为JTAG链的第一级JTAG设备,即上述第二种方式。
在Xilinx 的PROM芯片XCF01/2/4S手册中给出的主串模式下(Configuring in Master Serial Mode)的连接图也是第二种方式,如下图:那FPGA在前的情况如下图:主串配置电路的关键点主串配置最关键的3点就是JTAG链的完整性、电源电压的设置以及CCLK信号的考虑。
【配置知识】Virtex-5 FPGA的配置配置方案Xilinx 为终端用户提供了配置Virtex-5 FPGA 所需的灵活性。
Virtex-5 FPGA 支持以下方案:串行最简单的配置方案,串行吞吐量。
主串行Xilinx FPGA 驱动Xilinx PROM CLK,因为Xilinx PROM 为Xilinx FPGA 提供了串行(x1)配置数据。
从串行Xilinx PROM 的内部振荡器驱动Xilinx FPGA CCLK,因为Xilinx PROM 为Xilinx FPGA 提供了串行(x1)配置数据。
从串行外部时钟驱动Xilinx PROM CLK,Xilinx PROM 驱动Xilinx FPGA CCLK,因为Xilinx PROM 为Xil inx FPGA 提供了串行(x1)配置数据。
返回页首从串行外部时钟驱动Xilinx FPGA CLK 和Xilinx PROM CLK,因为Xilinx PROM 为Xilinx FPGA 提供了串行(x1)配置数据。
主SPIVirtex-5 FPGA 驱动SPI PROM 时钟,因为SPI PROM 为Virtex-5 FPGA 提供了串行(x1)配置数据。
并行并行配置,可以实现最快速的吞吐量主并(Master-SelectMap)Xilinx FPGA 驱动Xilinx PROM CLK,因为Xilinx PROM 为Xilinx FPGA 提供了字节宽的(x8)配置数据。
返回页首从并(slave-SelectMAP)Xilinx PROM 的内部振荡器驱动Xilinx FPGA CCLK,因为Xilinx PROM 为Xilinx FPGA 提供了字节宽的(x8)配置数据。
从并(slave-SelectMAP)外部时钟驱动Xilinx PROM CLK,Xilinx PROM 驱动Xilinx FPGA CCLK,因为Xilinx PROM 为Xil inx FPGA 提供了字节宽的(x8)配置数据。
Step1 学习下载配置Xilinx 之FPGA配合Mars-EDA 的Spartan2 核心板,用图文方式向大家详细讲述如何下载配置Xilinx 的FPGA。
FPGA 下载模式说明S1 为 FPGA 下载模式选择跳线,M0,M1,M2 默认状态为通过 4.7K 电阻上拉到 3.3V,当用跳线帽短接 S1 的PIN3 和PIN6 将置 M0 为0,同理,短接 PIN2 和PIN5,PIN3 和PIN4 将置 M1,M2 为0。
M0,M1,M2 的电平和 FPGA 下载之间的关系参见下图:(Boundary-scan mode)是调试最常用的 JTAG 模式。
当采用板载 PROM 时,采用的跳线模式是 Master Serial Mode –短路 PIN1 和PIN6,PIN2 和PIN5J2 为Slave Serial Mode 的接口。
下载模式跳线 S1 短接PIN1 和PIN6,PIN2 和PIN5 即可。
J3 为 JTAG Mode 的接口。
下载模式跳线短接 PIN1 和 PIN6 即可。
S2 跳线说明1.通过 JTAG 方式烧录 FPGA:短接 PIN1 和PIN3。
2.通过 JTAG 方式烧录 PROM:短接 PIN3 和PIN5,PIN2 和PIN4.3.通过菊花链下载 FPGA 和烧录 PROM:短接 PIN3 和PIN5,PIN4 和PIN6.下面我们利用 Spartan2 核心板介绍一下通过 JTAG 菊花链方式下载 FPGA 和烧录 PROM. 硬件跳线选择:1.跳线 S1: 此时要求 M0 M1 M2 = 100, 设置 FPGA 的下载方式为 Boundary-scan mode, 此时将 M1 和M2 的跳线安上。
跳线 S2 : 通过菊花链下载 FPGA 和烧录 PROM:短接 PIN3 和 PIN5,PIN4 和 PIN6.2.将 Xilinx 下载线和核心板上 JTAG mode 接口 J3 相连,连接到计算机并口。
Xilinx FPGA SPI-FlashBootloader & Program整理:朱浩 2014.03.03Xilinx ISE Design Suite 13.2一、 MicroBlaze_SPI_BootloaderBootloader 的作用:由于FPGA 内部的block ram 空间容量有限,无法直接运行大尺寸的用户应用程序代码。
这可通过先在FPGA 内部运行一个小的bootloader 程序,再由此程序读取并转移flash 中srec 格式的数据到外部DDR RAM 中运行,这样可以运行容量比较大的代码。
1. SDK 软件上Project 代码运行代码运行区域区域区域设设置1.1. 右击Project 并选择Generate Linker Script.1.2. In the Basic tab, Use the drop-down list to select the DDR3 memorySelect MCB_DDR3_S0_AXI_BASEADDR, for all the code sections. Click Generate then Yes to overwrite the existing linker script.2.Creating a SREC Flash Image2.1. 右击Project并选择C/C++ Build Settings,选择Build Steps内容如下::2.2. 修改Post-Build Steps的command内容如下mb-objcopy -O srec uf911c.elf uf911c.srec前面是编译产生的elf文件,后面是要转成的srec文件名字,srec文件在Bootloader时需要用到,这两个文件都在..\workspace\uf911c\Debug文件夹下。
每次对Project编译时除生成elf文件外,还将生成新的srec文件。
注:技术交流用,希望对大家有所帮助。
IO_LXXY_# 用户IO引脚XX代表某个Bank内唯一的一对引脚,Y=[P|N]代表对上升沿还是下降沿敏感,#代表bank 号2.IO_LXXY_ZZZ_# 多功能引脚ZZZ代表在用户IO的基本上添加一个或多个以下功能。
Dn:I/O(在readback期间),在selectMAP或者BPI模式下,D[15:0]配置为数据口。
在从SelectMAP读反馈期间,如果RDWR_B=1,则这些引脚变成输出口。
配置完成后,这些引脚又作为普通用户引脚。
D0_DIN_MISO_MISO1:I,在并口模式(SelectMAP/BPI)下,D0是数据的最低位,在Bit-serial模式下,DIN是信号数据的输入;在SPI模式下,MISO是主输入或者从输出;在SPI*2或者SPI*4模式下,MISO1是SPI总线的第二位。
D1_MISO2,D2_MISO3:I,在并口模式下,D1和D2是数据总线的低位;在SPI*4模式下,MISO2和MISO3是SPI总线的MSBs。
An:O,A[25:0]为BPI模式的地址位。
配置完成后,变为用户I/O口。
AWAKE:O,电源保存挂起模式的状态输出引脚。
SUSPEND是一个专用引脚,AWAKE是一个多功能引脚。
除非SUSPEND模式被使能,AWAKE被用作用户I/O。
MOSI_CSI_B_MISO0:I/O,在SPI模式下,主输出或者从输入;在SelectMAP模式下,CSI_B是一个低电平有效的片选信号;在SPI*2或者SPI*4的模式下,MISO0是SPI总线的第一位数据。
FCS_B:O,BPI flash 的片选信号。
FOE_B:O,BPI flash的输出使能信号FWE_B:O,BPI flash 的写使用信号LDC:O,BPI模式配置期间为低电平HDC:O,BPI模式配置期间为高电平CSO_B:O,在并口模式下,工具链片选信号。
在SPI模式下,为SPI flsah片选信号。
1.上电后,FPGA 芯片内部时钟开始工作;2.PROM 接收到FPGA 传来的时钟信号后,开始工作;3.PROM 把CF 脚拉低,也就是把FPGA 的PROG/PROG_B 拉低;4.FPGA 检测到PROG 信号有超过500纳秒的低脉冲后,FPGA 开始清除内部已有的配置(打扫房间),以待新的配置数据可以被接收。
PROG 由低返回高后,FPGA 立即把DONE 和INIT_B 都拉低,而这两个一个是PROM 的使能信号,一个是PROM 的RESET 信号,CLK 12CE13OE/RESET 11BUSY5EN_EXT_SEL25REV_SEL127REV_SEL026CF6CEO10CLKOUT9D028D129D232D333D443D544D647D748Configuring in FPGA Master Serial ModeMaster Serial configuration mode (shown in Figure2-1) is most commonly used withconfiguration PROMs, because it is simple to implement. Only a small number of signals arerequired to interface the PROM with the FPGA, and an external clock source is not requiredfor configuration. In FPGA Master Serial mode, the FPGA generates the configuration clock.In this mode, data is available on the PROM Data (D0) pin when CF is High, and CE and OEare enabled. New data is available a short access time after each rising clock edge.Figure 2-1:FPGA Master Serial Configuration SetupChoose a Configuration Mode: M[2:0]The mode select pins, M[2:0], define the configuration mode that the FPGA uses to load its bitstream, as shown in Table 2-1. The logic levels applied to the mode pins is sampled on the rising edge of INIT_B , immediately after the FPGA completes initializing its internal configuration memory.M[2:0] Functional Differences between Spartan-3 Generation FamiliesTable 2-2 summarizes the slight differences in functionality between the Spartan-3 generation families.Table 2-1:Mode Pin Settings and Associated FPGA Configuration Mode by FamilyM[2:0]FPGA FamilySpartan-3 Spartan-3ESpartan-3ASpartan-3A DSPSpartan-3AN<0:0:0>Master Serial (Platform Flash) Mode<0:0:1>Reserved Master SPI Mode<0:1:0>Reserved BPI Up <0:1:1>Master ParallelBPI DownReservedInternal MasterSPI<1:0:0>Reserved <1:0:1>JTAG Mode <1:1:0>Slave Parallel Mode <1:1:1>Slave Serial ModeTable 2-2:M[2:0] Mode Pin Differences between Spartan-3 Generation FPGAsSpartan-3 FPGASpartan-3E FPGAExtended Spartan-3A Family FPGAsAvailable as possible user I/O pin after configuration?No Yes Yes Dedicated internal pull-up resistor during configuration?YesNoYesMechanism to define post-configuration behaviorM2Pin , M1Pin , M0Pin bitstream options User I/O User I/OInput supply voltage V CCAUX V CCO_2V CCO_2Output supply voltageN/A V CCO_2V CCO_2Same voltage as other pins in the configuration interface?Only when interface is at2.5VYesYesProgram or Reset FPGA: PROG_BThe PROG_B pin is an asynchronous control input to the FPGA. When Low, the PROG_B pinresets the FPGA, initializing the configuration memory. When released, the PROG_B begins theconfiguration processes. The initialization process does not start until PROG_B returns High.Asserting PROG_B Low for an extended period delays the configuration process. The variousPROG_B functions are outlined in Table 2-7.At power-up or after a master reset, PROG_B always has a pull-up resistor to V CCAUX,regardless of the “Pull-Up Resistors During Configuration” control input. Afterconfiguration, the bitstream generator option ProgPin defines whether or not the pull-up resistoris remains active. By default, the ProgPin option retains the pull-up resistor.Table 2-7: PROG_B OperationAfter configuration, hold the PROG_B input High. Any Low-going pulse on PROG_B, lasting500 ns or longer (300 ns in the Spartan-3 FPGAs), restarts the configuration process.The PROG_B pin functionality is identical among all Spartan-3 generation FPGAs.Figure2-3 shows the basic point-to-point topology where the CCLK output from the Master FPGA drives one clock input receiver, either on the configuration PROM or on a slave FPGA.Caution!On Spartan-3E and Extended Spartan-3A family FPGAs, be sure to define a valid logic level on CCLK. Otherwise, the clock trace might float and cause spurious clocking to other devices in the system.Figure 2-3:Point-to-Point: Master CCLK Output Drives Single Clock Load Figure2-4 shows the basic multi-drop flyby topology where the CCLK output from the Master FPGA drives two or more clock input receivers. Constrain the trace length on any clock stubs.Figure 2-4:Multi-Drop: Master CCLK Output Drives Two Clock InputsFigure 2-5 shows a star topology where the Master FPGA CCLK transmission line branches to the multiple clock receiver inputs. The branch point creates a significant impedance discontinuity. Do not use this topology.ConfigRate: Bitstream Option for CCLKFor Master configuration mode, the ConfigRate bitstream generator option defines thefrequency of the internally-generated CCLK oscillator. The actual frequency isapproximate due to the characteristics of the silicon oscillator and varies by up to 50% over the temperature and voltage range. On Spartan-3E and Extended Spartan-3A family FPGAs, the resulting frequency for every ConfigRate setting is fully characterized and specified in the associated FPGA family data sheet. At power-on, CCLK always starts operation at its lowest frequency. Use the ConfigRate option to set the oscillator frequency to one of the other values shown in Table 2-8.Set this option graphically in “ISE Software Project Navigator,” page 42, as shown in Step 7 in Figure 1-7, page 44.The FPGA does not start operating at the higher CCLK frequency until the ConfigRate control bits are loaded during the configuration process.Persist: Reserve CCLK As Part of SelectMAP InterfaceBy default, any clocks applied to CCLK after configuration are ignored unless thebitstream option Persist :Yes is set, which retains the configuration interface. If Persist :Yes , then all clock edges are potentially active events, depending on the other configuration control signals. On Spartan-3E and Extended Spartan-3A family FPGAs, CCLK becomes a full-featured user-I/O pin after configuration.Figure 2-5:Star Topology Is Not RecommendedUG191_c2_07_112206Z 0ImpedanceDiscontinuityZ 0Clock Input 1Z 0Clock Input 2Clock In ock InpCCCLKMaster FPGAAs highlighted in Table 2-2, page 50, the Extended Spartan-3A family FPGAs add a few more dedicated internal pull-up resistors, as shown in Table 2-10. On Spartan-3E FPGAs, these pins do not have a dedicated internal pull-up resistor, but do have an optional pull-up resistor controlled when HSWAP =0.The Spartan-3 FPGA family uses dedicated configuration pins, as shown in Table 2-11. The post-configuration behavior is controlled by bitstream settings.Table 2-9:Pins with Dedicated Pull-Up Resistors during Configuration (All Spartan-3 Generation FPGAs)Pin Name Pull-Up Resistor SupplyRailPost Configuration ControlPROG_B V CCAUX ProgPin BitGen settingDONE V CCAUXDonePin and DriveDone BitGen settings Pull-up during Configuration control input,HSWAP , PUDC_B , or HSWAP_EN (see Table 2-12)VCCO_0Spartan-3E and Extended Spartan-3A family FPGAs: User I/O after configuration. Controlled by the FPGA applicationSpartan-3 FPGA: Controlled by HswapenPin BitGen settingINIT_BSpartan-3E/3A/3AN/ Spartan-3A DSP FPGAs:VCCO_2Spartan-3 FPGA:VCCO_4 or VCCO_BOTTOMUser I/O after configuration. Controlled by the FPGA applicationTDI V CCAUX TdiPin BitGen setting TMS V CCAUX TmsPin BitGen setting TCK V CCAUX TckPin BitGen setting TDOV CCAUXTdoPin BitGen settingTable 2-10:Pins with Dedicated Pull-Up Resistors during Configuration (Extended Spartan-3A Family FPGAs Only)Pin Name Pull-Up Resistor Supply RailPost Configuration ControlM[2:0]VCCO_2User I/O after configuration. Controlled by the FPGA applicationVS[2:0]VCCO_2Pull-up resistors only active when M[2:0]=<0:0:1>, Master SPI mode, or in Spartan-3AN FPGAs when M[2:0]=<0:1:1>, Internal Master SPI mode. User I/O after configuration. Controlled by the FPGA applicationPin DescriptionsTable 2-15 lists the various pins involved in the configuration process, including which configuration mode, the pin’s direction, and a summary description. The table also describes how to use the pin during and after configuration.Table 2-13:Pull-Up Resistor Ranges by Spartan-3 Generation FamilyVoltage RangeSpartan-3 FPGASpartan-3E FPGASpartan-3A/3ANSpartan-3A DSP FPGAUnitsV CCAUX or V CCO = 3.0 to 3.6V5.1 to 23.9k ΩV CCO = 3.0 to 3.45V 1.27 to 4.11 2.4 to 10.8V CCAUX or V CCO = 2.3 to 2.7V1.15 to 3.252.7 to 11.8 6.2 to 33.1V CCO = 1.7 to 1.9V2.45 to 9.104.3 to 20.28.4 to 52.6Table 2-14:Recommended External Pull-Up or Pull-down Resistor Values to Define Input Values during Configuration PUDC_B, HSWAP , orHSWAP_EN Desired Pull Direction I/O StandardSpartan-3 FPGASpartan-3E FPGASpartan-3A/3AN Spartan-3A DSPFPGA= 0(also applies to all pins that have a dedicated pull-up resistor during configuration, see “Pins with Dedicated Pull-Up Resistorsduring Configuration,”page 62)Pull-UpAll No pull-up required. Internal pull-up resistors areenabled. See Table 2-13 for resistor range.Pull-Down(required to overcome maximum I RPU current and guarantee V IL )LVCMOS33LVTTL ≤ 330 Ω≤ 620 Ω≤ 1.1k ΩLVCMOS25≤ 470 Ω≤ 820 Ω≤ 1.8k ΩLVCMOS18≤ 510 Ω≤ 820 Ω≤ 3.3k ΩLVCMOS15≤ 820 Ω≤ 1.2 k Ω≤ 5.4k ΩLVCMOS12≤ 1.5 k Ω≤ 1.5 k Ω≤ 9.6k Ω= 1(optional pull-up resistors are disabledduringconfiguration. Does not apply to pins with dedicated pull-up resistors during configuration)Pull-Up (required to overcome single-load, maximum I L leakage current and guarantee V IH )LVCMOS33LVTTL ≤ 40k Ω≤ 100k ΩLVCMOS25≤ 60k ΩLVCMOS18≤ 37k ΩLVCMOS15≤ 28k ΩLVCMOS12≤ 38k ΩPull-Down(required to overcome single-load, maximum I L leakage current and guarantee V IL )LVCMOS33LVTTL ≤ 32k Ω≤ 80k ΩLVCMOS25≤ 70k ΩLVCMOS18≤ 38k ΩLVCMOS15LVCMOS12≤ 59k ΩTable 2-15:Spartan-3 Generation Configuration Pins, Associated Modes, and FunctionPin Name Config.Mode(s)FPGADirectionDescription During Configuration After ConfigurationHSWAPor PUDC_Bor HSWAP_EN (depends on FPGA family)All Input User I/O Pull-Up Control.When Low duringconfiguration, enablespull-up resistors in all I/Opins to respective I/O bankV CCO input.0: Pull-ups duringconfiguration1: No pull-upsDrive at valid logiclevel throughoutconfiguration.Spartan-3:Dedicated pin (don’tcare afterconfiguration)Spartan-3ESpartan-3ASpartan-3ANSpartan-3A DSP:User I/OM[2:0]All Input Mode Select. Selects theFPGA configuration modeas defined in Table2-1.Must be at the logiclevels shown inTable2-1, page50.Sampled when INIT_Bgoes High.User I/O (dedicatedon Spartan-3 FPGAs)DIN SerialModes, SPI Input Serial Data Input. for allserial configuration modesReceives serial datafrom PROM serial dataoutput.User I/OCCLK MasterModes, SPI,BPIOutput(treat asI/O forsignalintegrity)Configuration Clock.Generated by FPGAinternal oscillator.Frequency controlled byConfigRate bitstreamgenerator option. See“Configuration Clock:CCLK,” page56.Drives PROM’s clockinput.User I/O (dedicatedon Spartan-3 FPGAs)Slave Modes Input Configuration clock input.Input configurationclock source.DOUT Output Serial Data Output. Not used in single-FPGA designs; DOUTis pulled up, notactively driving. In aserial daisy-chainconfiguration, this pinconnects to DIN inputof the next FPGA in thechain.User I/OINIT_B All Open-drainbidirec-tional I/O Initialization Indicator.Active Low. See“Initializing ConfigurationMemory, ConfigurationError: INIT_B,” page61.Drives Low afterpower-on reset (POR)or when PROG_Bpulsed Low while theFPGA is clearing itsconfiguration memory.If a CRC error detectedduring configuration,FPGA again drivesINIT_B Low.User I/O. If unusedin the application,drive INIT_B High orLow to avoid afloating value. SeeINIT_B “AfterConfiguration”.DONE All Open-drainbidirec-tional I/O FPGA ConfigurationDone. Low duringconfiguration. Goes Highwhen FPGA successfullycompletes configuration.Powered by V CCAUXsupply.0: FPGA not configured1: FPGA configuredSee “DONE Pin,” page52Actively drives Lowduring configuration.When High,indicates that theFPGA successfullyconfigured.PROG_B All Input Program FPGA. ActiveLow. When asserted Lowfor 500 ns or longer, forcesthe FPGA to restart itsconfiguration process byclearing configurationmemory and resetting theDONE and INIT_B pins. Ifdriving externally with a3.3V output, use an open-drain or open-collectordriver or use a currentlimiting series resistor. See“Program or Reset FPGA:PROG_B,” page56.Must be High duringconfiguration to allowconfiguration to start.Drive PROG_B Lowand release toreprogram FPGA.Spartan-3E Spartan-3A Spartan-3AN Spartan-3A DSPFPGA:VS[2:0]Master SPI Input Variant Select. Instructs theFPGA how to communicatewith the attached SPI FlashPROM.Must be at the logiclevels shown inTable4-2, page105.Sampled when INIT_Bgoes High.User I/OSpartan-3E Spartan-3A Spartan-3AN Spartan-3A DSPFPGA:MOSI Master SPI Output Serial Data Output. FPGA sends SPI Flashmemory readcommands andstarting address to thePROM’s serial datainput.User I/OSpartan-3E Spartan-3A Spartan-3AN Spartan-3A DSP FPGA:CSO_B Master SPI Output Chip Select Output. ActiveLow.Connects to the SPIFlash PROM’s SlaveSelect input. IfHSWAP/PUDC_B=1,connect this signal to a4.7 kΩ pull-up resistorto 3.3V.Drive CSO_B Highafter configuration todisable the SPI Flashand reclaim theMOSI, DIN, andCCLK pins.Optionally, re-usethis pin and MOSI,DIN, and CCLK tocontinuecommunicating withSPI Flash.Table 2-15:Spartan-3 Generation Configuration Pins, Associated Modes, and Function (Cont’d)Pin Name Config.Mode(s)FPGADirectionDescription During Configuration After ConfigurationSpartan-3E Spartan-3A Spartan-3AN Spartan-3A DSPFPGA:CSI_B Spartan-3FPGA:CS_B BPI, SlaveParallelInput Chip Select Input. ActiveLow.er I/O. If bitstreamoption Persist:Yes,becomes part ofSelectMap parallelperipheral interface.RDWR_B BPI, SlaveParallel Input Read/Write Control. ActiveLow write enable. Readfunctionality typically onlyused after configuration, ifbitstream optionPersist:Yes.Must be Lowthroughoutconfiguration. Do notchange logic levelwhile CSI_B is LowUser I/O. If bitstreamoption Persist:Yes,becomes part ofSelectMap parallelperipheral interface.Spartan-3E Spartan-3A Spartan-3AN Spartan-3A DSPFPGA:LDC0BPI Output PROM Chip Enable Connect to parallelPROM chip-selectinput (CS#). FPGAdrives this signal Lowthroughoutconfiguration.User I/O. If theFPGA does not accessthe PROM afterconfiguration, drivethis pin High todeselect the PROM.A[23:0], D[7:0],LDC[2:1], and HDCthen becomeavailable as user I/O.Spartan-3E Spartan-3A Spartan-3AN Spartan-3A DSPFPGA:LDC1BPI Output PROM Output Enable Connect to the parallelPROM output-enableinput (OE#). The FPGAdrives this signal Lowthroughoutconfiguration.User I/OSpartan-3E Spartan-3A Spartan-3AN Spartan-3A DSPFPGA:HDC BPI Output PROM Write Enable Connect to parallelPROM write-enableinput (WE#). FPGAdrives this signal Highthroughoutconfiguration.User I/OSpartan-3E Spartan-3A Spartan-3AN Spartan-3A DSPFPGA:LDC2BPI Output PROM Byte Mode This signal is not usedfor x8 PROMs. ForPROMs with a x8/x16data width control,connect to PROM byte-mode input (BYTE#).User I/O. Drive thispin High afterconfiguration to use ax8/x16 PROM in x16mode.Pin Name Config.Mode(s)FPGADirectionDescription During Configuration After ConfigurationPin Behavior During ConfigurationTable 2-16, Table 2-17, and Table 2-18 show how various pins on Spartan-3 generation FPGAs behave during the configuration process. The actual behavior depends on the settings applied to the M2, M1, and M0 (M[2:0]) mode select pins and the pin that controls the optional pull-up resistors, called HSWAP , PUDC_B , or HSWAP_EN depending on the specific Spartan-3 generation FPGA family. The M[2:0] mode select pins determine which of the I/O pins are active and borrowed during configuration and how they function. In JTAG configuration mode, no user-I/O pins are borrowed for configuration.The Dedicated Pull-Up Resistor column indicates pins that always have a pull-up resistor enabled during configuration, regardless of the PUDC_B , HSWAP , or HSWAP_EN input. After configuration, the behavior of these pins is either defined by specific bitstream generator options or by the FPGA application itself.Table 2-16, Table 2-17, and Table 2-18 show the FPGA pins that are either borrowed or dedicated during configuration. The specific pins are listed by FPGA configuration mode along the top. For each pin, the table also indicates the power rail that supplies the pin during configuration. A numeric value such as “2”, indicates that the associated pin is located in I/O Bank 2 and powered by the VCCO_2 supply inputs. Spartan-3E andExtended Spartan-3A family FPGAs have four I/O banks; the Spartan-3 FPGA family has eight I/O banks.The pin names are color-coded using the same colors used in the package pinout tables and footprint diagrams found in the respective Spartan-3 generation data sheet. Blackrepresents the dedicated JTAG pins; yellow represents the dedicated configuration pins; light blue represents the dual-purpose configuration pins that become user-I/O pins after configuration.Spartan-3E FPGA:A[23:0]Spartan-3ASpartan-3ANSpartan-3A DSPFPGA:A[25:0]BPIOutputParallel PROM Address outputsConnect to PROM address inputs.User I/O.D[7:0]Master Parallel, BPI, Slave Parallel,SelectMAPInput Data InputData captured by FPGAUser I/O. If bitstream option Persist :Yes , becomes part of SelectMap parallel peripheral interface.Spartan-3/Spartan-3E FPGA:BUSYBPI, Slave Parallel (SelectMAP )OutputFPGA Busy Indicator. Used primarily in Slave Parallel interfaces that operate at 50MHz and faster. Same function is on DOUT pin in the Extended Spartan-3A family.Not used during BPI mode configuration but actively er I/O. If bitstream option Persist :Yes , becomes part of SelectMap parallel peripheral interface.Pin Name Config. Mode(s)FPGA DirectionDescriptionDuring Configuration After ConfigurationSupported Platform Flash PROMsTable 3-4 shows the smallest available Platform Flash PROM to program one Spartan-3generation FPGA. A multiple-FPGA daisy-chain application requires a Platform Flash PROMlarge enough to contain the sum of the various FPGA bitstream sizes.Table 3-4: Number of Bits to Program a Spartan-3 Generation FPGA and SmallestPlatform Flash PROMFamily FPGANumber of Smallest Possible Configuration Bits Platform Flash PROMXC3S50A437,312XCF01SXC3S200A1,196,128XCF02S Spartan-3A XC3S400A1,886,560XCF02S (Spartan-3AN)XC3S700A2,732,640XCF04SXC3S1400A4,755,296XCF08Por XCF04S + XCF02SXC3SD1800A8,197,280XCF08PSpartan-3A DSP or two XCF04S PROMs XC3SD3400A11,718,304XCF16PXC3S100E581,344XCF01SXC3S250E1,353,728XCF02SSpartan-3E XC3S500E2,270,208XCF04SXC3S1200E3,841,184XCF04SXC3S1600E5,969,696XCF08Por XCF04S + XCF02SXC3S50439,264XCF01SXC3S2001,047,616XCF01SXC3S4001,699,136XCF02SXC3S10003,223,488XCF04S Spartan-3XC3S15005,214,784XCF08Por XCF04S + XCF02SXC3S20007,673,024XCF08Por 2 x XCF04SXC3S400011,316,864XCF16PXC3S500013,271,936XCF16PThere are two possible design solutions for FPGA designs that require 8 Mbit PROMs: use either a single 8 Mbit XCF08P parallel/serial PROM or two cascaded XCFxxS serial。
Xilinx FPGA的power-up配置和 start-up过程FPGA的配置分为3步,1.清除配置SRAM2.下载配置数据3. Start-up过程激活逻辑Power-up配置从上图可见,配置在FPGA上电时自动进行。
上电后,FPGA自动开始清楚RAM的内容(此时,外围电路应使/program=1),清除RAM后,FPGA使/INIT变为无效,开始装载配置bit(如果保持/INIT信号有效,则可以延迟装载bit,INIT是双向端口)。
装载bit的过程中,FPGA会做CRC检查,发现错误则把/INIT信号拉低。
配置完成后done变高。
配置时序如下图所示。
也可以通过把/program置低开始(在不重新上电的情况下开始配置FPGA)对Xilinx FPGA的配置有四个主要步骤(不重新上电的情况下开始配置FPGA):(1)配置存储器清空(Clearing Configuration Memory)将PROGRAM管脚拉低300ns以上。
当PROGRAM拉低后,开始配置存储器,将存储器清空。
此时INIT将被拉低,当PROGRAM置高后,FPGA将继续将INIT置低直到完全清除完所有的配置存储器。
当INIT变高时,配置便可以开始了。
(2)加载配置数据(Loading Configuration Data)当INIT变高时,便可以配置FPGA了。
配置时,先将CCLK置低,再将数据发送到DIN上,延时45ns以上,再将CCLK置高,该位数据便写入到了FPGA中(数据是低位在前),然后再准备下一次的输入。
如此反复,将所有数据输入完毕为止。
(3)CRC错误校验(CRC Error Checking)在加载数据过程中,嵌入到配置文件中的CRC值同FPGA计算出来的值比较,若有CRC 校验错误产生,则INIT置低,且FPGA停止加载。
Start-up过程默认的start-up过程在DONE信号变高并延迟一个CCLK后进行,此时global tri-state signal(GTS)信号释放,这样允许器件output打开。
fpga配置芯片FPGA(Field-Programmable Gate Array)是一种灵活可编程的芯片,可以通过配置来实现不同的电路功能。
它拥有矩阵式的可编程逻辑单元(PLU)和可编程的连线资源(Interconnect)。
配置芯片是将特定的逻辑电路输出信号烧录到FPGA内部的存储器中,使其在运行时能够按照所需的功能来工作。
FPGA配置芯片的过程主要包括以下几个步骤:1. 设计和编写硬件描述语言(HDL)代码:首先,需要使用HDL语言(如Verilog、VHDL)来描述所需的逻辑电路功能。
HDL代码可以分为结构化编程和行为编程两种方式,具体编写的内容包括输入输出端口的定义、逻辑门的连接等。
2. 仿真和验证设计:在进行配置芯片之前,需要使用仿真工具对HDL代码进行验证,确保设计的正确性。
通过仿真可以检查逻辑电路是否按照预期工作,并可以进行调试和优化。
3. 合成:合成是将HDL代码转换为实际的逻辑电路的过程。
合成工具将HDL代码进行优化和转换,生成一个包含逻辑门和连线的网络表示。
4. 实现:在实现过程中,将逻辑网进行布局和布线,将逻辑门放置在FPGA芯片的逻辑单元中,并将它们之间的连线连接起来。
布局是指确定逻辑门在FPGA芯片上的位置,布线是指将逻辑门之间的连接线路连接起来,确保信号能够正确传输。
5. 生成比特流文件:配置芯片的最后一步是将实现的电路转化为比特流文件。
这些文件包含了逻辑门和连线的配置信息,以及其他必要的控制信号等。
6. 下载比特流文件:最后,在配置芯片的时候,需要将比特流文件下载到FPGA芯片的内存中。
下载可以通过专用的下载线缆或者其他接口来进行。
FPGA配置芯片的优点是它的可编程性和灵活性。
通过重新配置FPGA芯片,可以实现不同的电路功能,极大地提高了开发和测试的效率。
同时,FPGA配置芯片还可以减少硬件设计的成本和时间,并且能够快速响应市场需求的变化。
总的来说,FPGA配置芯片是将特定的逻辑电路功能烧录到FPGA芯片中的过程,它通过硬件描述语言的编写和优化、仿真和验证设计、合成、实现、生成比特流文件和下载等步骤来完成。
fpga parameter用法FPGA Parameter用法FPGA(Field Programmable Gate Array)是一种可编程逻辑器件,它可以通过编程来实现各种不同的功能。
FPGA Parameter是FPGA 中的一个重要概念,它可以帮助开发人员更好地控制FPGA的行为和性能。
FPGA Parameter是FPGA中的一些可配置的参数,它们可以用来控制FPGA的行为和性能。
这些参数可以包括时钟频率、时序、电源电压、电流等。
通过调整这些参数,开发人员可以优化FPGA的性能,使其更加适合特定的应用场景。
FPGA Parameter的使用非常灵活,可以根据具体的应用场景进行调整。
例如,在高速数据传输应用中,可以通过调整时钟频率和时序来优化FPGA的性能。
在低功耗应用中,可以通过调整电源电压和电流来降低功耗。
FPGA Parameter的使用需要开发人员具备一定的硬件设计和编程经验。
在使用FPGA Parameter时,需要注意以下几点:1. 确定应用场景:在使用FPGA Parameter之前,需要确定具体的应用场景和需求,以便选择合适的参数进行调整。
2. 确定参数范围:在调整FPGA Parameter时,需要确定参数的范围,以便避免超出FPGA的设计规格。
3. 进行仿真测试:在调整FPGA Parameter之前,需要进行仿真测试,以便评估参数调整对FPGA性能的影响。
4. 调整参数:根据仿真测试结果,可以逐步调整FPGA Parameter,以达到最优的性能和功耗。
FPGA Parameter是FPGA设计中非常重要的一个概念,它可以帮助开发人员更好地控制FPGA的行为和性能。
在使用FPGA Parameter 时,需要根据具体的应用场景进行调整,并进行仿真测试,以便评估参数调整对FPGA性能的影响。
《Platform Flash PROM User Guide》中文版FPGA的配置分为主串行和从串行两种,差别在于时钟源不同。
nCF为高时PROM的DO数据有效,nCE和OE使能。
P24和26介绍了接线图和引脚功能。
原型开发优势每写一次可以有4套不同的程序进行测试。
板子测试配置或安全升级设计的版本中写有诊断程序,如果发现原程序不满足要求,可以调用符合要求的程序重新执行,节省了调试时间。
PlatForm具有备份程序的功能。
防止不完整或损坏数据FPGA的所有IO口在DONE为低电平时均不可用,PlatForm满足这个要求。
为什么使用内部解压或晶振Platform PROM片上解压使得用户可以多存储50%的数据。
Platform PROM提供20MHz或者40MHz(默认)的时钟用于将配置数据从PROM送入FPGA。
内部晶振,特别是40MHz的操作只应用于解压模式。
否则,FPGA的CCLK或者外部晶振会用于驱动。
PROM的解压输出数据速率为内部时钟的一半,换言之,解压数据流配置时间是非压缩数据流的两倍。
如果需要快速配置,FPGA的BitGen-g compress方式可以作为压缩模式。
时钟CLKOUT信号在配置过程中,且在nCE低、OE/nRESET高时有效;无效时呈高组态并且需要外部上拉以避免不确定状态。
时钟速率可以配置,默认为1MHz,可以为1,3,6,12等,XCFxxS最大为33MHz。
PROM文件生成和烧写.bit(Bitstream)文件为输入数据流,.mcs文件为输出数据,.cfi文件为配置格式信息文件。
.bit文件为FPGA使用的二进制数据,.mcs文件为PROM运行文件,.cfi(Configuration format information)文件名字与前两者根目录相同。
标准的PROM文件为前两者。
在XCFxxP系列PROM使用多版本程序设计、CLKOUT、解压缩等功能时还需要使用.cfi文件。
*ilin*FPGA的P ROM配置作者:枪手2007年8月16号1. 建立工程,假设VHDL,UCF2. 生成PROM 文件。
在图中选择P repare a PROM 3文件,综合,执行。
file, 然后点ne*t.iPaCI-Prepare PROI FilesI want to target aXiling PKDM○Generic Parallel PROM〇3rd-Farty SFI PROM〇PROM Supporting Multiple Design Versions;Spartan3E MultiBootPROM File FormatMCS TEK UFP('C" format)〇EXO 〇BIN 〇ISC〇HEX Swap BitsChecksum Fill Value(2Hex Digits):FFFROM File Name:led flow|Location: E:\xilinx'lab'led flow' Browse.< Back Next>Cancel在上图中做图所显示的选择,点NE*T4在上图中选择所用开发板上的 P ROM,SP3E 用*CFO4S, 点 ADD, 添加到列表中。
然后点 ne*t,出现file generation summary!5iPhCT- Specify Xilinx PROI DeviceAuto Select PROMEnable RevisioningNumber of Revisions:Enable CompressionSelect a FROM: xcfxef ⁰4sPosition 0[524288]Part Namexef04sAddDelete All<BackNext > CanceliIPACT-File Generation Suary You have entered following information:PROM Type:File FormatFill YaluePROM filenameNumber of PFOMsPositi on Part Name [0 xcf04s Serialm cs FFled flow 1Click“Finish” to start adding device files.<Eack Finish Cancel确定是不是和所选择的一致,点finish。
Xilinx FPGA的PROM配置
作者:枪手2007年8月16号
1.建立工程,假如VHDL,UCF文件,综合,执行。
2.生成PROM文件。
在图中选择Prepare a PROM file,然后点next.
3,
在上图中做图所显示的选择,点NEXT
4
在上图中选择所用开发板上的PROM,SP3E用XCF04S,点ADD,添加到列表中。
然后点next,出现file generation summary!
5.
确定是不是和所选择的一致,点finish。
6.
出现上面对话框的时候,点OK。
7.
在上面图中,选择bit文件。
8.
在出现上面对话框的时候,点NO。
9.然后,出现下面对话框,点OK。
10.在左边的impact modes 中,点Generate file
11.生成PROM FILE 文件成功。
12.在左边flows下,选择boundary scan。
13.点boundary scan后,出现下面界面。
14.点鼠标右键,选择initialize chain
15.出现下面下面界面。
对于XC3S500E,点cancel。
16.对XCF04S,选择刚才生成的led_flow.mcs文件.
17,对第三个,点cancel.
18.上面选择后,出现下面界面,在XCF04S,点右键,出现一个菜单,选择Program.
19,点PROGRAM后,出现如下界面,按图中选择各项.
20,点OK 后,开始配置,
21.成功界面如下,然后,拨掉JTAG,关掉电源,过一会再上电.。