赞
踩
本文介绍Xilinx提供的一种远程更新FPGA程序的方案,该方案是将FPGA外挂的FLASH芯片分为top、bottom两个部分,bottom存储golden程序,top存储update程序,golden区域通过JTAG配置原始的FPGA程序,其中包含升级的逻辑和上电跳转到update区域地址信息,CPU向FPGA发送升级程序通过升级逻辑将程序写入FLASH芯片的top区域。这样,FPGA每次上电通过跳转地址信息跳转到top区域加载update区域的程序,从而实现FPGA升级的功能。
这里跳转地址选择0xF50000。跳转地址是按照相关文档的例程的例子参考。
由于Ultrascale系列FPGA的DQ0~DQ3规划到了FPGA的专用BANK0上面,而在使用BPI加载模式时, FPGA配置完成之后,BPI配置接口通常保持未使用状态,通过使用STARTUPE3原语,就可以使用这些专用引脚,所以可以将CPU写来的数据存储到flash芯片top部分,通过CPU设置FPGA从top部分加载程序,实现FPGA在线升级的功能。
Dual SPI mode is selected when the Mode option in the Vivado IDE is set to Dual. The relevant parameters in this mode are:
• Mode
• Slave Device
• Enable STARTUPEn Primitive
Note: The STARTUPE2 primitive is applicable for 7 series devices. The STARTUPE3 primitive is applicable for UltraScale™ devices.
• Transaction Width
• No. of Slaves
• FIFO Depth
The properties associated with the FIFO are:
• The depth of the FIFO is based on the FIFO Depth option which has valid values of 16 or 256.
• The width of the FIFO is 8-bits because the page size of the SPI slave memories is always 8-bits.
• The quad SPI mode is selected when the Mode option is set to Quad. The behavior of the ports in quad SPI mode is:
• For standard mode SPI instructions, the IO0 and IO1 pins are unidirectional and function the same as in standard SPI mode.
• For dual mode SPI instructions, the IO0 and IO1 pins are unidirectional or bidirectional depending on the type of instruction and memory selected by setting the control register bits. The IO2 and IO3-bits are 3-state.
• For quad mode SPI instructions, the IO0, IO1, IO2, and IO3 pins are unidirectional or bidirectional depending on the type of memory used while transmitting the command, address, and data.
Legacy mode is selected when the Enable Performance Mode option in the Vivado Integrated Design Environment (IDE) is disabled. Legacy mode uses the AXI4-Lite interface and is fully backward compatible(向后兼容) with all the older versions of the AXI Quad SPI core in terms of functionality, register bit placement, and register access.
The AXI Quad SPI core, when configured in Dual/Quad SPI mode, this core supports additional pins for interfacing with external memory. These additional pins are used while transmitting the command, address, and data based on the control register settings and command used.
Note: The AXI4-Lite write access register is updated by the 32-bit AXI Write Data (_wdata) signal. For a Write, both the AXI Write Address Valid (_awvalid) and AXI Write Data Valid (*_wvalid) signals should be asserted together.
Notes:
The following steps briefly describe the erase, write and read command sequence for SPI flash.
Note: [1] The WRITE ENABLE command must be issued before every write transaction (erase/write data to the flash/register write of flash) command to the flash.
Note: [2] The following programming sequence is based on the 24-bit addressing mode of flash and assumes there is only one slave connected to the AXI QUAD SPI core.
set_property BITSTREAM.CONFIG.CONFIGRATE 33 [current_design]
set_property BITSTREAM.CONFIG.SPI_32BIT_ADDR YES [current_design]
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
set_property BITSTREAM.CONFIG.SPI_FALL_EDGE YES [current_design]
set_property CONFIG_MODE SPIx4 [current_design]
set_property BITSTREAM.GENERAL.COMPRESS TRUE [current_design]
set_property BITSTREAM.CONFIG.TIMER_CFG 0x8000000 [current_design]
set_property BITSTREAM.CONFIG.NEXT_CONFIG_ADDR 0x00F50000 [current_design]
set_property BITSTREAM.CONFIG.NEXT_CONFIG_REBOOT ENABLE [current_design]
set_property BITSTREAM.CONFIG.CONFIGFALLBACK ENABLE [current_design]
其中set_property BITSTREAM.CONFIG.TIMER_CFG这一项设置是使能FPGA在上电配置过程中的看门狗计时器,具体的数值没有找到相关参考文档,还希望能够私信探讨。
Xapp1257、pg153、ug908、ug570.
目前方案已经经过平台验证,刚开始写博文,如有问题欢迎私信指正。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。