漫谈xilinx FPGA 配置电路
fpga的基本外围电路设计

fpga的基本外围电路设计FPGA的基本外围电路设计主要包括以下几个步骤:1. 电源电路设计:为FPGA芯片提供稳定的电源,通常采用线性稳压电源或开关电源。
根据FPGA芯片的功耗和电源要求,选择合适的电源芯片和滤波电容,确保电源稳定可靠。
2. 时钟电路设计:FPGA芯片需要稳定的时钟信号进行工作。
根据FPGA芯片的时钟要求,选择合适的晶振或PLL(锁相环)模块,并设计合适的时钟分配网络,确保时钟信号稳定、准确。
3. 配置电路设计:FPGA芯片可以通过外部配置引脚进行配置,也可以通过串行配置存储器进行配置。
根据FPGA芯片的配置要求,选择合适的配置芯片和接口电路,确保配置正确、可靠。
4. I/O接口电路设计:FPGA芯片具有丰富的I/O接口,可以与外部设备进行通信。
根据FPGA芯片的I/O接口类型和通信协议,设计合适的接口电路,确保数据传输稳定、可靠。
5. 保护电路设计:为了保护FPGA芯片免受外部干扰或损坏,需要设计保护电路。
常见的保护电路包括ESD保护、过流保护、过压保护等。
根据FPGA芯片的要求和实际应用场景,选择合适的保护电路和器件。
在设计基本外围电路时,还需要考虑以下几点:1. 参考设计和规范:参考FPGA厂商提供的参考设计和规范,可以快速设计出稳定可靠的FPGA外围电路。
2. 布局和布线:合理的布局和布线可以提高电路的可靠性和稳定性。
在设计过程中,要充分考虑信号的流向、器件的布局、布线的规则等因素。
3. 电源和地线处理:电源和地线是FPGA外围电路的重要组成部分。
要合理分配电源和地线,避免产生电磁干扰和噪声。
4. 仿真和测试:在设计过程中,可以使用仿真工具对电路进行仿真和测试,确保设计的正确性和可靠性。
总之,FPGA的基本外围电路设计需要考虑多个因素,包括电源、时钟、配置、I/O接口和保护等方面。
在设计过程中,要遵循参考设计和规范,合理布局和布线,处理好电源和地线,并进行仿真和测试。
Xilinx-FPGA配置的一些细节

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 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 提示。
Xilinx公司Spartan3系列配置电路

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。
XilinxFPGA介绍

目前FPGA芯片仍是基于查找表技术的,但其概念和性能已经远远超出查找表技术的限制,并且整合了常用功能的硬核模块(如块RAM、时钟管理和DSP)。
图1-1所示为Xilinx公司FPGA的内部结构示意图(由于不同系列的应用场合不同,所以内部结构会有一定的调整),从中可以看出FPGA芯片主要由 6部分组成:可编程输入输出单元、基本可编程逻辑单元、完整的时钟管理、嵌入块式RAM、丰富的布线资源、内嵌的底层功能单元和内嵌专用硬件模块。
图1-1 FPGA芯片的内部结构每个模块的功能如下:1.可编程输入输出单元(IOB)可编程输入/输出单元简称I/O单元,是芯片与外界电路的接口部分,完成不同电气特性下对输入/输出信号的驱动与匹配要求,提供输入缓冲、输出驱动、接口电平转换、阻抗匹配以及延迟控制等功能,其一般示意结构如图1-2所示。
FPGA内的I/O按组分类,每组都能够独立地支持不同的I/O标准。
通过软件的灵活配置,可适配不同的电气标准与I/O物理特性,可以调整驱动电流的大小,可以改变上、下拉电阻。
目前,I/O口的频率也越来越高,一些高端的FPGA 通过DDR寄存器技术可以支持高达2Gbps的数据速率。
外部输入信号可以通过IOB模块的存储单元输入到FPGA的内部,也可以直接输入FPGA 内部。
当外部输入信号经过IOB模块的存储单元输入到FPGA内部时,其保持时间(Hold Time)的要求可以降低,通常默认为0。
为了便于管理和适应多种电器标准,FPGA的IOB被划分为若干个组(bank),每个bank的接口标准由其接口电压VCCO决定,一个bank只能有一种VCCO,但不同bank的VCCO可以不同。
只有相同电气标准的端口才能连接在一起,VCCO 电压相同是接口标准的基本条件。
2.可配置逻辑块(CLB)CLB是FPGA内的基本逻辑单元。
CLB的实际数量和特性会依器件的不同而不同,但是每个CLB都包含一个可配置开关矩阵,此矩阵由4或6个输入、一些选型电路(多路复用器等)和触发器组成。
Xilinx FPGA上电时序分析与设计

