SPI Flash Config Xilinx FPGAs
SPI Flash Config Xilinx FPGAs
1. Introduction
Xilinx FPGAs are programmable logic devices used for basic logic functions, chip-to-chip connectivity, signal
processing, and embedded processing. These devices are programmed and configured using an array of
SRAM cells that need to be re-programmed on every power-up. Several different methods of configuring
FPGAs are normally used. They include programming by a microprocessor, JTAG port, or directly by a serial
PROM or flash. Spansion's SPI (Serial Peripheral Interface) flash can be easily connected to Xilinx FPGAs in
order to configure the FPGA at power-up. The SPI configuration mode is supported for Xilinx Spartan-6,
Virtex-6, Virtex-5 and Spartan-3E, Spartan-3A, Spartan-3AN and Spartan-3A DSP FPGA families.
The Xilinx iMPACT tool version 11.4 and higher provide SPI Indirect Programming Support of Spansion
S25FL Family SPI flash devices using Xilinx cables connected to the FPGA's JTAG port. The Spansion
32 Mbit S25FL032P, 64 Mbit S25FL064P, and the 128 Mbit S25FL129P are supported for use with Xilinx
Spartan-3A, Spartan-3A DSP, Spartan-6, Virtex-5, and Virtex-6.
Xilinx Spartan- 6 supports Single, Dual, and Quad I/O (x1, x2, x4) configuration with Spansion S25FL-P and
S25FL-K devices in Master Serial Mode.
The Spansion S25FL-K family 8 Mbit to 64 Mbit devcies are only supported by iMPACT for use with
Spartan-6 and Virtex-6.
Spansion S25FL-P and S25FL-K SPI devices require level shifters to interface with Virtex-6 FPGAs.
2. SPI Basics
Serial Peripheral Interface (SPI) is a simple 4-wire synchronous interface protocol which enables a master
device and one or more slave devices to intercommunicate. The SPI bus consists of 4 signal wires:
Master Out Slave In (MOSI) signal generated by the master (data to slave)
Master In Slave Out (MISO) signal generated by the slave (data to master)
Serial Clock (SCK) signal generated by the master to synchronize data transfers
Slave Select (SS#) signal generated by master to select individual slave devices, also known as Chip
Select (CS#) or Chip Enable (CE#)
Following SPI protocol, the master is assigned to the FPGA device and the slave to the SPI flash device, as
shown in Figure 2.1. Per this connection, the SPI flash is available to configure the FPGA at power-up.
Figure 2.1 Direct Configuring FPGA Interface with SPI Flash
Master
MOSI
Slave
MISO
SCK
SS#
SPI Flash
FPGA Device
Revision 03
A pplication
3.
Note
SPI
Flash
FPGA
Header for
SPI Direct
Programming
PC
The following is a detailed explanation of connections between Xilinx FPGA and Spansion SPI flash. The SPI
flash connections to the Virtex-5 and Spartan-3 family FPGA devices are shown in Figure 3.2 and Figure 3.3
respectively. Pin descriptions are listed in Table 3.1 on page 3.
The FPGA supplies the CCLK output from its internal oscillator to drive the clock input of SPI flash. ISP
Control is used to tri-state the FPGA SPI interface signals during In-System Programming to re-program the
configuration data in the SPI flash.
To read configuration data from the SPI flash at power-up, the Xilinx FPGA must issue a read command to
the SPI flash, which it does automatically based on MODE being set to SPI and VS/FS being set to the
correct type of read. The serial flash has two read modes: normal read and fast read. Table 3.2 on page 4
lists the FPGA input logic levels to set up the SPI Master Mode and read configuration.
There are four power supply inputs to the Virtex-5 and Spartan FPGAs associated with configuration. The
required voltages to be applied to these inputs and a description of the power supply usages in configuration
are shown in Table 3.3 on page 4. There are a variety of FPGA sizes under each family covered in this
application note. Table 3.3 on page 4 and Table 3.5 on page 5 list the smallest SPI flash devices required for
typical configuration bit requirements of different members of the Spartan and Virtex-5 families.
Figure 3.2 Virtex-5 Family FPGA Configuration from Spansion SPI Serial Flash Connection Diagram
Header for SPI Flash
In-System Programming
VCCAUX
VCCINT
VCCO_2
+3.3V
Virtex-5
FPGA
HSWAPEN
SI
SO
CS#
SCK
SS#
PROG_B
DONE
INIT_B
4.7 K
+3.3V
4.7 K
SCK
4.7 K
FS2
FS1
FS0
MOSI
MISO
MOSI
D_IN
FCS_B
CCLK
300
SPI Variant
Select
M2
M1
M0
ISP
Control
4.7 K
Mode
Selection
(SPI)
VCC_CONFIG
Spansion
S25FLxxx
SPI Flash
WP#
HOLD#
ISP Control
App l ic atio n
No t e
Figure 3.3 Spartan Family FPGA Configuration from Spansion SPI Serial Flash Connection Diagram
Header for SPI Flash
In-System Programming
VCCAUX
VCCINT
VCCO_0 VCCO_2
+3.3V
MOSI
MISO
SI
SO
CS#
SCK
SS#
+2.5V
4.7 K
4.7 K
+3.3V
4.7 K
SCK
300
SPI Variant
Select
ISP
Control
4.7 K
Mode
Selection
(SPI)
Spartan-3E/-3A/AN
Spartan-3A DSP
M2
FPGA
MOSI
M1
D_IN
M0
CSO_B
CCLK
VS2
VS1
PROG_B
VS0
DONE
HSWAP/
PUDC_B
INIT_B
Spansion
S25FLxxx
SPI Flash
WP#
HOLD#
ISP Control
Table 3.1 Pin Descriptions for FPGA Configuration from SPI Flash
Pin Name
Type
FPGA Family
M[2:0]
Input
Virtex5/
Spartan
FS[2:0]
Input
Virtex5
Description
Mode Pins. Selects FPGA configuration mode. M[2:0] = '001' defines Master SPI Mode.
Variant Select. Instructs the Virtex-5 FPGA how to communicate with the attached SPI
flash device.
FS[2:0] = '101' for Read
FS[2:0] = '111' for Fast Read
VS[2:0]
Input
Spartan
Variant Select. Instructs the Spartan FPGA how to communicate with the attached SPI
flash device.
VS[2:0] = '101' for Read
VS[2:0] = '111' for Fast Read
Input
Virtex5/
Spartan
User I/O Pull-up Control During Configuration. When Low during configuration, enables
pull-up resistors in all I/O pins to respective I/O bank VCCO input:
0 = Pull-ups during configuration
MOSI
Output
Virtex5/
Spartan
Master Out Slave In. Used by the FPGA to specify the instruction to execute or to send
data to the SPI flash device.
DIN
Input
Virtex5/
Spartan
Data Input. Used by the FPGA to collect data transferred from the SPI flash device.
CCLK
Output
Virtex5/
Spartan
Configuration Clock. Provides the synchronous timing for the SPI interface.
CSO_B
Output
Spartan
Chip Select Output. Connects to the SPI flash Chip Select input, and is Active Low.
FCS_B
Output
Virtex5
Chip Select Output. Connects to the SPI flash Chip Select input, and is Active Low.
INIT_B
Open-drain
bi-direct. I/O
Virtex5/
Spartan
Initialization Indicator. Goes active low during configuration. Requires an external 4.7 K
pull-up resistor for this signal.
DONE
Open-drain
bi-direct. I/O
Virtex5/
Spartan
FPGA Configuration Done. Is Low during configuration and goes High when
configuration is successfully completed. Requires external 300-330 K pull-up resistor for
this signal.
PROG_B
Input
Virtex5/
Spartan
Program FPGA. When asserted Low, it forces the FPGA to restart its configuration
process by clearing configuration memory and resetting the DONE and INIT_B pins.
Return High to allow configuration to start. Requires an external 4.7 K pull-up resistor for
this signal. If driving externally, use an open-drain or open-collector driver.
DOUT
Output DualPurpose
Spartan
Serial data output for downstream daisy-chained devices. Data provided on the falling
edge of CCLK.
HSWAPEN/
HSWAP/
PUDC_B
A pplication
Note
Function
Virtex-5/ Spartan
Virtex-5
Spartan
Signal
M2
M1
M0
FS2
1/1
FS1
0/1
FS0
1/1
VS2
1/1
VS1
0/1
VS0
1/1
Power Supply
Applied Voltage
VCCAUX
+2.5V
Description
VCCO_2
+3.3V
VCC_CONFIG
+3.3V
VCCINT
+1.0V
VCCAUX
+2.5V or +3.5V(1)
VCCO_0
+3.3V
VCCO_2
+3.3V
VCCINT
+1.2V
Virtex-5
Spartan
Note:
1. Spartan-3A/AN/ADSP allows either 2.5V or 3.5V for VCCAUX.
Table 3.4 SPI Flash Selection for Spartan Family FPGA Devices
Family
Spartan-3A/3AN
FPGA
# of Configuration Bits
XC3S50A/AN
437,312
512 Kb (S25FL004K)
XC3S200A/AN
1,196,128
2 Mb (S25FL004K)
XC3S400A/AN
1,886,560
2 Mb (S25FL004K)
XC3S700A/AN
2,732,640
4 Mb (S25FL004K)
XC3S1400A/AN
4,755,296
8 Mb (S25FL008K)
XC3SD1800A
8,197,280
8 Mb (S25FL008K)
XC3SD3400A
11,718,304
16 Mb (S25FL016K)
XC3S100E
581,344
1 Mb (S25FL004K)
XC3S250E
1,353,728
2 Mb (S25FL004K)
XC3S500E
2,270,208
4 Mb (S25FL004K)
XC3S1200E
3,841,184
4 Mb (S25FL004K)
XC3S1600E
5,969,696
8 Mb (S25FL008K)
Spartan-3A DSP
Spartan-3E
Note:
1. S25FL-K family SPI flash devices are not supported by iMPACT with Spartan-3 FPGAs.
App l ic atio n
No t e
Table 3.5 SPI Flash Selection for Virtex-5 Family FPGA Devices
FPGA
# of Configuration Bits
XC5VLX30
8,374,016
8 Mb (S25FL008K)
XC5VLX50
12,556,672
16 Mb (S25FL016K)
XC5VLX85
21,845,632
32 Mb (S25FL032P)
XC5VLX110
29,124,608
32 Mb (S25FL032P)
XC5VLX220
53,139,456
64 Mb (S25FL064P)
XC5VLX330
79,704,832
128 Mb (S25FL129P)
XC5VLX30T
9,371,136
16 Mb (S25FL016K)
XC5VLX50T
14,052,352
16 Mb (S25FL016K)
XC5VLX85T
23,341,312
32 Mb (S25FL032P)
XC5VLX110T
31,118,848
32 Mb (S25FL032P)
XC5VLX330T
82,696,192
128 Mb (S25FL129P)
Note:
1. S25FL-K family SPI flash devices are not supported by iMPACT with Virtex-5 FPGAs.
Table 3.6 SPI Flash Selection for Spartan-6 Family FPGA Devices
FPGA
# of Configuration Bits
XC6SLX4
2.7
4 Mb (S25FL008K)
XC6SLX9
2.7
4 Mb (S25FL008K)
XC6SLX16
3.7
4 Mb (S25FL008K)
XC6SLX25
6.4
8 Mb (S25FL008K)
XC6SLX45
11.9
16 Mb (S25FL016K)
XC6SLX75
19.6
32 Mb (S25FL032P)
XC6SLX100
26.5
32 Mb (S25FL032P)
64 Mb (S25FL064P)
XC6SLX150
33.8
XC6SLX25T
6.4
8 Mb (S25FL008K)
XC6SLX45T
11.9
16 Mb (S25FL016K)
XC6SLX75T
19.6
32 Mb (S25FL032P)
XC6SLX100T
26.5
32 Mb (S25FL032P)
XC6SLX150T
33.8
64 Mb (S25FL064P)
A pplication
Note
Table 3.7 SPI Flash Selection for Virtex-6 Family FPGA Devices
FPGA
# of Configuration Bits
XC6VLX75T
25.0
32 Mb (S25FL032P)
XC6VLX130T
41.7
64 Mb (S25FL064P)
XC6VLX195T
58.7
64 Mb (S25FL064P)
XC6VLX240T
70.4
128 Mb (S25FL129P)
XC6VLX365T
91.6
128 Mb (S25FL129P)
XC6VLX550T
137.4
XC6VLX760
176.3
XC6VSX315T
99.6
128 Mb (S25FL129P)
XC6VSX475T
149.4
XC6VHX250T
76.2
XC6VHX255T
76.2
128 Mb (S25FL129P)
XC6VHX380T
114.2
128 Mb (S25FL129P)
XC6VHX565T
153.2
128 Mb (S25FL129P)
Note:
1. Master Serial/ SPI with SPI flash
The Spartan-6 FPGA drives the SPI PROM Clock as the SPI PROM provides serial (x1, x2, x4) configuration data to the Spartan-6
FPGA.
Figure 3.4 Spartan-6 serial (x1, x2, x4) Configuration from Spansion S25FL-P and S25FL-K SPI Quad I/O
Serial Flash Connection Diagram
Spansion
S25FLxxx
SPI Flash
SPARTAN-6
CCLK
SCK
CS0_B
CS#
MOSI/MISO(0)
DIN/DO/MISO/MISO(1)
SI/IO0
SO/IO1
MISO(2)
W#/ACC/IO2
MISO(3)
HOLD#/IO3
4. Other Considerations
There are three other considerations related to connecting SPI flash to a Xilinx FPGA that are pertinent to this
application note. First, since the power-up timing and voltage thresholds are different for both FPGAs and SPI
serial flash devices, it is important to carefully review the differences to insure compatibility between devices
on power-up. Second, review the control signal that is required to enable direct SPI flash programming insystem is described. Third, discuss the components contributing to the fastest configuration time from
Spansion SPI flash to Xilinx FPGA.
App l ic atio n
4.1
No t e
+3.3V
VCCO_2
VCC
SPI
FPGA
INIT_B
RESET#
Power
Monitor
One example of the Power Monitor Supervisor is the Analog Devices ADM6384x27D2. The RESET#
signal from this device is held Low until its power supply voltage reaches 2.7V + 20 ms (tRP time),
which is shown in Figure 4.2.
A pplication
Note
RESET#
2. Attach R-C delay circuit to the INIT-B pin as seen in Figure 4.3, which forces the FPGA to wait for a
preselected period of time after its memory clearing process before allowing the FPGA to continue
its configuration process. Minimum INIT_B threshold voltage is used in determining the R-C
component values. In this case, the voltage input to INIT_B is 0.8 V. Using the component values
recommended by Xilinx. In Figure 4.3, the delay to configuration start is 90 milliseconds.
Note that this method is highly susceptible to temperature and voltage conditions. This method is not
recommended by Spansion.
Figure 4.3 Power-on Reset Using R-C Delay Circuit
+3.3V
VCCO_2
VCC
SPI
FPGA
150 k
INIT_B
2.2 F
4.2
App l ic atio n
No t e
available through a Xilinx software utility (XSPI), which allows ID check to be skipped for non-supported SPI
flash devices. For more details, go to http://www.xilinx.com/support/answers/29578.htm.
4.3
Spansion
S25FLxxx
SPI Flash
Xilinx
FPGA
MOSI
D_IN
FCS_B
CCLK
SPI Signals
MOSI
SI
S0
SS#
CS#
SCK
(clock)
SCK
Figure 4.4 shows the two signal paths of the SPI interface involved in passing configuration data to the FPGA
at power-on. The FPGA provides the configuration clock (CCLK) speed to transmit the data, while the
configuration data passes from SPI flash SO output to the D_IN input of the FPGA.
The DIN input setup and hold times determine the minimum input data pulse width that the FPGA requires
from the SPI flash for each configuration data bit it receives. Its complement on the SPI flash side, the delay
and hold times of SPI flash determine the output pulse width per data bit that the SPI flash SO output offers to
the FPGA. So what this means in terms of the SO-to-DIN SPI interface: The SPI flash SO output pulse width
must be greater than or equal to the minimum DIN pulse width requirement to satisfy the DIN data valid
requirement, as seen in Figure 4.5. As the CCLK frequency increases, shown in the figure as the tCCLK period
decreasing, the tV and tHO times approach the setup and hold times of the FPGA. When these times touch
the FPGA data valid bandwidth boundaries, then tCCLK will have achieved maximum frequency bandwidth.
A pplication
Note
Figure 4.5 SPI Flash Serial Output (SO) to Xilinx Data Input (DIN) Timing
tCCLK
CCLK
tTv
V
tHO
SO
tDIN_HO
tDIN_SU
Data
Valid
DIN
Therefore,
Minimum DIN input data pulse width for FPGA = tDIN_SU + tDIN_HO
SPI Flash
tV
tHO
tSCK
= CCLK frequency setting via the system clock or programmed into the FPGA
via its ConfigRate options
Thus,
Minimum SO output data pulse width = tCCLK - (tV - tHO)
4.3.1
Potential Bandwidth
Potential bandwidth corresponds to the fastest frequency the SPI interface can be run, limited only by the
setup, hold and delay times associated with the SO output and DIN input. Mathematically, the equation for
maximum frequency (fMAX) is the inverse of the setup, hold and delay times associated with the interface,
namely:
fMAX = 1 / [(tV + tHO)SPI Flash+ (tDIN_SU + tDIN_HO)FPGA]
4.3.1.1
Virtex-5 Example
Maximum potential frequencies for Virtex-5 FPGAs is:
tDIN_SU = 4 ns, tDIN_HO = 0 ns
For S25FL-P SPI flash, the SO delay and hold times are:
tV = 8 ns, tHO = 0 ns
Therefore, fMAX = 1/ (8ns + 0 + 4ns + 0) = 83.33 MHz
10
App l ic atio n
4.3.1.2
No t e
Spartan-3E Example
Another example would be to look at the fastest configuration time for a Spartan-3E FPGA example.
The setup time (7 ns min.) and hold time (0 ns) for a Spartan-3E device when connected to a Spansion
S25FL-A SPI flash (tV = 9 ns and tHO = 0) produces a maximum operating frequency of:
fMAX = 1/ (9ns + 0 + 7ns + 0) = 62.5 MHz
4.3.2
Available Bandwidth
The Available Frequency Bandwidth equals the Potential Bandwidth minus the Configuration Clock
Frequency (tCCLK). Mathematically,
Available Frequency Bandwidth = [1 / (tV + tHO + tDIN_SU + tDIN_HO)] - [1/tCCLK]
The meaning of this equation is that there is available bandwidth as long as the current FPGA configuration
clock frequency (1/tCCLK) is less that the Potential Bandwidth, which means that a higher SPI clock frequency
can be connected to the SPI flash up to the point that there is no more available bandwidth.
4.3.3
Suppose the Virtex-5 application has an embedded XC5VLX330 FPGA with 79,704,832 configuration bits.
Each tCCLK clock pulse from the FPGA inputs one configuration bit into the FPGA. So the fastest
configuration time for our example assumes that the Spansion S25FL128P SPI flash device is run at the
maximum clock rate of 83.33 MHz previously described. The fastest configuration time for this example is:
Picking an XC3X1600E Spartan-3E device for our example application, the fastest configuration time that can
be expected is:
4.4
11
A pplication
Note
5. References
1. Xilinx Spartan-3 Generation Configuration User Guide UG332
2. Xilinx Virtex-5 FPGA Configuration User Guide UG191
3. Xilinx Application Note XAPP951: Configuring Xilinx FPGAs with SPI Serial Flash
4. Spartan-6 FPGA Configuration User Guide UG380
http://www.xilinx.com/support/documentation/user_guides/ug380.pdf
5. Xilinx Application Note XAPP899: Interfacing Virtex-6 FPGAs with 3.3V I/O Standards
http://www.xilinx.com/support/documentation/application_notes/xapp899.pdf
12
App l ic atio n
No t e
6. Revision History
Section
Description
Added DOUT to table: Pin Descriptions for FPGA Configuration from SPI Flash
Updated table: SPI Flash Selection for Spartan Family FPGA Devices
Updated tabel: SPI Flash Selection for Virtex-5 Family FPGA Devices
Added table: SPI Flash Selection for Spartan-6 Family FPGA Devices
Added table: SPI Flash Selection for Virtex-6 Family FPGA Devices
Added figure: Spartan-6 serial (x1, x2, x4) Configuration from Spansion S25FL-P and S25FL-K SPI
Quad I/O Serial Flash Connection Diagram
Updated section
Added section
References
Added references
13
A pplication
Note
Colophon
The products described in this document are designed, developed and manufactured as contemplated for general use, including without
limitation, ordinary industrial use, general office use, personal use, and household use, but are not designed, developed and manufactured as
contemplated (1) for any use that includes fatal risks or dangers that, unless extremely high safety is secured, could have a serious effect to the
public, and could lead directly to death, personal injury, severe physical damage or other loss (i.e., nuclear reaction control in nuclear facility,
aircraft flight control, air traffic control, mass transport control, medical life support system, missile launch control in weapon system), or (2) for
any use where chance of failure is intolerable (i.e., submersible repeater and artificial satellite). Please note that Spansion will not be liable to
you and/or any third party for any claims or damages arising in connection with above-mentioned uses of the products. Any semiconductor
devices have an inherent chance of failure. You must protect against injury, damage or loss from such failures by incorporating safety design
measures into your facility and equipment such as redundancy, fire protection, and prevention of over-current levels and other abnormal
operating conditions. If any products described in this document represent goods or technologies subject to certain restrictions on export under
the Foreign Exchange and Foreign Trade Law of Japan, the US Export Administration Regulations or the applicable laws of any other country,
the prior authorization by the respective government entity will be required for export of those products.
Trademarks and Notice
The contents of this document are subject to change without notice. This document may contain information on a Spansion product under
development by Spansion. Spansion reserves the right to change or discontinue work on any product without notice. The information in this
document is provided as is without warranty or guarantee of any kind as to its accuracy, completeness, operability, fitness for particular purpose,
merchantability, non-infringement of third-party rights, or any other warranty, express, implied, or statutory. Spansion assumes no liability for any
damages of any kind arising out of the use of the information in this document.
Copyright 2008-2011 Spansion Inc. All rights reserved. Spansion, the Spansion logo, MirrorBit, MirrorBit Eclipse, ORNAND, EcoRAM
and combinations thereof, are trademarks and registered trademarks of Spansion LLC in the United States and other countries. Other names
used are for informational purposes only and may be trademarks of their respective owners.
14