电讯技术
Tee o lc mmu iain En ie rn nc t gn e g o i
V0 . 2 No 4 15 .
Ap .2 2 r 01
文章 编 号 :0 1 9 X(02 0 —0 9 —0 10 —8 3 2 1 ) 4 51 4
中图分 类号 :N 0 T 72 文献 标 志码 : A di1 .99 ji n 10 —8 3 .0 2 0 .3 o:0 36 / . s .0 1 9 x 2 1 . 0 4 s 4
Po r— n Ti i g An l ssa sg fXi n we —o m n ay i nd De i n o l x FPGA i J i /B n
作 , 重 时会导 致整 个 系统 的失 效 。因此 ,F G 严 P A的
1 引 言
随着 半 导 体 和 芯 片 技 术 的 飞 速 发 展 , 在 的 现 FG P A集 成 了越来 越 多 的可配 置逻 辑资 源 、 种各 样 各 的外部 总 线接 口以及 丰富 的 内部 R M 资 源 , 其 在 A 使
用 。但是Байду номын сангаасFG 大 多 数 是 基 于 S A 工 艺 的 , 有 PA RM 具 易失 性 , 此 FG 通 常使 用 外 部 存储 器 件 ( 因 PA 如
PO ) R M 存储必需 的配置信息 , 防止设备掉电后 F G PA
丢 失 自我 配置 能力 。但 FG P A配 置 在一 定 的条 件 和 时 间下 才 能成功 完成 , 随着 FG P A容 量 的不 断 攀 升 ,
因此fpgaxilinxfpga的配置方式和特点xilinxfpga支持多种配置方式其中包括串行主模式masterserial串行从模式slaveserial并行主模式masterselectmap并行8位从模式slaveselectmap8并行32位从模式slaveselectmap32以及边界扫描模式jtagvirtex5器件后还增加了对spi和bpi接口flash的支持现在设计中通常用到的是串行主模式和并行主模式两种配置方式它们共同的特点是电路硬件设计时不需再接入一个配置时钟配置时由fpga身提供时钟这样减小了pcb设计难度以及时钟带电讯技术telecommunicationengineeringvol52noapr201216来的时序干扰
xilinx的prom配置经验

复位和上电复位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脚。
Xilinx7系列FPGA架构之器件配置(一)

Xilinx7系列FPGA架构之器件配置(一)引言:本系列博文描述7系列FPGA配置的技术参考。
作为开篇,简要概述了7系列FPGA的配置方法和功能。
随后的博文将对每种配置方法和功能进行更详细的描述。
本文描述的配置方法和功能适用于所有7系列家族器件,只有少数例外。
1.概述Xilinx®7系列FPGA通过将特定于应用程序的配置数据(位流)加载到内存中进行配置。
7系列FPGA可以主动从外部非易失性存储设备加载,也可以通过外部智能源(如微处理器、DSP处理器、微控制器、PC或板测试仪)被动进行配置。
在任何情况下,都有两个通用配置数据路径。
第一个是串行数据路径,这种情况需要最少的硬件管脚连接。
第二个数据路径是8位、16位或32位数据路径,用于更高性能或访问(或链接)行业标准接口,非常适合外部数据源,如处理器或x8或x16并行闪存。
与处理器和处理器外围设备一样,Xilinx FPGA可以在线重新编程,编程次数无限制。
由于Xilinx FPGA配置数据存储在CMOS配置锁存器(CCL)中,因此必须在断电后对其进行重新配置。
每次通过专用配置引脚将比特流加载到FPGA器件中。
这些配置引脚可以用作多种不同配置模式的接口:•主动-串行配置模式•从(或被动)-串行配置模式•主动-并行(SelectMAP)配置模式(x8和x16)•主动-并行(SelectMAP)配置模式(x8,x16和x32)•JTAG边界扫描模式•主动-串行SPI Flas配置模式(x1,x2,x4)•主动-字节BPI Flash配置模式(x8,x16),使用并行NOR Flash这些配置模式通过输入管脚M[2:0]设置不同的电平进行模式选择。
M2,M1和M0应该连接至DC电压常量,可以直接接GND或者VCCO_0或者通过上拉或下拉电阻(≤1kΩ)连接至GND或者VCCO_0。
上述几种配置模式中主或者从是以配置时钟管脚CCLK的方向为参考的。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
漫谈xilinx FPGA 配置电路
这里要谈的时xilinx的spartan-3系列FPGA的配置电路。
当然了,其它系列的FPGA配置电路都是大同小异的,读者可以类推,重点参考官方提供的datasheet,毕竟那才是最权威的资料。
这里特权同学只是结合自己的理解,用通俗的语言作一点描述。
所谓典型,这里要列出一个市面上最常见的spartan-3的xc3s400的配置电路。
所有spartan-3的FPGA配置电路的链接方式都是一样的。
Xc3s400是40万门FPGA,它的Configuration
Bitstream虽然只有1.699136Mbit,但是它还是需要2Mbit的配置芯片XCF02S,不能想当然的以为我的设计简单,最多用到1Mbit,那么我选XCF01S(1Mbit)就可以了。
事实并非如此,即使你只是用xc3s400做一个流水灯的设计,那么你下载到ROM(XCF02S)里的数据也是1.699136Mbit的,所以对于FPGA的配置ROM的选择宜大不宜小。
配置电路无非有下面五种:主串,从串,主并,从并,JTAG。
前四种是相对于下载到PROM而言的(串并是相对于不同配置芯片是串口和时并口协议和FPGA 通讯区分的),只有JTAG是相对于调试是将配置下载到FPGA的RAM而言的(掉电后丢失)。
FPGA和CPLD相比,CPLD是基于ROM型的,就是在数据下载到CPLD 上,掉电后不丢失。
而FPGA则是基于RAM的,如果没有外部ROM存储配置数据,那么掉电后就丢失数据。
所以FPGA都需要外接有配置芯片(当然现在也有基于FLASH的FPGA出现)。
那么我们就来看一下主串模式下FPGA的配置电路的连接。
官方的硬件连接如下:
为了增加配置电路的可靠性,通常我们我们增加一些抗干扰的设计(如增加滤波电容、匹配电阻):
先看PROM芯片的各个管脚吧。
18,19,20脚就不谈了,根据datasheet给供相对应的电平;3脚CLK是接了FPGA的CCLK,数据通信的同步就是通过FPGA 的CCLK产生的时钟进行的;因为使用的芯片时串行的配置芯片,所以只有一个数据信号口DO,连接到FPGA的DIN口(上图没有画出),和上面的时钟信号协同工作完成串行数据传输,每当CLK的上升沿锁存数据,同时PROM内部的地址计数器自动增加;另外还有两条控制信号线时INIT(连接PROM的OE/RESET)和
DONE(连接PROM的CE),OE/RESET是为了确保每次重新配置前PROM的地址计数器复位;关于CE脚,官方资料说得也不是很详细,以我个人的理解,CE应该是chip enable的缩写,从它和FPGA的DONE脚连接我们不难推断出,FPGA未配置完成时DONE=0,那么配置芯片PROM处于片选状态,而一旦配置完成DONE=1,那么PROM就不再被选通,同时datasheet也说到这个管脚可以直接接地,就是一直片选中,但是这样会使DATA口有持续的数据信号输出,同时导致不必要的电流消耗;CEO脚这里不接,因为它在多个PROM的配置电路中时作为下一个PROM 的OE端信号连接用的;CF信号时连接FPAG的PROG_B接口的,它的作用就是产生开始配置信号,它连接了一个上拉电阻,如果PROG_B产生低电平脉冲则PROM 会重新开始一次配置,所以我们会在这条线上接一个按键到地,如果按键按下那么就会使能PROM重新配置FPGA;还有几个信号接口TDI,TCK,TMS,TDO都是PROM 和PC连接的信号,PC通过这些电路(通常接一片驱动隔离芯片后通过并口通信,这里不重点介绍了)下载数据到PROM中。
上面谈及PROM的信号接口时都附带的谈到了FPGA的配置管脚。
这里再做一些归纳性的说明。
FPGA有7个专用的配置管脚(CCLK,DIN,PROG_B,DONE,HSWAP_EN,M0,M1,M2),4个专用的JTAG管脚(TDI,TCK,TMS,TDO),这些管脚是由VCCAUX专门供电的(该系列FPGA通常接VCCAUX=2.5V)。
FPGA的M0,M1,M2脚是进行配置模式选择用的,该电路主串模式下{M0,M1,M2}=000,如果时JTAG下载模式{M0,M1,M2}=101。
上面没有提及的HSWAP_EN管脚接地,则是用于设置当FPAG处于配置状态下其它闲置管脚为上拉状态,而如果该管脚接高电平,则FPAG处于配置状态下其它闲置管脚浮空。
所以为了减少FPGA配置过程的干扰,一般把此脚接地。