Spartan 3A DSP Family Configuration Guide From XIlinx
Spartan 3A DSP Family Configuration Guide From XIlinx
Configuration User
Guide
Extended Spartan-3A,
Spartan-3E, and Spartan-3
FPGA Families
UG332 (v1.6) October 26, 2009
Xilinx is disclosing this user guide, manual, release note, and/or specification (the "Documentation") to you solely for use in the development
of designs to operate with Xilinx hardware devices. You may not reproduce, distribute, republish, download, display, post, or transmit the
Documentation in any form or by any means including, but not limited to, electronic, mechanical, photocopying, recording, or otherwise,
without the prior written consent of Xilinx. Xilinx expressly disclaims any liability arising out of your use of the Documentation. Xilinx reserves
the right, at its sole discretion, to change the Documentation without notice at any time. Xilinx assumes no obligation to correct any errors
contained in the Documentation, or to advise you of any corrections or updates. Xilinx expressly disclaims any liability in connection with
technical support or assistance that may be provided to you in connection with the Information.
THE DOCUMENTATION IS DISCLOSED TO YOU AS-IS WITH NO WARRANTY OF ANY KIND. XILINX MAKES NO OTHER
WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, REGARDING THE DOCUMENTATION, INCLUDING ANY
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT OF THIRD-PARTY
RIGHTS. IN NO EVENT WILL XILINX BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, EXEMPLARY, SPECIAL, OR INCIDENTAL
DAMAGES, INCLUDING ANY LOSS OF DATA OR LOST PROFITS, ARISING FROM YOUR USE OF THE DOCUMENTATION.
20062009, Inc. All rights reserved. XILINX, the Xilinx logo, and other designated brands included herein are trademarks of Xilinx, Inc. All
other trademarks are the property of their respective owners.
www.xilinx.com
Revision History
The following table shows the revision history for this document.
Date
Version
12/05/06
1.0
Initial release.
02/26/07
1.1
05/23/07
1.2
11/21/07
1.3
07/01/08
1.4
Revision
www.xilinx.com
Date
Version
Revision (Contd)
03/16/09
1.5
Updated nomenclature for Extended Spartan-3A family. Added fifth paragraph below
Overview and Design Considerations, page 27. Added Additional Resources,
page 47, and VCCAUX Level, page 77. Revised Table 5-6, page 152, Figure 5-6,
page 160, and Figure 5-14, page 170. Revised Table 14-8, page 282. Added Chapter 17,
Configuration Details and Chapter 18, Readback.
10/26/09
1.6
www.xilinx.com
Table of Contents
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Schedule of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
Schedule of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Data Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
Application Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
www.xilinx.com
Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Pin Behavior During Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Extended Spartan-3A Family FPGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
Spartan-3E FPGAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
Spartan-3 FPGAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
VCCAUX Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
www.xilinx.com
87
89
89
91
ConfigRate: CCLK Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
StartupClk: CCLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
DriveDone: Actively Drive DONE Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
GTS_cycle: Global Three-State Release Timing for Daisy Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
www.xilinx.com
143
145
146
150
151
151
152
153
154
155
Parallel Daisy Chaining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156
Serial Daisy Chaining (Extended Spartan-3A Family FPGAs Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157
Using Xilinx Platform Flash PROMs with Master BPI Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
ConfigRate Settings Using Platform Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161
www.xilinx.com
170
172
172
173
Persist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
SelectMAP Reconfiguration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
SelectMAP Data Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Byte Swapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193
200
201
201
201
201
Test Access Port (TAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202
TAP Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204
Boundary-Scan Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205
Boundary-Scan Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205
Bit Sequence Boundary-Scan Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206
Instruction Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207
BYPASS Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
Identification (IDCODE) Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
JTAG Configuration Register (Boundary-Scan) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
USERCODE Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209
USER1 and USER2 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209
www.xilinx.com
10
www.xilinx.com
Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Startup Clock Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253
Waiting for DCMs to Lock, DCI to Match . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253
www.xilinx.com
11
12
www.xilinx.com
www.xilinx.com
13
14
www.xilinx.com
Schedule of Figures
Chapter 1: Overview and Design Considerations
Figure 1-1: Spartan-3 Generation Self-Loading (Master) Configuration Modes . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 1-2: Spartan-3 Generation Downloaded (Slave) Configuration Modes. . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 1-3: Spartan-3 Generation Configuration Daisy-Chain Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 1-4: Extended Spartan-3A Family Type 1 Packet Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 1-5: Setting Bitstream Generator Options from ISE Project Navigator . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 1-6: Bitstream Generator General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Figure 1-7: Bitstream Generator Configuration Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Figure 1-8: Bitstream Generator Startup Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 1-9: Bitstream Generator Readback Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
www.xilinx.com
15
16
www.xilinx.com
www.xilinx.com
17
18
www.xilinx.com
www.xilinx.com
19
Figure 16-3: Checking Block RAM Contents Using Simple Parity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
20
www.xilinx.com
Schedule of Tables
Chapter 1: Overview and Design Considerations
Table 1-1: Spartan-3 Generation Self-Loading Configuration Modes and Memory Sources. . . . . . . . . . . . . 29
Table 1-2: Spartan-3 Generation Configuration Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Table 1-3: PROM Families and Footprint Compatible Package Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Table 1-4: Number of Bits in an Uncompressed FPGA Bitstream Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Table 1-5: Configuration Data Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Table 1-6: Maximum CCLK Frequency When Using Compressed Bitstream . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Table 1-7: Command Line to Review Bitstream Generator Options per Family. . . . . . . . . . . . . . . . . . . . . . . . 46
www.xilinx.com
21
Table 3-4: Number of Bits to Program a Spartan-3 Generation FPGA and Smallest Platform Flash PROM 85
Table 3-5: Maximum ConfigRate Settings Using Platform Flash (Serial Mode, Commercial Range) . . . . . 86
Table 3-6: Xilinx Platform Flash Production Programmers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
22
www.xilinx.com
www.xilinx.com
23
24
www.xilinx.com
www.xilinx.com
25
26
www.xilinx.com
Chapter 1
Design Considerations
Before starting a new FPGA design, spend a few minutes to consider which FPGA
configuration mode best matches your system requirements. Each configuration mode
dedicates certain FPGA pins and may borrow others. Similarly, the configuration mode
may place voltage restrictions on some FPGA I/O banks.
www.xilinx.com
27
If you have already selected an FPGA configuration mode, feel free to jump to the relevant
section in the user guide. Otherwise, please evaluate the following design considerations
to understand the options available.
Will the FPGA load configuration data itself from external or internal memory
or will an external processor/microcontroller download configuration data?
Spartan-3 generation FPGAs are designed for maximum flexibility. The FPGA either
automatically loads itself with configuration data, like a processor, or alternatively, another
external intelligent device like a processor or microcontroller can download the
configuration data. It is your choice and Table 1-2 summarizes the available options.
The self-loading FPGA configuration modes, generically called Master modes, are
available with either a serial or byte-wide data path as shown in Figure 1-1. The Master
modes leverage various types of nonvolatile memories to store the FPGA's configuration
information, as shown in Table 1-1. In Master mode, the FPGA's configuration bitstream
typically resides in nonvolatile memory on the same board, generally external to the
FPGA. The FPGA internally generates a configuration clock signal called CCLK and the
FPGA controls the configuration process.
Spartan-3AN FPGAs optionally configure from internal In-System Flash (ISF) memory, as
shown in Figure 1-1c. In this mode, the configuration memory and the control and data
signals are inside the package. Spartan-3AN FPGAs also optionally support all the other
Spartan-3A FPGA configuration modes, as well.
28
www.xilinx.com
Design Considerations
Serial
Spartan-3
Generation
FPGA
Byte-Wide
Xilinx
Platform Flash
PROM
DIN
CCLK
Spartan-3E/
Spartan-3A/3AN/3A DSP
FPGA
D0 XCFxxS
XCFxxP
CLK
LDC0
CE#
LDC1
OE#
HDC
WE#
LDC2
D[7:0]
Spartan-3E/
Spartan-3A/3AN/3A DSP
FPGA
SPI Serial
Flash
Parallel NOR
Flash
BYTE#
DATA[7:0]
ADDR[n:0]
ADDR[n:0]
n+1
MOSI
DIN
CSO_B
CCLK
DATA_IN
DATA_OUT
Xilinx XCFxxP
Platform Flash
PROM
Spartan-3
FPGA(1)
SELECT
CLOCK
8
D[7:0]
D[7:0]
XCFxxP
CLK
In-System Flash
(ISF) Memory
Figure 1-1:
Table 1-1:
Information on
FPGA Configuration Mode
All
www.xilinx.com
29
Table 1-1:
Information on
FPGA Configuration Mode
Commodity Parallel
NOR Flash PROM
The downloaded FPGA configuration modes, generically called Slave modes, are also
available with either a serial or byte-wide data path. In Slave mode, an external intelligent
agent such as a processor, microcontroller, DSP processor, or tester downloads the
configuration image into the FPGA, as shown in Figure 1-2. The advantage of the Slave
configuration modes is that the FPGA bitstream can reside just about anywhere in the
overall system. The bitstream could reside in Flash, on board, along with the host
processor's code. It could reside on a hard disk. It could originate somewhere over a
network connection. The possibilities are nearly endless.
Serial
Processor,
Microcontroller
Byte-Wide
Spartan-3
Generation
FPGA
Spartan-3
Generation
FPGA
Processor,
Microcontroller
8
SERIAL_DATA
CLOCK
DIN
CCLK
Spartan-3
Generation
FPGA
DATA[7:0]
D[7:0]
SELECT
CSI_B
READ/WRITE
RDWR_B
READY/BUSY
BUSY
CLOCK
CCLK
TDI
MODE_SELECT
TMS
CLOCK
TCK
DATA_IN
TDO
Figure 1-2:
The Slave Parallel mode, also called SelectMAP mode in other FPGA architectures, is
essentially a simple byte-wide processor peripheral interface, including a chip-select input
and a read/write control input. The Slave Serial mode is extremely simple, consisting only
of a clock and serial data input.
The four-wire JTAG interface is common on many board testers and debugging hardware.
In fact, the Xilinx programming cables for Spartan-3 generation FPGAs, listed below, use
the JTAG interface for prototype download and debugging. Regardless of which
configuration mode is ultimately used in the application, it is best to also include a JTAG
30
www.xilinx.com
Design Considerations
configuration path for easy design development. Also see Programming Cables and
Headers, page 209.
Parallel Cable IV
http://www.xilinx.com/products/devkits/HW-PC4.htm
Table 1-2:
Spartan-3
Generation
Families
SPI
BPI
Master
Parallel
Internal
Master SPI
Slave
Parallel
Slave Serial
JTAG
Spartan-3A
Spartan-3AN
Spartan-3A
Spartan-3AN
Spartan-3
only
Spartan-3AN
only
All
All
All
Spartan-3A DSP
Spartan-3A DSP
Spartan-3E
Spartan-3E
<0:0:0>
<0:0:1>
<0:1:0>=Up
Spartan-3E
only:
<0:1:1>=Dow
n
<0:1:1:
<0:1:1>
<1:1:0>
<1:1:1>
<1:0:1>
Serial
Serial
Byte-wide
Byte-wide
Serial
Byte-wide
Serial
Serial
Commodity
parallel NOR
Flash or Xilinx
parallel
Platform
Flash
Xilinx
parallel
Platform
Flash, etc.
Any source
via microcontroller,
CPU, Xilinx
parallel
Platform
Flash, etc.
Any source
via microcontroller,
CPU, Xilinx
Platform
Flash, etc.
Any source
via microcontroller,
CPU, System
ACE CF,
etc.
All
M[2:0] mode
pin settings
Data width
Xilinx
Platform
Configuration Flash
Commodity
SPI serial
Flash
memory
source
Internal InSystem
Flash (ISF)
memory
Internal oscillator
Clock source
Total I/O pins
borrowed
during
configuration
Configuration
mode for
downstream
daisy-chained
FPGAs
Stand-alone
FPGA
applications
(no external
download
host)
External
clock on TCK
pin
13
46
12
21
Slave
Serial
Slave Serial
Slave Parallel
Extended
Spartan-3A
family only:
Slave Serial
Slave
Serial
Not
Supported
Slave
Parallel or
Memory
Mapped
Slave Serial
JTAG
www.xilinx.com
Possible
using
XCFxxP
Platform
Flash, which
optionally
generates
CCLK
Possible
using
XCFxxP
Platform
Flash,
which
optionally
generates
CCLK
31
32
www.xilinx.com
Design Considerations
Xilinx
FPGA
First FPGA
DOUT
DIN
CCLK
CCLK
Xilinx
FPGA
DOUT
DIN
DOUT
CCLK
Xilinx
FPGA
DIN
DOUT
CCLK
Xilinx
FPGA
TDI
TDO
TDO
Xilinx
FPGA
TDI
TMS
TMS
TMS
TCK
TCK
TCK
TDO
Select_FPGA1
Spartan-3
Generation
FPGA
D[7:0]
D[7:0]
CSI_B
CSI_B
RDWR_B
RDWR_B
BUSY
BUSY
CCLK
CCLK
Select_FPGA2
Figure 1-3:
www.xilinx.com
33
Is there spare external nonvolatile memory already available in the system in which to
store the FPGA configuration bitstream(s)? The bitstream image can be stored in
system memory, stored on a hard drive, or even downloaded remotely over a network
connection. If so, consider one of the downloaded modes, Master Parallel Mode, Slave
Serial Mode, or JTAG Configuration Mode and Boundary-Scan.
Is there a way to consolidate the nonvolatile memory required in the application? For
example, can the FPGA configuration bitstream(s) be stored with any processor code
for the board? If the processor is a MicroBlaze soft processor core embedded in the
FPGA, the FPGA configuration data and the MicroBlaze code can easily share the
same nonvolatile memory device.
Spartan-3A and Spartan-3E FPGAs optionally configure from commodity SPI serial
Flash and parallel NOR Flash memories. Because these memories have common
footprints and multiple suppliers, they may have lower pricing due to the highlycompetitive marketplace.
34
At the same clock frequency, parallel configuration modes are inherently faster than
the serial modes, since they program 8 bits at a time.
In Master modes, the FPGA internally generates the CCLK configuration clock signal.
By default, the CCLK frequency starts out low but can be increased using the
ConfigRate bitstream option. The maximum supported CCLK frequency setting
depends on the read specifications for the attached nonvolatile memory. A faster
memory may allow for faster configuration.
Furthermore, in Master modes, the FPGA's CCLK output frequency varies with
process, voltage, and temperature. The fastest guaranteed configuration rate depends
on the slowest guaranteed CCLK frequency as shown in the respective data sheet. If
an external clock is available on the board, it is also possible to configure the FPGA in
a Slave mode while still using an attached nonvolatile memory.
www.xilinx.com
Design Considerations
Spartan-3E and Spartan-3A/3A DSP FPGAs can configure directly from external
commodity serial or parallel Flash PROMs.
The Flash PROM address, data, and control pins are only borrowed by the FPGA
during configuration. After configuration, the FPGA has full read/write control over
these pins.
The FPGA configuration bitstreams and the applications nonvolatile data can share
the same PROM, reducing overall system cost.
See Chapter 4, Master SPI Mode or Chapter 5, Master BPI Mode for additional
information.
Should the FPGA I/O pins be pulled High via resistors during configuration?
Some of the FPGA pins used during configuration have dedicated pull-up resistors during
configuration. However, the majority of user-I/O pins have optional pull-up resistors that can
be enabled during the configuration process. During configuration, a single control line
determines whether the pull-up resistors are enabled or disabled. The name of the control pin
varies by Spartan-3 generation family. On Extended Spartan-3A family FPGAs, this pin is called
www.xilinx.com
35
PUDC_B (pull-up during configuration, active Low) and on Spartan-3E FPGAs, this same pin is
called HSWAP, short for hot-swap. On Spartan-3 FPGAs, the same pin is called HSWAP_EN.
Why enable the pull-up resistors during configuration? Floating signal levels are problematic in
CMOS logic systems. Other logic components in the system may require a valid input level
from the FPGA. The internal pull-up resistors generate a logic High level on each pin.
Generally, a device driving signals into the FPGA can overcome the pull-up resistor. Similarly,
an individual pin can be pulled down using an appropriately-sized external pull-down resistor.
Why disable pull-up resistors during configuration? In hot-swap or hot-insertion applications,
the pull-up resistors provide a potential current path to the I/O power rail. Turning off the pullup resistors disables this potential path. However, then external pull-up or pull-down resistors
may be required on each individual I/O pin.
See Pull-Up Resistors During Configuration, page 62 for additional information.
36
www.xilinx.com
Table 1-3:
Config.
Mode
Master
Serial
Mode
Master
SPI Mode
Master
BPI Mode
Design Considerations
Package
Option
1M
2M
4M
8M
16M
32M
64M
XCFxxS serial
Platform Flash
VO20
XCF01S
XCF02S
XCF04S
XCFxxP parallel
Platform Flash
VO48
XCF08P
XCF16P
XCF32P
FS48
XCF08P
XCF16P
XCF32P
321D
642D
ST-compatible
SPI Flash
(Multi-Package
Footprint)
8SOIC JEDEC
8SOIC EIAJ
16SOIC
8MLP
Atmel
AT45DBxxxD
SPI Flash
(Multi-Package
Footprint)
8SOIC JEDEC
8SOIC EIAJ
8CASON
x8 Parallel NOR
Flash
40-pin TSOP
x8/x16 Parallel
NOR Flash
48-pin TSOP
x8 or x8/x16
Parallel NOR
Flash
48-ball FBGA
011D
021D
041D
081D
161D
Notes:
1. Platform Flash PROMs also work in Master BPI mode, as described in Using Xilinx Platform Flash PROMs with Master BPI Mode,
page 159.
The SPI serial Flash vendors offer a wider migration range but do require a multi-package
footprint. For example, the Atmel DataFlash SPI serial Flash family spans the range of
1 Mbit to 64 Mbit using a single footprint that accommodates the JEDEC and EIAJ versions
of the 8-pin SOIC package along with the 8-connector CASON package. The STMicro
(Numonyx) SPI serial Flash has uses a different footprint that uses a combined 8-pin and
16-pin SOIC footprint and is also compatible with devices from multiple SPI Flash
vendors. See Multi-Package Layout, page 141.
Similarly, parallel Flash supports a wide density range in a common, multi-vendor
package footprint.
www.xilinx.com
37
Do you want to load multiple FPGAs with the same configuration bitstream?
Generally, there is one configuration bitstream image per FPGA in a system. As shown in
Figure 1-3, multiple, different FPGA bitstream images can share a single configuration
PROM by leveraging a configuration daisy-chain. However, what if all the FPGAs in the
application have the same part number and use the same bitstream? Fortunately, in this
case, only a single bitstream image is required. An alternative solution, called a ganged or
broad-side configuration, loads multiple, similar FPGAs with the same bitstream. See
Figure 3-5, page 88 or Figure 4-7, page 120 for an example.
Caution! The Spartan-3AN FPGA family does not support configuration daisy-chains when
configured using the Internal Master SPI mode.
38
www.xilinx.com
Table 1-4:
Spartan-3 Generation
FPGA Family
Spartan-3A/3AN FPGA
Number of
Configuration Bits
XC3S50A/AN
437,312
XC3S200A/AN
1,196,128
XC3S400A/AN
1,886,560
XC3S700A/AN
2,732,640
XC3S1400A/AN
4,755,296
XC3SD1800A
8,197,280
XC3SD3400A
11,718,304
XC3S100E
581,344
XC3S250E
1,353,728
XC3S500E
2,270,208
XC3S1200E
3,841,184
XC3S1600E
5,969,696
XC3S50
439,264
XC3S200
1,047,616
XC3S400
1,699,136
XC3S1000
3,223,488
XC3S1500
5,214,784
XC3S2000
7,673,024
XC3S4000
11,316,864
XC3S5000
13,271,936
Spartan-3E FPGA
Spartan-3 FPGA
Bitstream Format
The typical FPGA user does not need a bit-level understanding of the configuration
stream. However, for the purpose of understanding configuration options and for
debugging, an overview of the bitstream format is helpful. For more details, see the
chapter Configuration Details and XAPP452: Spartan-3 FPGA Advanced Configuration
Architecture.
Synchronization Word
Embedded at the beginning of an FPGA configuration bitstream is a special
synchronization word. The synchronization word alerts the FPGA to upcoming
configuration data and aligns the configuration data with the internal configuration logic.
Any data on the configuration input pins prior to synchronization is ignored. Because the
synchronization word is automatically added by the Xilinx bitstream generation software,
this step is transparent in most applications. The length and contents of the
synchronization word differ between the Extended Spartan-3A family FPGA families and
the Spartan-3 and Spartan-3E FPGA families, as outlined in Table 12-3.
www.xilinx.com
39
Array ID
Next the array IDCODE is embedded in the bitstream so that the FPGA can check that it
matches its internal array ID. This prevents the FPGA from mistakenly attempting to load
configuration data intended for a different FPGA array. For example, the array ID check
prevents an XC3S1000 from being configured with an XC3S200 bitstream. Table 12-4 shows
the array ID codes.
Data Frames
Next is the internal configuration memory, partitioned into segments called "data frames."
The configuration memory can be visualized as a rectangular array of bits. The bits are
grouped into vertical frames that are one-bit wide and extend from the top of the array to
the bottom. A frame is the atomic unit of configuration. It is the smallest portion of the
configuration memory that can be written to or read from. The number and size of frames
varies with device size (see Table 1-5). The total number of configuration bits for a
particular device is calculated by multiplying the number of frames by the number of bits
per frame, and then adding the total number of bits needed to perform the configuration
register writes.
Table 1-5:
FPGA Family
Spartan-3A/3AN FPGA
Spartan-3E FPGA
Spartan-3 FPGA
40
Number of
Frames
Frame Length
in Bits
XC3S50A/AN
367
1,184
XC3S200A/AN
540
2,208
XC3S400A/AN
692
2,720
XC3S700A/AN
844
3,232
XC3S1400A/AN
996
4,768
XC3SD1800A
1,414
5,792
XC3SD3400A
1,718
6,816
XC3S100E
368
1,568
XC3S250E
577
2,336
XC3S500E
729
3,104
XC3S1200E
958
4,000
XC3S1600E
1,186
5,024
XC3S50
368
1,184
XC3S200
615
1,696
XC3S400
767
2,208
XC3S1000
995
3,232
XC3S1500
1,223
4,384
XC3S2000
1,451
5,280
XC3S4000
1,793
6,304
XC3S5000
1,945
6,816
www.xilinx.com
CRC
Next is the Cyclic Redundancy Check (CRC) value. As the configuration data frames are
loaded, the FPGA calculates a CRC value. After the configuration data frames are loaded,
the configuration bitstream issues a Check CRC instruction to the FPGA. If the CRC value
calculated by the FPGA does not match the expected CRC value in the bitstream, then the
FPGA pulls INIT_B Low and aborts configuration. Refer to CRC Checking during
Configuration, page 313 for additional information.
Bitstream Compression
By default, FPGA bitstreams are uncompressed. However, Spartan-3 generation FPGAs
support basic bitstream compression. The compression is fairly simple, yet effective for
some applications. The ISE bitstream generator software examines the FPGA bitstream
for any duplicate configuration data frames. These duplicates occur often in the following
situations.
FPGA design with low logic utilization, i.e., most of the FPGA array is empty.
The ISE software can then generate a compressed FPGA bitstream. When the FPGA
configures, the internal configuration controller copies the redundant data frame to
multiple locations. Because of the extra processing required by the FPGA configuration
controller, the maximum configuration clock frequency is reduced to 20 MHz on Spartan3 and Spartan-3E FPGAs, as shown in Table 1-6. Extended Spartan-3A family FPGAs
support the full CCLK frequency range, even with compressed bitstreams.
Table 1-6:
Spartan-3
FPGA
Spartan-3E
FPGA
Spartan-3A
Spartan-3AN
Spartan-3A DSP
FPGA
20 MHz
20 MHz
80 MHz
The amount of compression is non-deterministic. Changes to the source FPGA design may
cause the size of the compressed bitstream to grow. Sparse, mostly-empty FPGA designs
have the greatest overall compression factor. Similarly, FPGA designs with an empty
column of block RAM have a high compression factor.
The overall benefits of a compressed bitstream are as follows.
There are two methods to generate a compressed bitstream, from within the ISE Project
Navigator or from the command line.
From Project Navigator, check the Enable BitStream Compression option, shown as Step
4 in Figure 1-6.
From the command line, add the -g Compress option to the BitGen command line.
bitgen -g Compress <other options>...
Furthermore, the parallel Platform Flash PROMs offer their own compression
mechanisms.
www.xilinx.com
41
Packet Format
A Spartan-3 generation bitstream consists of a specific sequence of writes to the
configuration registers. After synchronization, all data, register writes, and frame data are
encapsulated in packets. There are two kinds of packets: Type 1 and Type 2. A Type 1
packet consists of two parts: a header and the data. The header (see Figure 1-4) describes
which register is being accessed, whether it is a read or write operation, and the size of the
data to follow. The data portion, always immediately following the header, is the number
of 32-bit words specified in the header.
15
14
13
12
Type
0
11
10
Op
1
Register Address
x
Word Count
x
Figure 1-4:
For information on Spartan-3 FPGA packet formats, see XAPP452 Spartan-3 Advanced
Configuration Architecture.
UG332_c1_04_120306
Figure 1-5:
42
1.
2.
Click Properties.
www.xilinx.com
4
5
ug332_C1_05_091106
4.
5.
To enter specific bitstream generator command-line options that are not already
supported by the graphical interface, enter the option strings in the space provided.
www.xilinx.com
43
7
8
9
10
11
UG332_c1_06_091106
Figure 1-7:
6.
7.
If using one of the Master configuration modes, set the CCLK Configuration Rate
frequency. This setting is not used for Slave mode configuration. The specific setting
depends on the specific FPGA family, the attached configuration memory, and the
configuration mode. Specific values are recommended in later chapters, depending on
the speed of the attached memory.
8.
The FPGAs DONE and PROG_B (Program) pins each have a dedicated pull-up
resistor during configuration. These resistors become optional after configuration. The
specific example is from a Spartan-3E FPGA application. Spartan-3 and Spartan-3A
FPGAs have additional options.
9.
The FPGAs JTAG pins each have a dedicated pull-up resistor during configuration.
These resistors become optional after configuration.
10. By default, unused I/O blocks are configured as inputs with a pull-down resistor.
Other options are available. See UnusedPin bitstream option.
11. Each FPGA bitstream can include an 8-digit hexadecimal (32-bit) identifier that can be
read via the FPGAs JTAG port.
44
www.xilinx.com
12
13
14
15
16
UG332_c1_07_120106
The timing of when the write-protect lock is removed from writable clocked
elements
15. If the DCM_WAIT=TRUE attribute is set on a Digital Clock Manager (DCM) within the
FPGA, the FPGA optionally waits for the Delay-Locked Loop (DLL) within the DCM
to lock to the incoming clock signal before finishing configuration. See Waiting for
DCMs to Lock, DCI to Match, page 253.
16. The FPGAs DONE pin can actively drive High after configuration. This option should
only be set for single-FPGA applications or for the last FPGA in a multi-FPGA
configuration daisy chain. See DONE Pin, page 52.
www.xilinx.com
45
17
18
19
UG332_c1_08_091106
Figure 1-9:
46
FPGA Family
Command Line
Spartan-3 FPGAs
Spartan-3E FPGAs
Spartan-3A FPGAs
Spartan-3AN FPGAs
www.xilinx.com
Additional Resources
For complete documentation on the bitstream generator software, refer to the BitGen
chapter of the Command Line Tools User Guide, which can be found under the ISE Design
Suite documentation:
Additional Resources
The following also provide information related to FPGA configuration.
Data Sheets
DS529, Spartan-3A FPGA Family: Data Sheet
DS557, Spartan-3AN FPGA Family Data Sheet
DS610, Spartan-3A DSP FPGA Family: Data Sheet
DS312, Spartan-3E FPGA Family: Complete Data Sheet
DS099, Spartan-3 FPGA Family Data Sheet
Application Notes
Configuration
www.xilinx.com/support/documentation/topicfpgafeaturedesign_configur.htm
www.xilinx.com
47
48
www.xilinx.com
Chapter 2
The mode select pins, M[2:0], define the configuration mode that the FPGA uses to
load its configuration data.
The DONE pin, when High, indicates when the FPGA successfully completed loading
its configuration data.
The program pin, PROG_B, initiates the configuration process. The FPGA also
automatically initiates configuration on power-up. The JTAG interface has a separate
JTAG command to initiate configuration. The PROG_B pin also forces a master reset
on the FPGA.
The configuration clock pin, CCLK, defines the timing for the FPGAs configuration
process. If the M[2:0] mode select pins define a Master mode, then the FPGA
internally generates CCLK. If the M[2:0] mode select pins define a Slave mode, then
CCLK is an input to the FPGA from an external timing reference.
The INIT_B pins performs multiple functions. At the start of configuration, INIT_B
goes Low indicating that the FPGA is clearing its internal configuration memory--a
process called housecleaning. Later, when the FPGA is actively loading its
configuration bitstream, INIT_B goes Low if the bitstream fails its CRC check. On
Extended Spartan-3A family FPGAs, if so enabled in the FPGA application, the
INIT_B pin also potentially signals a post-configuration CRC error.
During configuration, some pins have built-in pull-up resistors. The remaining pins
each have an optional pull-up resistor controlled by a single control input pin. This
pin has different names on different architectures as shown in Table 2-12.
www.xilinx.com
49
M[2:0]
<0:0:0>
Spartan-3A
Spartan-3E
Spartan-3A DSP
Spartan-3AN
<0:0:1>
Reserved
<0:1:0>
Reserved
BPI Up
<0:1:1>
Master Parallel
BPI Down
Reserved
<1:0:0>
Reserved
<1:0:1>
JTAG Mode
<1:1:0>
<1:1:1>
Internal Master
SPI
Spartan-3E
FPGA
Extended
Spartan-3A
Family FPGAs
No
Yes
Yes
Yes
No
Yes
M2Pin,
M1Pin,
M0Pin
bitstream
options
User I/O
User I/O
VCCAUX
VCCO_2
VCCO_2
N/A
VCCO_2
VCCO_2
Only when
interface is at
2.5V
Yes
Yes
50
www.xilinx.com
Spartan-3E FPGAs
The Spartan-3E FPGA mode pins do not have dedicated pull-up resistors during
configuration. However, these pins have optional pull-up resistors during configuration,
controlled by the Spartan-3E HSWAP pin. If the mode pins are unconnected and if the
HSWAP is Low, then the Spartan-3E FPGA defaults to the Slave Serial configuration mode
(M[2:0] = <1:1:1>.
www.xilinx.com
51
Table 2-3:
Spartan-3 FPGAs
After configuration, the M[2:0] pin are available as userI/O pins. If these pins are not defined in the FPGA
application, then these pins are treated as unused I/O
pins. The behavior of unused I/O pins is defined by the
UnusedPin bitstream option. Unless defined in the
FPGA application or changed via the UnusedPin option,
all three M[2:0] have internal pull-down resistors.
DONE Pin
The FPGA actively drives the DONE pin Low during configuration. When the
configuration process successfully completes, the FPGA either actively drives the DONE
pin High (DriveDone) or allows the DONE pin to float High using either an internal or
external pull-up resistor, controlled by the DonePin bitstream generator option.
In a multi-FPGA daisy-chain or broadside configuration, the open-drain option permits
the DONE lines of multiple FPGAs to be tied together, so that the common node transitions
High only after all of the FPGAs have successfully completed configuration. Externally
holding the open-drain DONE pin Low stalls the Startup sequence.
The DONE pin is powered by the VCCAUX supply. The DONE pin functionality is common
to all Spartan-3 generation FPGAs.
52
DonePin defines whether or not the DONE pin has an internal pull-up resistor.
DONE_cycle defines the Startup state where is DONE driven High or released to float
High.
DonePipe adds an extra pipelining stage before the FPGA actually completes
configuration.
www.xilinx.com
DriveDone
The DriveDone bitstream generator option, shown in Table 2-4, defines whether the DONE
pin has a totem-pole output that actively drives High or acts an open-drain output. If
configured as an open-drain outputwhich is the default behaviorthen a pull-up
resistor is required to produce a High logic level. The DonePin bitstream option controls
the pull-up resistor.
Table 2-4:
Setting
Description
No
Yes
The DONE pin actively drives High when the FPGA completes the configuration
process.
DonePin
The DonePin bitstream generator option, shown in Table 2-5, defines whether or not an
internal pull-up resistor is present on the DONE pin to pull the pin to VCCAUX. If the
pull-up resistor is eliminated, then the DONE pin must be pulled High using an external
300 to 3.3k pull-up resistor.
Table 2-5:
Setting
Pullup
Pullnone
Description
Default. After configuration, the DONE pin has an internal pull-up
resistor to VCCAUX.
There is no internal pull-up resistor on DONE. An external 300 to 3.3k
pull-up resistor to VCCAUX is required. The pull-up resistor must be
strong enough to pull the DONE pin to a valid High within less than one
CCLK cycle.
This option is set graphically in the ISE Software Project Navigator, page 42 by selecting
the Configuration Pin Done setting during Step 8 in Figure 1-7, page 44.
See Table 2-6 for the interaction between DriveDone and DonePin.
www.xilinx.com
53
Table 2-6:
Interaction between DriveDone and DonePin Bitstream Generator Options for DONE Pin
DONE Actively Drives
Open-Drain with
Internal Pull-up (Default)
FPGA
FPGA
FPGA
Open-Drain with
External Pull-Up
VCCAUX
VCCAUX
Diagram
330 to
3.3k
Active driver
LVCMOS
UG332_c2_01_120106a
DONE
DONE
DONE
VCCAUX
Startup
Sequencer
VCCAUX
Startup
Sequencer
UG332_c2_01_120106b
VCCAUX
Startup
Sequencer
UG332_c2_01_120106c
DriveDone:
Yes
No
No
DonePin:
Pullnone
Pullup
Pullnone
Best
OK
Daisy-Chain
Broadside
Do Not Use!
DONE_cycle
The DONE_cycle option controls during which cycle the DONE pin is asserted during the
Startup sequence, just prior to the completion of a successful configuration. See Startup,
page 251.
This option is set graphically in the ISE Software Project Navigator, page 42 by adjusting
the Done (Output Events) setting during Step 14 in Figure 1-8, page 45.
DonePipe
The DonePipe option is used in a some multi-FPGA applications.
After all DONE pins are released in a multi-FPGA configuration, the DONE pin must
transition from Low to High in a single Startup clock cycle (StartupClk). If additional time
is required for the DONE signal to rise within a single Startup cycle, set the DonePipe:Yes
bitstream generator option for all devices in the daisy chain or broadside configuration.
Set this option graphically in ISE Software Project Navigator, page 42 by checking the
Enable Internal Done Pipe option box shown in Figure 1-8, page 45.
54
www.xilinx.com
FPGA
INIT_B
DONE
INIT_B
DONE
FPGA
0
0
Figure 2-1:
VCCO_2
INIT_B
DONE
VCCAUX
330
FPGA
4.7k
UG332_c2_02_111406
Cautions When Mixing Spartan-3A FPGAs with VCCAUX = 3.3V and Other
Spartan-3 Generation FPGAs in a Daisy-Chain Configuration
The DONE pin is powered by the FPGAs VCCAUX supply. The VCCAUX voltage on
Spartan-3 and Spartan-3E FPGAs is solely 2.5V. For Spartan-3A FPGAs, however, the
VCCAUX voltage can be either 2.5V or 3.3V. Spartan-3AN FPGAs require VCCAUX at 3.3V.
See VCCAUX Level.
Caution! In a multi-FPGA configuration that mixes Extended Spartan-3A family and other
Xilinx FPGAs where the Extended Spartan-3A family VCCAUX = 3.3V, check for voltage
compatibility on the common DONE node.
www.xilinx.com
55
PROG_B Operation
PROG_B Input
Response
Power-up
Low-going pulse
Extended Low
After configuration, hold the PROG_B input High. Any Low-going pulse on PROG_B,
lasting 500 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.
56
www.xilinx.com
Spartan-3E
Spartan-3A/3AN
Spartan-3A DSP
No;
dedicated pin
Yes
Yes
VCCAUX
VCCO_2
VCCO_2
User I/O
User I/O
I/O
I/O
3, 6, 12, 25, 50
1, 3, 6, 12, 25, 50
1, 3, 6, 7, 8, 10, 12,
13, 17, 22, 25, 27,
33, 44, 50, 100
50% of
Fully
characterized.
Specified in
data sheet.
Fully
characterized.
Specified in data
sheet.
ConfigRate
frequency
In the Master configuration modes, the FPGA internally generates the CCLK clock source.
As shown in Figure 2-2, there are slight differences in the CCLK circuitry between the
Spartan-3 / Spartan-3E FPGA families and the Extended Spartan-3A family.
As shown in Figure 2-2a, Spartan-3/3E FPGAs drive the internally-generation CCLK
signal to an output. Like the configuration PROM connected to the FPGA, the FPGAs
internal configuration logic is clocked by the CCLK signal at the FPGA pin, which
simplifies the interface timing. However, any switching noise on the CCLK pin potentially
also affects the FPGA. Therefore, treat CCLK as a full bidirectional I/O pin for signal
integrity analysis; the FPGA uses the value at the pin to clock internal logic. See CCLK
Design Considerations, page 58.
As shown in Figure 2-2b, CCLK is strictly an output on Extended Spartan-3A family
FPGAs in the Master configuration modes. The FPGAs internal configuration logic is
clocked by the internally-generated CCLK signal and is not susceptible to external
switching noise. That said, good signal integrity on the CCLK board trace is a good design
practice.
www.xilinx.com
57
Spartan-3/-3E FPGA
LVCMOS
LVCMOS
Internal
Oscillator
Internal
Oscillator
CCLK
ConfigRate
CCLK
ConfigRate
Configuration
Logic
Configuration
Logic
b) Spartan-3A/3AN/3A DSP
FPGAs
UG332_c2_03_040107
Differences between Spartan-3/3E and Extended Spartan-3A Family
FPGAs for Master Configuration Modes
Route the CCLK signal without any branching. Do not use a star topology.
The clock termination examples shown below use parallel termination (Thevenin), but
other approaches are acceptable. In parallel termination, the resistor values are twice the
characteristic impedance of the board trace. The examples shown assume 50 trace
impedance. The disadvantage of parallel termination is that there is always a current path.
Using series termination at the source and the end minimizes power, but use IBIS
simulation to optimize resistor values for the specific application.
58
www.xilinx.com
Figure 2-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.
CCLK
Z0 (50)
Master FPGA
Z0 (50)
VCCO_2
2 x Z0 (100)
2 x Z0 (100)
UG332_c2_05_112206
Figure 2-3:
Figure 2-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.
Clock Input 2
CCLK
Z0 (50)
Z0 (50)
Z0 (50)
Stub:
Length < 12.5 mm
Master FPGA
Z0 (50)
VCCO_2
2 x Z0 (100)
Clock Input 1
2 x Z0 (100)
UG332_c2_06_112206
Figure 2-4:
www.xilinx.com
59
Figure 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.
Clock In
C
Input 1
Impedance
Discontinuity
Z0
CCLK
Z0
Master FPGA
Clock
ock Inp
Input 2
Z0
UG191_c2_07_112206
Figure 2-5:
Although CCLK is most critical for signal integrity analysis and design techniques, similar
considerations should be applied to all configuration pins. For more information, see Board
Design and Signal Integrity in UG331.
60
www.xilinx.com
After Configuration
After configuration successfully completes, i.e., when the DONE pin goes High, the
INIT_B pin is available as a full user-I/O pin. The only exception if the Extended Spartan3A Family FPGA Post-Configuration CRC feature is enabled in the application, in which
case the INIT_B is dedicated after configuration as well.
www.xilinx.com
61
If the INIT_B pin is not used by the FPGA application after configuration, actively drive it
High or Low. If left undefined, INIT_B, like all other unused pins, is defined by default as
an input with an internal pull-down resistor. If the FPGA board uses an external pull-up
resistor on INIT_B, then the unused pin will float at an intermediate value due to the
presence of both a pull-up and pull-down resistor. To change the default configuration for
unused pins, change the UnusedPin bitstream generator option setting.
If the bitstream generator option Persist:Yes is set, then INIT_B is reserved after
configuration completes.
62
www.xilinx.com
Table 2-9: Pins with Dedicated Pull-Up Resistors during Configuration (All
Spartan-3 Generation FPGAs)
Pin Name
PROG_B
VCCAUX
DONE
VCCAUX
Pull-up during
Configuration
control input,
Spartan-3E and
Extended Spartan-3A
FPGAs: VCCO_0
Spartan-3 FPGA:
VCCAUX
HSWAP,
PUDC_B, or
HSWAP_EN
(see Table 2-12)
INIT_B
Spartan-3E/3A/3AN/
User I/O after configuration. Controlled by
Spartan-3A DSP FPGAs: the FPGA application.
VCCO_2
Spartan-3 FPGA:
VCCO_4 or
VCCO_BOTTOM
TDI
VCCAUX
TMS
VCCAUX
TCK
VCCAUX
TDO
VCCAUX
As 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 pullup resistor controlled when HSWAP = 0.
Table 2-10: Pins with Dedicated Pull-Up Resistors during Configuration (Extended
Spartan-3A Family FPGAs Only)
Pin Name
Pull-Up Resistor
Supply Rail
M[2:0]
VCCO_2
VCCO_2
VS[2: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.
www.xilinx.com
63
Table 2-11: Pins with Dedicated Pull-Up Resistors during Configuration (Spartan-3
FPGA Family Only)
Pin Name
Pull-Up Resistor
Supply Rail
M2
VCCAUX
M1
VCCAUX
M0
VCCAUX
CCLK
VCCAUX
FPGA Family
Pin Name
Function
Spartan-3A/3AN/
3A DSP FPGA
PUDC_B
Spartan-3E FPGA
HSWAP
Spartan-3 FPGA
HSWAP_EN
The control pin itself has a pull-up resistor enabled during configuration. However, the
VCCO_0 supply voltage must be applied before the pull-up resistor becomes active. If the
VCCO_0 supply ramps after the VCCO_2 power supply, do not let the control input pin
float; tie the pin to the desired logic level externally. Note that Spartan-3E step 0 silicon
requires that VCCINT be applied before VCCAUX when using a pull-up on HSWAP.
For more information on the pull-up control before configuration, see Pre-Configuration
Power-Up, page 241.
64
www.xilinx.com
Pin Descriptions
Table 2-13:
Spartan-3
FPGA
Spartan-3E
FPGA
1.27 to 4.11
2.4 to 10.8
1.15 to 3.25
2.7 to 11.8
6.2 to 33.1
2.45 to 9.10
4.3 to 20.2
8.4 to 52.6
Voltage Range
VCCAUX or VCCO = 3.0 to 3.6V
Units
5.1 to 23.9
k
Table 2-14: Recommended External Pull-Up or Pull-down Resistor Values to Define Input Values during
Configuration
PUDC_B, HSWAP, or
HSWAP_EN
=0
(also applies to all
pins that have a
dedicated pull-up
resistor during
configuration, see
Pins with Dedicated
Pull-Up Resistors
during
Configuration,
page 62)
=1
(optional pull-up
resistors are disabled
during
configuration. Does
not apply to pins
with dedicated pullup resistors during
configuration)
Desired Pull
Direction
I/O Standard
Pull-Up
All
Pull-Down
(required to
overcome maximum
IRPU current and
guarantee VIL)
Pull-Up
(required to
overcome singleload, maximum IL
leakage current and
guarantee VIH)
Pull-Down
(required to
overcome singleload, maximum IL
leakage current and
guarantee VIL)
Spartan-3
FPGA
Spartan-3E
FPGA
Spartan-3A/3AN
Spartan-3A DSP
FPGA
LVCMOS33
LVTTL
330
620
1.1 k
LVCMOS25
470
820
1.8 k
LVCMOS18
510
820
3.3 k
LVCMOS15
820
1.2 k
5.4 k
LVCMOS12
1.5 k
1.5 k
9.6 k
LVCMOS33
LVTTL
40 k
100 k
LVCMOS25
60 k
LVCMOS18
37 k
LVCMOS15
28 k
LVCMOS12
38 k
LVCMOS33
LVTTL
LVCMOS25
LVCMOS18
LVCMOS15
LVCMOS12
32 k
80 k
70 k
38 k
59 k
Pin Descriptions
Table 2-15 lists the various pins involved in the configuration process, including which
configuration mode, the pins direction, and a summary description. The table also
describes how to use the pin during and after configuration.
www.xilinx.com
65
Table 2-15:
Pin Name
Config.
Mode(s)
FPGA
Direction
HSWAP
All
Input
or
PUDC_B
or
HSWAP_EN
Description
User I/O Pull-Up Control.
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
1: No pull-ups
(depends on
FPGA family)
Spartan-3:
Dedicated pin (dont
care after
configuration)
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP:
User I/O
M[2:0]
All
Input
DIN
Serial
Modes, SPI
Input
User I/O
CCLK
Master
Modes, SPI,
BPI
Output
Configuration Clock.
Generated by FPGA
internal oscillator.
Frequency controlled by
ConfigRate bitstream
generator option. See
Configuration Clock:
CCLK, page 56.
Slave
Modes
DOUT
INIT_B
(treat as
I/O for
signal
integrity)
Input
Output
All
66
www.xilinx.com
User I/O
Table 2-15:
Pin Descriptions
Pin Name
Config.
Mode(s)
DONE
All
FPGA
Direction
Description
When High,
indicates that the
FPGA successfully
configured.
All
Input
Spartan-3E
Spartan-3A
Spartan-3AN
Master SPI
Input
User I/O
Master SPI
Output
User I/O
Master SPI
Output
Spartan-3A DSP
FPGA:
VS[2:0]
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP
FPGA:
MOSI
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP
FPGA:CSO_B
www.xilinx.com
67
Table 2-15:
FPGA
Direction
BPI, Slave
Parallel
Input
Active-Low.
RDWR_B
BPI, Slave
Parallel
Input
Must be Low
throughout
configuration. Do not
change logic level
while CSI_B is Low
Spartan-3E
Spartan-3A
Spartan-3AN
BPI
Output
Connect to parallel
PROM chip-select
input (CS#). FPGA
drives this signal Low
throughout
configuration.
BPI
Output
User I/O
BPI
Output
Connect to parallel
PROM write-enable
input (WE#). FPGA
drives this signal High
throughout
configuration.
User I/O
BPI
Output
Pin Name
Spartan-3E
Spartan-3A
Spartan-3AN
Description
Spartan-3A DSP
FPGA:
CSI_B
Spartan-3
FPGA:
CS_B
Spartan-3A DSP
FPGA:
LDC0
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP
FPGA:
LDC1
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP
FPGA:
HDC
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP
FPGA:
LDC2
68
www.xilinx.com
Table 2-15:
Pin Name
Spartan-3E
FPGA:
A[23:0]
Config.
Mode(s)
FPGA
Direction
BPI
Output
Master
Parallel,
BPI, Slave
Parallel,
Input
Description
Connect to PROM
address inputs.
User I/O.
Data Input
Data captured by
FPGA
Spartan-3A
Spartan-3AN
Spartan-3A DSP
FPGA:
A[25:0]
D[7:0]
SelectMAP
Spartan-3/
Spartan-3E
FPGA:
BUSY
BPI, Slave
Parallel
(SelectMAP)
Output
www.xilinx.com
69
Pin Name
Pull-Up
Resistor
Master
Serial
SPI
(Serial
Flash)
Internal
Master
SPI
BPI
(Parallel
Flash)
JTAG
Slave
Serial
Slave
Parallel
Supply/
I/O Bank
See pinout
table
IO* (user-I/O)
IP* (input-only)
TDI
Yes
TDI
TDI
TDI
TDI
TDI
TDI
TDI
VCCAUX
TMS
Yes
TMS
TMS
TMS
TMS
TMS
TMS
TMS
VCCAUX
TCK
Yes
TCK
TCK
TCK
TCK
TCK
TCK
TCK
VCCAUX
TDO
Yes
TDO
TDO
TDO
TDO
TDO
TDO
TDO
VCCAUX
PROG_B
Yes
PROG_B
PROG_B
PROG_B
PROG_B
PROG_B
PROG_B
PROG_B
VCCAUX
DONE
Yes
DONE
DONE
DONE
DONE
DONE
DONE
DONE
VCCAUX
PUDC_B
Yes
PUDC_B
PUDC_B
PUDC_B
PUDC_B
PUDC_B
PUDC_B
PUDC_B
M2
Yes
M1
Yes
M0
Yes
CCLK
INIT_B
Yes
CSO_B
DOUT
MOSI/CSI_B
D[7:1]
CCLK
CCLK
CCLK
CCLK
CCLK
(OUTPUT)
(OUTPUT)
(OUTPUT)
(INPUT)
(INPUT)
INIT_B
INIT_B
INIT_B
INIT_B
DOUT
DIN
INIT_B
CSO_B
INIT_B
CSO_B
CSO_B
DOUT
DOUT(5)
DOUT(5)
MOSI
CSI_B
CSI_B
D[7:1]
D[7:1]
D0
RDWR_B
DIN
D0
DOUT
D0/DIN
RDWR_B
DIN
VS[2:0]
Yes
A[25:0]
A[25:0]
LDC2
LDC2
LDC1
LDC1
LDC0
LDC0
HDC
HDC
RDWR_B
VS[2:0]
VS[2:0]
Notes:
1. Gray shaded cells represent pins that are in a high-impedance state (Hi-Z, floating) during configuration. These pins have an
optional internal pull-up resistor to their respective VCCO supply pin that is active during configuration if the PUDC_B input is Low.
See Pull-Up Resistors During Configuration, page 62.
2. The Spartan-3E HSWAP pin and the Extended Spartan-3A family PUDC_B pin have identical behavior, just different names. See
Pull-Up Resistors During Configuration, page 62.
3. The Internal Master SPI mode, M[2:0] = <0:1:1>, is only available on the Spartan-3AN FPGA family. VCCAUX must be 3.3V when
using this mode.
4. CCLK is always an input pin in Slave configuration modes. For Master modes, CCLK must be treated as a bidirectional I/O pin for
Spartan-3E FPGAs and is an output pin for Extended Spartan-3A family FPGAs.
5. The DOUT output is not labeled as BUSY and the BUSY function is not required on Extended Spartan-3A family FPGAs. However,
the pin can still toggle during Slave Parallel configuration and therefore should not be tied to user functions during configuration.
Unlike Spartan-3E FPGAs, Extended Spartan-3A family FPGAs do use the DOUT pin in BPI serial daisy-chains, which are only
supported on Extended Spartan-3A family FPGAs.
70
www.xilinx.com
Spartan-3E FPGAs
Table 2-17 shows the various Spartan-3E FPGA pins that are either borrowed or dedicated
during configuration.
Table 2-17:
Pin Name
Dedicated
Pull-Up
Resistor
IO* (user-I/O)
IP* (input-only)
Master
Serial
SPI
(Serial
Flash)
BPI
(Parallel
Flash)
JTAG
Slave
Serial
Slave
Parallel
Supply/
I/O Bank
See pinout
table
TDI
Yes
TDI
TDI
TDI
TDI
TDI
TDI
VCCAUX
TMS
Yes
TMS
TMS
TMS
TMS
TMS
TMS
VCCAUX
TCK
Yes
TCK
TCK
TCK
TCK
TCK
TCK
VCCAUX
TDO
Yes
TDO
TDO
TDO
TDO
TDO
TDO
VCCAUX
PROG_B
Yes
PROG_B
PROG_B
PROG_B
PROG_B
PROG_B
PROG_B
VCCAUX
DONE
Yes
DONE
DONE
DONE
DONE
DONE
DONE
VCCAUX
HSWAP
Yes
HSWAP
HSWAP
HSWAP
HSWAP
HSWAP
HSWAP
M2
M1
0 = Up
1 = Down
CCLK
(I/O)
CCLK
(I/O)
CCLK
(I/O)
CCLK
(INPUT)
CCLK
(INPUT)
INIT_B
Yes
INIT_B
INIT_B
INIT_B
INIT_B
INIT_B
CSO_B
CSO_B
CSO_B
CSO_B
DOUT/BUSY
DOUT
BUSY
BUSY
MOSI/CSI_B
MOSI
CSI_B
CSI_B
D[7:1]
D[7:1]
D[7:1]
D0/DIN
D0
RDWR_B
RDWR_B
M0
CCLK
DOUT
DIN
DIN
D0
RDWR_B
DOUT
DIN
VS[2:0]
VS[2:0]
(Note 4)
A[23:17]
(Note 4)
A[23:17]
A[16:0]
A[16:0]
LDC2
LDC2
LDC1
LDC1
LDC0
LDC0
HDC
HDC
Notes:
1. Gray shaded cells represent pins that are in a high-impedance state (Hi-Z, floating) during configuration. These pins have an
optional internal pull-up resistor to their respective VCCO supply pin that is active during configuration if the HSWAP input is Low.
See Pull-Up Resistors During Configuration, page 62.
2. The Spartan-3E HSWAP pin and the Extended Spartan-3A family PUDC_B pin have identical behavior, just different names. See
Pull-Up Resistors During Configuration, page 62.
3. CCLK is always an input pin in Slave configuration modes. For Master modes, CCLK must be treated as a bidirectional I/O pin for
Spartan-3E FPGAs.
4. On Spartan-3E FPGAs, the VS[2:0] pins used in Master SPI mode are shared with the A[19:17] address pins used in BPI mode.
www.xilinx.com
71
Spartan-3 FPGAs
Table 2-18 shows the various Spartan-3 FPGA pins that are either borrowed or dedicated
during configuration.
Table 2-18:
Pin Name
Dedicated
Pull-Up
Resistor
IO* (user-I/O)
IP* (input-only)
Master
Serial
Master
Parallel
JTAG
Slave
Parallel
Slave Serial
Supply/
I/O Bank
See pinout
table
TDI
Yes
TDI
TDI
TDI
TDI
TDI
VCCAUX
TMS
Yes
TMS
TMS
TMS
TMS
TMS
VCCAUX
TCK
Yes
TCK
TCK
TCK
TCK
TCK
VCCAUX
TDO
Yes
TDO
TDO
TDO
TDO
TDO
VCCAUX
PROG_B
Yes
PROG_B
PROG_B
PROG_B
PROG_B
PROG_B
VCCAUX
DONE
Yes
DONE
DONE
DONE
DONE
DONE
VCCAUX
HSWAP_EN
Yes
HSWAP_EN
HSWAP_EN
HSWAP_EN
HSWAP_EN
HSWAP_EN
VCCAUX
M2
Yes
VCCAUX
M1
Yes
VCCAUX
M0
Yes
VCCAUX
Yes
CCLK
(I/O)
CCLK
(I/O)
CCLK
(INPUT)
CCLK
(INPUT)
VCCAUX
INIT_B
Yes
INIT_B
INIT_B
INIT_B
INIT_B
CS_B
CS_B
DOUT/BUSY
BUSY
D[7:4]
D[7:4]
D[7:4]
D[3:1]
D[3:1]
D[3:1]
D0/DIN
D0
RDWR_B
RDWR_B
CCLK
CS_B
DOUT
DIN
BUSY
DOUT
D0
DIN
RDWR_B
Notes:
1. Gray shaded cells represent pins that are in a high-impedance state (Hi-Z, floating) during configuration. These pins have an
optional internal pull-up resistor to their respective VCCO supply pin that is active during configuration if the HSWAP_EN input is
Low.
2. CCLK is always an input pin in Slave configuration modes. For Master modes, CCLK must be treated as a bidirectional I/O pin.
72
Pin(s)
I/O Standard
Output Drive
Slew Rate
LVCMOS25
Slow
www.xilinx.com
By default, the I/O pins are set for LVCMOS25 operation or 2.5V low-voltage CMOS. The
setting is the same for both the Dedicated and Dual-Purpose pins. However, the DualPurpose pins can drive at different voltages, depending on the voltage applied to the
relevant I/O bank.
The Dedicated configuration pins (see Table 2-17, page 71 and Table 2-18, page 72) are
always powered by VCCAUX. On Spartan-3 and Spartan-3E FPGA families, VCCAUX is
always 2.5V, as shown in Table 2-18. On Spartan-3A/3A DSP FPGAs, VCCAUX can be either
2.5V or 3.3V. On Spartan-3AN FPGAs, VCCAUX is always 3.3V. See VCCAUX Level.
The Dual-Purpose configuration pin outputs operate at other voltages by appropriately
setting the voltage on the associated VCCO power rail. For Spartan-3A/3A DSP (and for
Spartan-3AN FPGAs in modes other than Internal Master SPI) and Spartan-3E FPGAs, the
Dual-Purpose configuration pins are supplied by the VCCO_2 rail, plus VCCO_1 in BPI
mode. In Spartan-3 FPGAs, the Dual-Purpose configuration pins are supplied by VCCO_4,
plus VCCO_5 in any of the parallel configuration modes. In general, set the configuration
voltage to either 2.5V or 3.3V. The change on the VCCO supply also changes the I/O drive
characteristics. For example, with VCCO = 3.3V, the output current when driving High,
IOH, increases to approximately 12 to 16 mA, while the current when driving Low, IOL,
remains 8 mA.
If required, VCCO can be set to 1.8V in the Spartan-3 and Spartan-3E families. At
VCCO = 1.8V, IOH (the output current when driving High), decreases slightly to
approximately 6 to 8 mA. IOL (the current when driving Low), remains 8 mA. The output
voltages will be determined by the VCCO level, LVCMOS18 for 1.8V, LVCMOS25 for 2.5V,
and LVCMOS33 for 3.3V.
Table 2-20:
FPGA Family
Supported VCCAUX
Voltage Options
Spartan-3A
Spartan-3A DSP
FPGAs
2.5V
Spartan-3AN(1)
3.3V
Spartan-3E
FPGAs
2.5V
Spartan-3
FPGAs
2.5V
3.3V
Dual-Purpose Pins
Dual-Purpose
Configuration Pin
Supply Rails
Supported
Configuration Supply
Voltage Options
VCCO_2
2.5V
(sometimes VCCO_1)
3.3V
VCCO_2
2.5V
(sometimes VCCO_1)
3.3V
VCCO_4
2.5V
(sometimes VCCO_5)
3.3V
Notes:
1. Spartan-3AN FPGAs in Internal Master SPI mode only require the 3.3V VCCAUX supply because there
are no Dual-Purpose pins involved. In all other configuration modes, the Dual-Purpose pins are
involved.
www.xilinx.com
73
This could be accomplished by using an adjustable regulator with a feedback loop to set
the output voltage, using a resistor divider network to define the voltage values. One
resistor would be connected to an I/O which is disabled before configuration (using
PUDC_B High) and High after configuration. In Figure 2-6, R1 in series with R2 sets the
regulator output voltage at 2.5V or higher for power-on and during configuration. Resistor
R3 is enabled after configuration, and the parallel resistance of R1 and R3 replaces R1 to set
the regulator voltage at 1.8V or lower after configuration.
X-Ref Target - Figure 2-6
Output
VCCO_2
Regulator
R1
Spartan-3A
R3
Feedback
I/O
R2
UG332_c2_08_012709
Figure 2-6:
74
www.xilinx.com
www.xilinx.com
75
HSWAP Value
Low
Enabled
Disabled
76
www.xilinx.com
VCCAUX Level
Bitstream Loading
Setup
Startup
INIT_B
User I/O
M[2:0]
VALID
User I/O
VS[2:0]
VALID
User I/O
(Master SPI)
HSWAP
PUDC_B
VALID
User I/O
User
I/O
CCLK
DONE
Startup Sequence
DONE_cycle
GTS_cycle
UG332_c2_04_111506
Figure 2-7:
VCCAUX Level
In the Spartan-3A and Spartan-3A DSP platforms, the VCCAUX level is programmable as
either 2.5V (default) or 3.3V. The user specifies the value in the software through the
CONFIG VCCAUX=2.5 or CONFIG VCCAUX=3.3 constraint. In the Spartan-3AN platform,
the user must set CONFIG VCCAUX=3.3 (default) for using the In-System Flash. The
Spartan-3 and Spartan-3E families have a fixed VCCAUX at 2.5V.
www.xilinx.com
77
78
www.xilinx.com
Chapter 3
Highest bandwidth between PROM and FPGA for any serial PROM, resulting in
fastest configuration time.
Multiple I/O and JTAG voltage ranges for maximum system flexibility.
Density migration within a common package footprint. See Table 1-3, page 37.
Sold and supported by Xilinx, with the long product lifetime and reliability associated
with Xilinx products.
In Master Serial mode (M[2:0] = <0:0:0>), the Spartan-3 generation FPGA configures itself
from an attached Xilinx Platform Flash PROM, as illustrated in Figure 3-1, Figure 3-2, and
Figure 3-3.
The figures show optional components in gray and designated NO LOAD. For example,
the Bitstream Generator option ProgPin Pullup internally connects a pull-up resistor
between the PROG_B pin and VCCAUX. An external 4.7 k pull-up resistor to VCCAUX is
still recommended. The external pull-up provides a known pull-up value, and can be
stronger than the internal pull-up alone, which the data sheet specifies at up to 12 k. The
figures show a circled letter to associate a signal with more information found in the text.
The FPGA supplies the CCLK output clock from its internal oscillator to the attached
Platform Flash PROM. In response, the Platform Flash PROM supplies bit-serial data to the
FPGAs DIN input, and the FPGA accepts this data on each rising CCLK edge.
All the FPGA mode-select pins, M[2:0], must be Low when sampled, which occurs when
the FPGAs INIT_B output initially goes High.
The FPGA's DOUT pin is used in daisy-chain applications, described in Daisy-Chained
Configuration, page 87. In a single-FPGA application, the FPGAs DOUT pin is inactive,
but pulled High via an internal resistor.
The Master Serial interface varies slightly between Spartan-3 generation FPGAs.
www.xilinx.com
79
Figure 3-1, page 80 illustrates the Master Serial configuration interface for Spartan-3E and
Spartan-3A/3A DSP FPGAs when the FPGAs VCCAUX supply is at 2.5V. Spartan-3E FPGAs
always have VCCAUX =2.5V. Spartan-3A and Spartan-3A DSP FPGAs support both
VCCAUX = 2.5V or 3.3V. Table 3-1, page 80 lists the FPGA/PROM connections.
Figure 3-2, page 81 illustrates the Master Serial configuration interface for Extended Spartan-3A
family FPGAs when VCCAUX = 3.3V. Spartan-3AN FPGAs always have VCCAUX=3.3V. Table 3-1,
page 80 lists the FPGA/PROM connections.
Figure 3-3, page 82 illustrates the Master Serial configuration interface for Spartan-3 FPGAs.
+1.2V
M2
M1
M0
JTAG Spartan-3E
Voltage Resistors
2.5V
0
3.3V
>68
4.7k
VCCINT
D0
CLK
VCCO
OE/RESET
+2.5V
Spartan-3E
Spartan-3A (2.5V)
Spartan-3A DSP (2.5V)
NO LOAD
4.7k
0
0
0
VCCO_2
DIN
CCLK
INIT_B
DOUT
XCFxxS = +3.3V
XCFxxP = +1.8V
NO LOAD
Spartan-3A
Spartan-3A DSP
Serial Master
Mode
VCCO_0
330
NO LOAD
VCCINT
HSWAP
VCCO_0
PUDC_B
Platform Flash
XCFxx
CEO
CE
CF
VREF
VCCAUX
TMS
+2.5V
TMS
TCK
TCK
VCCJ
TDO
TMS
TCK
TDO
TDI
TDI
PROG_B
N.C.
N.C.
TDO
DONE
TDI
GND
GND
14
PROGRAM
UG332_c3_03_091609
80
FPGA Pin
Platform Flash
PROM Pin
DIN
D0
CCLK
CLK
INIT_B
OE/RESET
Comments
www.xilinx.com
Table 3-1:
FPGA Pin
Platform Flash
PROM Pin
DONE
CE
PROG_B
CF
VCCO_2
VCCO
2.5V or 3.3V
Spartan-3E FPGAs can also support 1.8V configuration.
VCCJ
Comments
FPGA enables PROM during configuration. DONE output
powered by FPGA VCCAUX supply.
+1.2V
VCCO_0
VCCO _0
+3.3V
M2
M1
M0
VCCO_2
DIN
CCLK
INIT_B
DOUT
NO LOAD
Platform Flash
XCFxx
CEO
CE
CF
VREF
TCK
+3.3V
VCCAUX
+3.3V
TMS
VCCO
OE /RESET
Spartan-3A/3AN (3.3V)
Spartan-3A DSP (3.3V)
1
VCCINT
4.7k
0
0
0
XCFxxS = +3.3V
XCFxxP = +1.8V
D0
CLK
330
Serial Master
Mode
NO LOAD
PUDC _B
NO LOAD
4.7k
+3.3V
VCCINT
VCCAUX
+3.3V
TMS
TCK
VCCJ
TDO
TMS
TCK
+3.3V
TDO
TDI
N .C .
N .C .
TDI
PROG _B
TDO
DONE
GND
TDI
GND
14
PROGRAM
Figure 3-2:
UG332_c3_15_052107
Master Serial Mode Using Platform Flash PROM (Extended Spartan-3A Family FPGA,
VCCAUX = 3.3V)
www.xilinx.com
81
V
4.7k
VCCINT
VCCO_4
DIN
INIT_B
DOUT
VREF
HSWAP_EN
0
0
0
M2
M1
M0
TMS
TMS
TCK
TCK
CCLK
CLK
CEO
CE
Spartan-3
Master
Serial
Mode
Platform Flash
XCFxx
+2.5V
CF
4.7k
VCCINT
VCCO
D0
OE/RESET
NO LOAD
VCCAUX
330
Resistors
0
68
NO LOAD
JTAG
Voltage
2.5V
3.3V
XCFxxS = +3.3V
XCFxxP = +1.8V
NO LOAD
+1.2V
VCCJ
TDO
TMS
TCK
TDO
TDI
TDI
PROG_B
N.C.
N.C.
TDI
TDO
DONE
GND
GND
14
PROGRAM
Figure 3-3:
Table 3-2:
82
UG332_c3_16_112206
FPGA Pin
Platform Flash
PROM Pin
DIN
D0
CCLK
CLK
INIT_B
OE/RESET
DONE
CE
PROG_B
CF
VCCO_4
VCCO
2.5V or 3.3V
VCCJ
Comments
www.xilinx.com
Pin Name
FPGA
Direction
Spartan-3E FPGA:
HSWAP
Extended
Spartan-3A
FPGA:
Description
PUDC_B
After
Configuration
Spartan-3:
Dedicated pin
(dont care after
configuration)
Extended
Spartan-3A:
User I/O
M2 = 0, M1 = 0, M0 = 0.
Sampled when INIT_B goes
High.
User I/O
User I/O
Spartan-3:
Dedicated pin.
Spartan-3E
Extended
Spartan-3A:
User I/O. Drive
High or Low if
not used.
User I/O
Connects to PROMs
OE/RESET input. FPGA clears
PROMs address counter at
start of configuration, enables
outputs during configuration.
PROM also holds FPGA in
Initialization state until PROM
reaches Power-On Reset (POR)
state. If CRC error detected
during configuration, FPGA
drives INIT_B Low.
User I/O. If
unused in the
application,
drive INIT_B
High to avoid a
floating value.
See INIT_B
After
Configuration.
During Configuration
Spartan-3 FPGA:
HSWAP_EN
P
M[2:0]
Input
DIN
Input
CCLK
DOUT
INIT_B
Output
Output
Open-drain
bidirectional
I/O
www.xilinx.com
83
Table 3-3:
Pin Name
FPGA
Direction
DONE
Open-drain
bidirectional
I/O
PROG_B
Input
SUSPEND
Input
Description
During Configuration
After
Configuration
When High,
indicates that
the FPGA
successfully
configured.
Drive PROG_B
Low and release
to reprogram
FPGA.
N/A
Enables
SUSPEND
mode. Connect
to GND if
unused.
Voltage Compatibility
Platform Flash PROM
The Platform Flash PROM VCCINT supply must be either 3.3V for the serial XCFxxS
Platform Flash PROMs or 1.8V for the serial/parallel XCFxxP PROMs.
FPGA
Spartan-3E and Spartan-3A/3A DSP FPGAs with VCCAUX at 2.5V
The Spartan-3E or Spartan-3A/3A DSP FPGA VCCO_2 supply input and the Platform
Flash PROM VCCO supply input must be the same voltage. A 2.5V-only interface is easiest
as all signals are the same voltage. A 3.3V interface is also supported but the FPGA
PROG_B and DONE pins require special attention as they are powered by the FPGA
VCCAUX supply, nominally 2.5V. For Spartan-3E FPGAs see application note XAPP453: The
3.3V Configuration of Spartan-3 FPGAs, and for Spartan-3A/3A DSP FPGAs see application
note XAPP459: Interfacing Large-Swing Signals for additional information.
Spartan-3 FPGAs
The Spartan-3 FPGAs VCCO_4 supply input and the Platform Flash PROM VCCO supply
input must be the same voltage. A 2.5V-only interface is easiest as all signals are the same
voltage. A 3.3V interface is also supported but the FPGA PROG_B, DONE, and CCLK pins
require special attention as they are powered by the FPGA VCCAUX supply, nominally 2.5V.
See application note XAPP453: The 3.3V Configuration of Spartan-3 FPGAs for additional
information.
84
www.xilinx.com
JTAG Interface
If the Platform Flash PROM is the last device in the chain, then the JTAG interface voltage
is easily controlled by the PROMs VCCJ supply. If the FPGAs VCCAUX supply is 2.5V and
the JTAG chain is also 2.5V, the interface is simple. To create a 3.3V JTAG interface, even
when the FPGAs VCCAUX supply is 2.5V, connect VCCJ to 3.3V and provide currentlimiting resistors on the FPGAs TDI, TMS, and TCK JTAG inputs.
For Spartan-3A/3A DSP FPGA, the VCCAUX supply can be either 2.5V or 3.3V. If VCCAUX
is 3.3V, then a 3.3V JTAG interface is also easy. No current-limiting resistors are required.
See also JTAG Cable Voltage Compatibility, page 200.
Number of
Configuration Bits
Smallest Possible
Platform Flash PROM
XC3S50A
437,312
XCF01S
XC3S200A
1,196,128
XCF02S
XC3S400A
1,886,560
XCF02S
XC3S700A
2,732,640
XCF04S
XC3S1400A
4,755,296
XCF08P
or XCF04S + XCF02S
XC3SD1800A
8,197,280
XCF08P
or two XCF04S PROMs
XC3SD3400A
11,718,304
XCF16P
XC3S100E
581,344
XCF01S
XC3S250E
1,353,728
XCF02S
XC3S500E
2,270,208
XCF04S
XC3S1200E
3,841,184
XCF04S
XC3S1600E
5,969,696
XCF08P
or XCF04S + XCF02S
Family
Spartan-3A
(Spartan-3AN)
Spartan-3A DSP
Spartan-3E
www.xilinx.com
85
Table 3-4: Number of Bits to Program a Spartan-3 Generation FPGA and Smallest
Platform Flash PROM (Contd)
Family
Spartan-3
FPGA
Number of
Configuration Bits
Smallest Possible
Platform Flash PROM
XC3S50
439,264
XCF01S
XC3S200
1,047,616
XCF01S
XC3S400
1,699,136
XCF02S
XC3S1000
3,223,488
XCF04S
XC3S1500
5,214,784
XCF08P
or XCF04S + XCF02S
XC3S2000
7,673,024
XCF08P
or 2 x XCF04S
XC3S4000
11,316,864
XCF16P
XC3S5000
13,271,936
XCF16P
There 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
PROMs as listed in Table 3-4. The two XCFxxS PROMs have a 3.3V VCCINT supply while
the XCF08P requires a 1.8V VCCINT supply. If the board does not already have a 1.8V
supply available, the two cascaded XCFxxS PROM solution is recommended.
CCLK Frequency
In Master Serial mode, the FPGAs internal oscillator generates the configuration clock
frequency. The FPGA provides this clock on its CCLK output pin, driving the PROMs CLK
input pin. The FPGA starts configuration at its lowest frequency and increases its
frequency for the remainder of the configuration process if so specified in the
configuration bitstream. The maximum frequency is specified using the ConfigRate
bitstream generator option. Table 3-5 shows the maximum ConfigRate settings,
approximately equal to the frequency measured in MHz, for various Platform Flash
PROMs and I/O voltages. These values are determined using the minimum CCLK period
from the appropriate Spartan-3E or Extended Spartan-3A family data sheet. The maximum
ConfigRate for the serial XCFxxS PROMs is reduced at 1.8V. Extended Spartan-3A family
FPGAs do not support a 1.8V configuration interface due to their higher VCCO_2 PowerOn Reset voltage threshold. See Power-On Reset (POR), page 242.
Table 3-5: Maximum ConfigRate Settings Using Platform Flash (Serial Mode,
Commercial Range)
86
I/O Voltage
(VCCO_2, VCCO)
Spartan-3E
ConfigRate Setting
Extended Spartan-3A
Family ConfigRate
Setting
XCF01S
XCF02S
XCF04S
3.3V or 2.5V
25
33
1.8V
12
N/A
XCF08P
XCF16P
XCF32P
3.3V or 2.5V
1.8V
www.xilinx.com
44
25
N/A
Daisy-Chained Configuration
Daisy-Chained Configuration
If the application requires multiple FPGAs, each with different configurations, then
configure the FPGAs using a daisy chain, as shown in Figure 3-4, page 87. Use Master
Serial mode (M[2:0] = <0:0:0>) for the FPGA connected to the Platform Flash PROM and
Slave Serial mode (M[2:0] = <1:1:1>) for all other FPGAs in the daisy chain. After the
master FPGAthe FPGA on the left in the diagramfinishes loading its configuration
data from the Platform Flash, the master device supplies data using its DOUT output pin
to the next device in the daisy chain, on the falling CCLK edge.
Also, to successfully configure a daisy chain, the GTS_cycle bitstream option must be set to
a Startup phase after the DONE_cycle setting for all FPGAs in the chain. This is the
software default setting. Optionally, set GTS_cycle:Done.
CF
PROG_B
DONE
Master FPGA
4.7k
330
200
DIN
DOUT
INIT_B
PROG_B
DONE
Slave FPGA
OE/RESET
DOUT
INIT_B
CE
M2 M1 M0
DIN
VCCO_2
VCCAUX
CCLK
200
DO
CCLK
CLK
M2 M1 M0
Platform Flash
XCFxxx
1 1 1
VCCO_2
4.7k
0 0 0
PROGRAM
UG332_c3_02_111906
Figure 3-4:
www.xilinx.com
87
CLK
VCCO_2
0 0 0
4.7k
330
Platform Flash
XCFxxx
4.7k
VCCAUX
M2 M1 M0
CCLK
DO
DIN
DOUT
CE
INIT_B
OE/RESET
PROG_B
DONE
0
0
Master FPGA
CF
PROGRAM
1 1 1
200
VCCO_2
M2 M1 M0
CCLK
200
DIN
DOUT
INIT_B
PROG_B
DONE
0
0
Slave FPGA
UG332_c3_03_111906
Figure 3-5:
88
www.xilinx.com
JTAG Interface
JTAG Interface
Spartan-3 generation FPGAs and the Platform Flash PROMs both have a four-wire IEEE
1149.1/1532 JTAG port. Both the FPGA and the PROM share the JTAG TCK clock input
and the TMS mode select input. The devices may connect in either order on the JTAG chain
with the TDO output of one device feeding the TDI input of the following device in the
chain. The TDO output of the last device in the JTAG chain drives the JTAG connector.
The JTAG interface on the FPGA is powered by the VCCAUX supply. Consequently, the
PROMs VCCJ supply input must also be 2.5V. To create a 3.3V JTAG interface, refer to
XAPP453: The 3.3V Configuration of Spartan-3 FPGAs for additional information.
www.xilinx.com
89
FPGA
DIN
CCLK
INIT_B
DONE
Platform Flash
D0
CLK
OE/RESET
CE
a) Standard interface
Spartan-3E
Spartan-3A/3AN
Spartan-3A DSP
FPGA
DIN
CCLK
INIT_B
DONE
Platform Flash
D0
CLK
OE/RESET
CE
Spartan-3
FPGA
DIN
CCLK
User I/O
INIT_B
DONE
Platform Flash
D0
CLK
OE/RESET
CE
Platform Flash
D0
CLK
OE/RESET
CE
Spartan-3
FPGA
DIN
CCLK
User I/O
INIT_B
User-I/O
DONE
Platform Flash
D0
CLK
OE/RESET
CE
Figure 3-6:
90
www.xilinx.com
XAPP482: MicroBlaze Platform Flash/PROM Boot Loader and User Data Storage
http://www.xilinx.com/support/documentation/application_notes/xapp482.pdf
StartupClk: CCLK
By default, the configuration Startup clock source is the internally generated CCLK. Keep
the StartupClk bitstream generation option, shown as Step 13 in Figure 1-8, page 45.
-g StartupClk:Cclk
iMPACT
The following steps graphically describe how to create a PROM file using iMPACT from
within the ISE Project Navigator.
www.xilinx.com
91
1.
From within the ISE Project Navigator, double-click Generate PROM, ACE, or JTAG
File from within the Process pane, as shown in Figure 3-7.
UG332_c4_10_110206
Figure 3-7:
2.
UG332_c4_11_19
Figure 3-8:
3.
92
Click Next.
www.xilinx.com
4.
As shown in Figure 3-9, format the FPGA bitstream or bitstreams for a Xilinx PROM.
7
UG332_c3_04_111506
Figure 3-9:
5.
6.
7.
Click Next.
8.
As shown in Figure 3-10, select the xcf (Platform Flash PROM) family from the droplist.
www.xilinx.com
93
10
11
12
UG332_c3_05_111506
Figure 3-10:
9.
Select the desired Platform Flash part number. The example in Figure 3-10 shows an
XCF04 PROM, which stores up to 4 Mbits, or 524,288 bytes.
10. Click Add. This example assumes that the FPGA is connected to a single Platform
Flash PROM. However, multiple Platform Flash PROMs can also be cascaded to create
a larger memory. If the application cascaded multiple PROMs, then click the Add
button to include additional PROMs.
11. For a design that uses a single Platform Flash PROM, the PROM also is located in
position 0. If the application used multiple, cascaded PROMs, each PROM part name
and position would be listed.
12. Click Next.
13. As shown in Figure 3-11, review that the settings are correct to format the Platform
Flash PROM. Click Finish to confirm the settings or Back to change the settings.
94
www.xilinx.com
13
UG332_c3_06_111506
Figure 3-11:
14
17
15
10
16
11
UG332_c3_07_111506
Figure 3-12:
www.xilinx.com
95
17. Click No. This example assumes that the Platform Flash PROM holds only a single
FPGA bitstream. If creating a multi-FPGA configuration daisy chain, click Yes and
select additional FPGA bitstreams.
18. As shown in Figure 3-13, the iMPACT software graphically displays the Platform Flash
PROM and associated FPGA bitstream(s).
18
20
19
UG332_c3_08_111506
Figure 3-13:
2.
Ensure that the programming cable is properly connected both the board and to the
computer or workstation.
96
www.xilinx.com
1.
UG332_c2_09_111506
Figure 3-14:
2.
Click Finish.
3.
As shown in Figure 3-15, the iMPACT software automatically detects the JTAG chain,
if so enabled. This example application is similar to that shown in Figure 3-1. The
FPGA is an XC3S700A, followed in the chain by an XCF04S Platform Flash PROM.
UG332_c3_10_111506
Figure 3-15:
4.
In this example, the XC3S700A precedes the XCF04S Platform Flash PROM in the
chain. The FPGA does not need to be programmed in order to program the Platform
Flash PROM. The iMPACT software prompts for the FPGA bitstream, as shown in
Figure 3-16. Click Bypass to skip programming the FPGA.
www.xilinx.com
97
4
UG332_c3_11_111506
As shown in Figure 3-17, select the PROM data file to be programmed to the Platform
Flash PROM.
5
6
UG332_c3_12_111506
Figure 3-17:
98
6.
Click Open.
7.
As shown in Figure 3-18, the iMPACT software updates the screen image, showing the
files to be loaded to each device in the JTAG chain. To program the Platform Flash
PROM, first click to highlight the XCF04S PROM.
www.xilinx.com
14
UG332_c3_13_111506
Figure 3-18:
8.
Double-click Program.
9.
10
11
12
13
UG332_c3_14_111506
Figure 3-19:
10. Check Verify. Unchecking Verify reduces programming time but iMPACT can only
guarantee correct programming on a verified PROM.
www.xilinx.com
99
11. Check Erase Before Programming. Required for reprogramming. Unchecking the
Erase option reduces programming time for a blank device.
12. Check Load FPGA to force the FPGA to automatically reconfigure with the new
PROM data after PROM programming is complete.
13. Click OK.
14. The iMPACT software indicates successful programming, as shown in Figure 3-18.
Production Programmers
The Xilinx Platform Flash PROMs are supported by a variety of third-party production
programmers. These programmers are the best option for high-volume applications and
many offer gang-programming options.
Table 3-6 provides links to vendors that provide Platform Flash programming support.
The links indicate the specific programmer model numbers, software versions, and any
programming adapters required.
Table 3-6:
Platform Flash
Part
Family
Numbers
Production Programmers
XCF01S
XCFxxS
XCF02S
www.xilinx.com/support/programr/dev_sup.htm#XCF00SP
XCF04S
XCF08P
XCFxxP
XCF16P
www.xilinx.com/support/programr/dev_sup.htm#XCF00SP
XCF32P
Additional Information
100
www.xilinx.com
Chapter 4
The FPGA application needs to store data in nonvolatile memory or to access data
from randomly-accessible, byte-addressable, nonvolatile memory.
In Master SPI mode (M[2:0] = <0:0:1>), the Spartan-3E or Extended Spartan-3A family
FPGA configures itself from an attached industry-standard SPI serial Flash PROM, as
illustrated in Figure 4-1 and Figure 4-2. The figures show optional components in gray and
designated NO LOAD. The figures show a circled letter to associate a signal with more
information found in the text. The FPGA supplies the CCLK output clock from its internal
oscillator and drives the clock input of the attached SPI Flash PROM.
More information on configuration from SPI Flash PROMs can be found in the following
application note.
www.xilinx.com
101
TCK
VREF
VCCAUX
NO LOAD
4.7k
NO LOAD
NO LOAD
Spartan-3E/3A/AN
Spartan-3A DSP
VS2
VS1
DOUT
VS0
INIT_B
+3.3V
VREF
TMS
SS_B
1
1
1
M2
M1
M0
+3.3V
SCK
Spartan-3A/3AN,
Spartan-3A DSP
have internal
pull-up resistors
VCCO_2
MOSI
DIN
CSO_B
CCLK
VCCO_0
MISO
Master
SPI Mode
0
Spartan-3A/3AN,
Spartan-3A DSP
0
have internal
pull-up resistors
1
MOSI
VCCINT
HSWAP
VCCO_0
PUDC_B
Variant
Select
N.C.
N.C.
+1.2V
VCC
D
Q
M25Pxx
S
SPI Flash
C
HOLD
W
GND
VCCAUX
TMS
TCK
TDO
TDI
N.C.
N.C.
14
PROGRAM
TDI
PROG_B
TDO
DONE
GND
820
SPI Direct
Programming
Jumper
Note: Grayed out pull-up resistor on CSO_B is only necessary when HSWAP/PUDC_B is High (I/O Pull-Ups Not Enabled)
Figure 4-1: SPI Flash Configuration Interface for M25P-compatible Devices
Although SPI is a fairly standard and ubiquitous four-wire interface, various available SPI
Flash PROMs use different command protocols. The FPGAs variant select pins, VS[2:0],
define how the FPGA communicates with the SPI Flash, including which SPI Flash
command the FPGA issues to start the read operation and the number of dummy bytes
inserted before the FPGA expects to receive valid data from the SPI Flash. Table 4-2 shows
the available SPI Flash PROMs tested or expected to operate with Spartan-3E/3A FPGAs.
Other compatible devices might work but have not been hardware verified by Xilinx. All
other VS[2:0] values are reserved for future use. Consult the data sheet for the desired SPI
Flash device to determine its suitability.
Figure 4-1 shows the general connection diagram for SPI Flash PROMs that support the
0x0B FAST READ commands, which are most modern 25-series PROMs. The example
shown is an STMicro (Numonyx) M25Pxx PROM.
102
www.xilinx.com
Figure 4-2 shows the connection diagram for Atmel DataFlash serial PROMs, which also
use an SPI-based protocol. Xilinx recommends using C- or D-series DataFlash devices.
Figure 4-6, page 119 demonstrates how to configure multiple FPGAs with different
configurations, all stored in a single SPI Flash. The diagram uses standard SPI Flash
memories but the same general technique applies for Atmel DataFlash.
Xilinx Cable Header
(SPI Flash Direct Programming )
1
14
NO LOAD
NO LOAD
4.7k
NO LOAD
VREF
TCK
VCCAUX
+3.3V
Spartan-3E/-3A/AN
Spartan-3A DSP
VS2
VS1
DOUT
VS0
INIT_B
VREF
TMS
SS_B
1
1
1
M2
M1
M0
+3.3V
SCK
Spartan-3A/3AN,
Spartan-3A DSP
have internal
pull-up resistors
VCCO_2
MOSI
DIN
CSO_B
CCLK
VCCO_0
MISO
Master
SPI Mode
0
Spartan-3A/3AN,
Spartan-3A DSP
0
have internal
pull-up resistors
1
MOSI
VCCINT
HSWAP
VCCO_0
PUDC_B
Variant
Select
N.C.
N.C.
+1.2V
VCC
Atmel
AT45DB
D-Series
DataFlash
SI
SO
CS
SCK
RESET
WP
GND
VCCAUX
TMS
TCK
TDO
TDI
N.C.
N.C.
14
PROGRAM
TDI
PROG_B
820 W
TDO
DONE
GND
SPI Direct
Programming
Jumper
Note: Grayed out pull-up resistor on CSO_B is only necessary when HSWAP/PUDC_B is High (I/O Pull-Ups Not Enabled)
Figure 4-2: SPI Flash Configuration Interface for Atmel DataFlash Devices
www.xilinx.com
103
Spartan-3A/3AN
Spartan-3A DSP
FPGA
Step 1 only
Yes
No
Yes
No
Yes
I/O
Spartan-3
FPGA
Master SPI
mode is not
available on
Spartan-3
FPGAs
No
Optional,
controlled by
HSWAP
Yes
104
Ideally, the end application should use a Xilinx-tested SPI PROM, listed in Table 4-2.
Table 4-3, page 105 lists the specific SPI Flash PROM part numbers tested and
supported within iMPACT for in-system programming using Xilinx programming
cables.
www.xilinx.com
Table 4-2:
SPI Flash Memory Devices Officially Supported by Xilinx and Programmed Using iMPACT
Read Command
SPI Flash
Vendor
STMicro
(Numonyx)
Atmel
Fast
Read
Read
Xilinx
Unique Read (0x03) Array
iMPACT
(0x0B)
(0xE8)
ID
Support
FPGA VS[2:0] Setting
Family
1:1:1
1:0:1
Density (bits)
1:1:0 512K 1M
4M
8M
M25P
M25PE
M45PE
AT45DB
D-series
AT45DB
B-series
2M
Notes:
1. Xilinx iMPACT Support indicates that Xilinx has physically tested compatibility for these SPI Flash memory devices and provides
programming support in the iMPACT programming utility using Xilinx approved JTAG cables. The iMPACT software generates
programming information that is compatible with all the devices listed.
2. Unique ID indicates that these SPI Flash memory device have factory-programmed unique identifier bits, useful for protecting
FPGA applications or IP cores.
Table 4-3:
Vendor
STMicro (Numonyx)
Status
Recommended
Density (bits)
M25Pxx
512K
M25P05A
1M
Atmel
Supported
Recommended
Supported
M25PExx
M45PExx
AT45DBxxxD
AT45DBxxxB
M25P10A
M25PE10
M45PE10
AT45DB011D
AT45DB011B
2M
M25P20
M25PE20
M45PE20
AT45DB021D
AT45DB021B
4M
M25P40
M25PE40
M45PE40
AT45DB041D
AT45DB041B
8M
M25P80
M25PE80
M45PE80
AT45DB081D
AT45DB081B
16M
M25P16
M45PE16
AT45DB161D
AT45DB161B
32M
M25P32
64M
M25P64
128M
M25P128
AT45DB321D
AT45DB321C
AT45DB321B
AT45DB642D
The specific SPI serial memory must support a compatible read command offered by
the FPGA. The specific command set is selected by defining the FPGAs VS[2:0] pins
before configuration. Table 4-4 lists the commands supported on Spartan-3E and
Extended Spartan-3A family FPGAs. The command setting defines which SPI Flash
read command that the FPGA issues at the start of configuration, followed by a 24-bit
address starting at 0, followed by the number of dummy bits required for the specific
command.
www.xilinx.com
105
The Fast Read command (command code 0x0B) is supported on modern 25series SPI serial Flash devices. Set VS[2:0] <1:1:1> to use this command. SPI Flash
PROMs that support the Fast Read command also support the Read command.
The Read command (command code 0x03) is a legacy command set, offered on
all 25-series SPI serial Flash devices. Set VS[2:0] <1:0:1> to use this command.
The Read Array command (command code 0xE8) is offered on all Atmel AT45series DataFlash PROMs. Set VS[2:0] <1:1:0> to use this command.
Some recent SPI Flash PROMs, like the Atmel AT45DB D-series PROMs support
all three read commands.
Table 4-4:
VS[2:0] Pins
VS2
VS1
VS0
Fast Read
0x0B
Read
0x03
Read Array
0xE8
Others
106
Hexadecimal
Command
Code
Read
Command
Address Bits
Dummy Bits
8 bits, all zeros
None
32 bits, all zeros
Reserved
The specific SPI serial memory must be large enough to contain one or more FPGA
bitstreams plus any other nonvolatile memory requirements to support the FPGA
application after configuration.
If using MultiBoot on an Extended Spartan-3A family FPGA, add the size of each
MultiBoot configuration image. Essentially, it is the same as an individual FPGA
image, but MultiBoot allows multiple selectable images within a single FPGA.
Using a daisy-chained configuration scheme, a single SPI Flash PROM can store
multiple FPGA bitstreams. Add the bitstream sizes for each FPGA in the daisy
chain.
If using the SPI PROM to store MicroBlaze code or other nonvolatile data for
the FPGA application after configuration, add the sizes of each of these images.
Add any overhead requirements to align the data to page or sector boundaries as
required by the selected Flash PROM device.
For possible future migration to a larger FPGA or to allow possible upward migration
for additional data, choose a SPI PROM family that offers larger, compatible densities.
For Spartan-3E FPGA applications that require anti-cloning protection, choose an SPI
PROM that provides a unique identifier (ID). See Spartan-3E FPGA: Leveraging
Security Features in Select Commodity Flash PROMs, page 303. Extended Spartan3A family FPGAs provide similar protection features using an SPI PROM. See
Extended Spartan-3A Family FPGA: Imprinting or Watermarking the Configuration
PROM with Device DNA, page 302.
The Xilinx iMPACT software offers direct, in-system programming using Xilinx
programming cables. However, the current software version only supports the
STMicro (Numonyx) and Atmel devices indicated in Table 4-2, page 105. Many
25- series PROMs are directly compatible with the STMicro (Numonyx) M25Pxx
family and could be substituted in production.
www.xilinx.com
Table 4-5: Other SPI Flash Memory Devices With Data Sheet Compatibility (Unverified by Xilinx,
Unsupported in iMPACT)
Read Command
Fast
Read
Read
Xilinx
Read
Array
Unique
(0x03)
iMPACT
(0x0B)
(0xE8)
ID
Support
FPGA VS[2:0] Setting
SPI Flash
Vendor
Density (bits)
Family
1:1:1
1:0:1
AT26
AT25
S25FL
SST25L
SST25V
Macronix
MX25
Chingis
(PMC)
Pm25
AMIC
A25L
Eon
EN25
Atmel
Spansion
(AMD,
Fujitsu)
NX25P
Winbond
(NexFlash)
W25P
W25X
Intel
(Numonyx)
SST
S33
1:1:0 512K 1M
2M
4M
8M
Notes:
1. Compatibility based on publicly available data sheets.
2. Unique ID indicates that these SPI Flash memory device have factory-programmed unique identifier bits, useful for protecting
FPGA applications or IP cores.
www.xilinx.com
107
MicroBlaze RISC processor core integrated in the Spartan-3A or Spartan-3E FPGA. See
SPI Flash Interface after Configuration.
Table 4-6: Number of Bits to Program an Extended Spartan-3A family or Spartan3E FPGA and Smallest SPI Flash PROM
Family
Spartan-3A/3AN
Spartan-3A DSP
Spartan-3E
FPGA
Smallest Usable
SPI Flash PROM
XC3S50A/AN
437,312
512 Kbit
XC3S200A/AN
1,196,128
2 Mbit
XC3S400A/AN
1,886,560
2 Mbit
XC3S700A/AN
2,732,640
4 Mbit
XC3S1400A/AN
4,755,296
8 Mbit
XC3SD1800A
8,197,280
8 Mbit
XC3SD3400A
11,718,304
16 Mbit
XC3S100E
581,344
1 Mbit
XC3S250E
1,353,728
2 Mbit
XC3S500E
2,270,208
4 Mbit
XC3S1200E
3,841,184
4 Mbit
XC3S1600E
5,969,696
8 Mbit
FPGA Connection
STMicro Winbond/
(Numonyx) NexFlash
Silicon
Storage
Technology
Atmel
DataFlash
MOSI
DI
SI
SI
DIN
DO
SO
SO
Slave Select
CSO_B
CS
CE#
CS
Slave Clock
CCLK
CLK
SCK
SCK
Write Protect
W
WP
WP#
WP
108
www.xilinx.com
Table 4-7:
Reset
(see Figure 4-2)
Ready/Busy
(see Figure 4-2)
FPGA Connection
STMicro Winbond/
(Numonyx) NexFlash
Silicon
Storage
Technology
Atmel
DataFlash
HOLD
HOLD
HOLD#
N/A
N/A
N/A
N/A
RESET
N/A
N/A
N/A
RDY/BUS
Y
The mode select pins, M[2:0], and the variant select pins, VS[2:0] are sampled when the
FPGAs INIT_B output goes High and must be at defined logic levels during this time.
After configuration, when the FPGAs DONE output goes High, these pins are all available
as full-featured user-I/O pins.
P Similarly, the FPGAs HSWAP or PUDC_B pin must be defined. Set Low to enable pullup resistors on all user-I/O pins during configuration or High to disable the pull-up
resistors. The HSWAP or PUDC_B control must remain at a constant logic level throughout
FPGA configuration. After configuration, when the FPGAs DONE output goes High, the
HSWAP or PUDC_B pin is available as full-featured user-I/O pin and is powered by the
VCCO_0 supply.
www.xilinx.com
109
Table 4-8:
Pin Name
HSWAP
PUDC_B
Description
During Configuration
After Configuration
User I/O
Input
M2 = 0, M1 = 0, M0 = 1.
Sampled when INIT_B goes
High. Extended Spartan-3A
family FPGAs have internal
pull-up resistors to
VCCO_2.
User I/O
VS[2:0]
Input
User I/O
MOSI
Output
User I/O
Input
User I/O
If HSWAP or PUDC_B = 1,
connect this signal to a 4.7
k pull-up resistor to 3.3V.
DIN
CSO_B
110
Output
www.xilinx.com
Table 4-8:
Pin Name
Description
During Configuration
After Configuration
CCLK
Output
DOUT
Output
User I/O
INIT_B
Open-drain
Active during
configuration. If SPI Flash
PROM requires more than 2
ms to awake after powering
on, hold INIT_B Low until
PROM is ready. See
Power-On Precautions if
System 3.3V Supply is Last
in Sequence, page 112.
If CRC error detected
during configuration,
FPGA drives INIT_B Low.
See CRC Checking during
Configuration, page 313.
bidirectional
I/O
DONE
Open-drain
bidirectional
I/O
PROG_B
Input
www.xilinx.com
111
Table 4-8:
Pin Name
VCCO_2
FPGA
Direction
Description
Voltage
supply
input
SUSPEND
Input
During Configuration
After Configuration
3.3V
N/A
Enables SUSPEND
mode. Connect to GND
if unused.
Voltage Compatibility
Available SPI Flash PROMs use a single 3.3V supply voltage. All of the FPGAs SPI Flash
interface signals are within I/O Bank 2. Consequently, the FPGAs VCCO_2 supply voltage
must also be 3.3V to match the SPI Flash PROM.
Also, see Power-On Precautions if System 3.3V Supply is Last in Sequence, page 112.
See also JTAG Cable Voltage Compatibility, page 200.
Example Minimum Power-On to Select Times for Various SPI Flash PROMs
Vendor
Value
Units
M25Pxx
TVSL
10
Spansion
S25FLxxxA
tPU
10
ms
NexFlash
NX25xx
TVSL
10
Macronix
MX25Lxxxx
tVSL
10
SST25LFxx
TPU-READ
10
STMicro (Numonyx)
112
www.xilinx.com
Table 4-9:
Example Minimum Power-On to Select Times for Various SPI Flash PROMs (Contd)
SPI Flash PROM
Part Number
Vendor
Programmable
Microelectronics
Corporation
Atmel Corporation
Value
Units
Pm25LVxxx
TVCS
50
AT45DBxxxD
tVCSL
50
AT45DBxxxB
20
ms
Notes:
1. Memory vendors are continuously improving their products and specifications. Please check with the memory vendors data
sheets for up-to-date values.
In many systems, the 3.3V supply feeding the FPGA's VCCO_2 input is valid before the
FPGA's other VCCINT and VCCAUX supplies, and consequently, there is no issue. However,
if the 3.3V supply feeding the FPGA's VCCO_2 supply is last in the sequence, a potential
race occurs between the FPGA and the SPI Flash PROM, as shown in Figure 4-3.
3.3V Supply
SPI Flash cannot be selected
SPI Flash PROM
minimum voltage
(VCCO2T )
(VCCINT, VCCAUX
already valid)
Figure 4-3:
If the FPGA's VCCINT and VCCAUX supplies are already powered and valid, then the FPGA
waits for VCCO_2 to reach its minimum threshold voltage before starting configuration.
This threshold voltage is labeled as VCCO2T in the Spartan-3E or Extended Spartan-3A
family data sheet. The range of values is listed in Table 4-10 and are substantially lower
than the SPI Flash PROM's minimum voltage. Once all three FPGA supplies reach their
respective Power-On Reset (POR) thresholds, the FPGA starts the configuration process
and begins initializing its internal configuration memory. After initialization completes,
the FPGA deasserts INIT_B, selects the SPI Flash PROM, and starts sending the
appropriate read command. The SPI Flash PROM must be ready for read operations at this
time. The FPGA typically delays configuration long enough for the configuration source to
be ready. If the configuration source is not ready when the FPGA begins configuration, the
Configuration Watchdog Timer will allow the FPGA to automatically re-attempt
configuration.
There are a few potential solutions if the 3.3V supply is last in the sequence and does not
ramp fast enough, or if the SPI Flash PROM cannot be ready when required by the FPGA.
Change the power sequence order so that the 3.3V VCCO_2 is powered and valid
before the FPGAs VCCINT or VCCAUX supply.
www.xilinx.com
113
Choose a different SPI Flash PROM family or vendor, one with a faster power-on
timing specification. For example, while the Atmel AT45DBxxxB family has 20 ms
power-on requirement, the compatible AT45DBxxxD family requires just 30 s.
Delay the FPGA configuration process by holding either the FPGA's PROG_B input or
INIT_B input Low. Release the FPGA when the SPI Flash PROM is ready. For
example, a simple R-C delay circuit attached to the INIT_B pin forces the FPGA to
wait for a preselected amount of time. Alternately, a Power Good signal from the 3.3V
supply or a system reset signal accomplishes the same purpose. Use an open-drain or
open-collector output when driving PROG_B or INIT_B.
Table 4-10: Spartan-3E and Extended Spartan-3A Family DSP Power-On Reset
Timing and Thresholds
Spartan-3A/3AN
Units
Spartan-3A DSP
Symbol
Description
Spartan-3E
VCCO2T
0.4 to 1.0
0.8 to 2.0
TPOR
Up to 7
Up to 18
ms
CCLK Frequency
In SPI Flash mode, the FPGAs internal oscillator generates the configuration clock
frequency. The FPGA provides this clock on its CCLK output pin, driving the PROMs
Slave Clock input pin. The FPGA begins configuring using its lowest frequency setting. If
so specified in the configuration bitstream, the FPGA increases the CCLK frequency to the
specified setting for the remainder of the configuration process. The maximum frequency
is specified using the ConfigRate bitstream generator option. The maximum frequency
supported by the FPGA configuration logic depends on the timing for the SPI Flash device.
Without examining the timing for a specific SPI Flash PROM, use ConfigRate = 12 or
lower. SPI Flash PROMs that support the FAST READ command support higher data rates.
Some such PROMs support up to ConfigRate = 25 and beyond but require careful data
sheet analysis. See Serial Peripheral Interface (SPI) Configuration Timing, page 138 for
more detailed timing analysis.
114
www.xilinx.com
CCLK Frequency
Table 4-11 lists the various ConfigRate setting options and the corresponding clock-tooutput requirement, TV, for the SPI Flash PROM. The TV value is determined according to
the equation in Table 4-16, page 141. Extended Spartan-3A family FPGAs have more
ConfigRate settings than Spartan-3E FPGAs, hence the shaded cells under the Spartan-3E
column. Unless a ConfigRate setting is specified when generating the bitstream, the
Spartan-3E FPGA uses the default, slowest setting of ConfigRate = 1, which lengthens the
overall configuration time. The Extended Spartan-3A family FPGAs use a default setting of
ConfigRate = 6.
Table 4-11: FPGA ConfigRate Setting and Corresponding SPI Flash PROM Clockto-Output Requirements (TV)
SPI Flash Maximum TV Specification
ConfigRate Bitstream
Setting
Spartan-3E
Spartan-3A/3AN
Spartan-3A DSP
Commercial
Industrial
Commercial
Industrial
< 265
< 224
< 588
< 553
<127
< 106
< 189
< 178
6
(Extended Spartan-3A
family default)
< 58
< 47
< 91.3
< 85.6
12
< 23.5
< 18.3
< 41.9
< 39
13
< 37.1
< 34.8
17
< 27.2
< 25.3
22
< 18.6
< 17.2
< 15.3
< 14.4
27
< 13.9
< 13
33
< 10.1
< 9.2
44
< 5.3
< 4.9
1
(Spartan-3E default)
25
< 6.1
www.xilinx.com
< 3.5
Units
ns
115
FPGA
MOSI
DIN
CSO_B
CCLK
D
Q
S
C
a) During configuration
User -I/O
FPGA
(User I/O)
(User I/O)
1
(User I/O)
SPI Flash
PROM
D
Q De-selected
(Standby)
S
C
Figure 4-4:
De-selecting CSO_B also places the SPI PROM in the lower-power Standby mode. See
Deassert CSO_B to Enter Standby Mode, page 142.
116
www.xilinx.com
DDR SDRAM
MOSI
DIN
CCLK
CLOCK
FPGA
Configuration
SELECT
+3.3V
4.7k
FFFFF
MicroBlaze
Code
DATA_OUT
CSO_B
User I/O
User Data
DATA_IN
SPI Peripherals
DATA_IN
DATA_OUT
CLOCK
SELECT
- A/D Converter
- D/A Converter
- CAN Controller
- Displays
- Temperature Sensor
- ASSP
- ASIC
UG332_c4_09_040107
For an application that already includes a MicroBlaze processor core, the Xilinx
Embedded Development Kit (EDK) includes an SPI interface that connects to the
MicroBlaze OPB bus. Depending on the options used, the SPI interface core uses
between 147 to 203 slices.
For general applications, the 8-bit PicoBlaze processor core offers an easy-to-use
solution that requires approximately 100 slices and a block RAM. Example design
solutions are available for the Spartan-3E FPGA Starter Kit board.
www.xilinx.com
117
Refer to the individual SPI peripheral data sheet for specific interface and communication
protocol requirements.
Caution! Although many devices claim to have an SPI interface, the timing and even signal
polarity vary between devices and between vendors. Check the data sheet for the specific device
to determine compatibility.
118
www.xilinx.com
Daisy-Chained Configuration
Daisy-Chained Configuration
If the application requires multiple FPGAs with different configurations, then configure
the FPGAs using a daisy chain, as shown in Figure 4-6, page 119. Use SPI Flash mode
(M[2:0] = <0:0:1>) for the FPGA connected to the SPI PROM and Slave Serial mode
(M[2:0] = <1:1:1>) for all other FPGAs in the daisy chain. After the master FPGAthe
FPGA on the left in the diagramfinishes loading its configuration data from the SPI Flash
PROM, the master FPGA supplies data to the next FPGA in the daisy chain via the DOUT
output pin, clocked on the falling CCLK edge.
Also, to successfully configure a daisy chain, the GTS_cycle bitstream option must be set to
a Startup phase after the DONE_cycle setting for all FPGAs in the chain. This is the
software default setting. Optionally, set GTS_cycle:Done.
The 0-ohm resistors at the output of each FPGAs INIT_B and DONE pin is recommended
for debugging purposes. Should there be a configuration error, the FPGAs can be
individually isolated. The jumper on the master FPGAs DONE pin is recommended for
future in-system programming support as well as for debugging purposes.
The pull-up resistors shown in gray are optional, but should be provided in the board
design. The resistors themselves do not need to be stuffed during board manufacturing. As
described in Table 2-13, page 65, the dedicated pull-up resistors on Spartan-3 generation
FPGAs are sufficiently strong to pull-up the corresponding signal pin. The Thevenin
termination resistors on CCLK are also optional, but also recommended in the board
design.
DIN
MOSI
CSO_B
INIT_B
PROG_B
DONE
DOUT
INIT_B
PROG_B
Master FPGA
DIN
200
DOUT
4.7k
CCLK
DONE
Slave FPGA
PROGRAM
CCLK
M2 M1 M0
VCCO_2
VCCAUX
330
200
M2 M1 M0
JUMPER
SPI Serial
Flash PROM
1 1 1
VCCO_2
4.7k
0 0 1
UG332_c4_20_111906
Figure 4-6:
Caution! SPI mode daisy chains are supported for Spartan-3E FPGAs only in Stepping 1
silicon versions. SPI mode daisy chains are supported on all Spartan-3E Automotive grade
devices, which are all based on Stepping 1 silicon, and all Extended Spartan-3A family FPGA
versions.
www.xilinx.com
119
SPI Serial
Flash PROM
0 0 1
VCCAUX
330
4.7k
VCCAUX
M2 M1 M0
CCLK
DIN
MOSI
CSO_B
INIT_B
PROG_B
DONE
VCCO_2
4.7k
DOUT
0
JUMPER
Master FPGA
PROGRAM
1 1 1
200
VCCO_2
M2 M1 M0
CCLK
200
DIN
PROG_B
DOUT
INIT_B
DONE
Slave FPGA
UG332_c4_21_111906
Figure 4-7:
Programming Support
In production applications, the SPI Flash PROM is usually preprogrammed before it is
mounted on the printed circuit board. The Xilinx ISE development software produces
industry-standard programming files that can be used with third-party gang
programmers. Consult your specific SPI Flash vendor for recommended production
programming solutions.
There are multiple programming methods for the attached SPI memory as described
below.
The iMPACT programming software supports two different methods to program an
attached SPI Flash PROM, as summarized in Table 4-12.
Using the Direct Programming Method, the programming cable communicates directly to
the SPI Flash PROM. The FPGA is not involved in the programming process and the FPGA
I/O pins that connect to the PROM must be in their high-impedance state (Hi-Z) during
120
www.xilinx.com
Programming Support
programming. Hold the FPGAs PROG_B input Low to place the I/Os in Hi-Z; the FPGAs
DONE pin remains Low.
Using the Indirect Programming Method, the programming cable connects to the FPGAs
JTAG port. The iMPACT software first programs the FPGA with a special design that
performs the actual SPI PROM programming and uses the JTAG interface as a serial
communications port. During the process, the FPGAs DONE output is High because the
FPGA is configured with the programming application. All pins that are not connected to
the SPI Flash PROM or the JTAG interface have an internal pull-up resistor to the VCCO
voltage supply associated with the pin.
For the Spartan-3AN family, iMPACT supports programming of the internal Flash and
does not support indirect programming of external Flash.
Table 4-12:
Detailed Instructions
Interface/Cable Connection
Direct Method
Indirect Method
Low
High
(FPGA is configured with
special programming design)
PROG_B = Low
N/A
High-impedance because
PROG_B = Low
www.xilinx.com
121
Parallel Cable IV
http://www.xilinx.com/products/devkits/HW-PC4.htm
122
www.xilinx.com
Table 4-13:
Signal
Programming Support
Xilinx Download Header Signal Description for In-System SPI Flash PROM Programming
Socket Pin
(top view)
Flying Lead
Label/
Wire Color(1)
Direction
TMS/PROG
TCK/CCLK
VREF
GND
GND
GND
GND
TDO/DONE
GND
10
TDI/DIN
GND
11
12
GND
13
14
(red)
(green)
(yellow)
(magenta)
(white)
/INIT
(gray)
Notes:
1. The Flying Lead adapter is only required if using stake pins instead of the recommended 14-pin socket.
The specified surface-mount cable connector requires only 0.162 square inches of board
space. The Xilinx iMPACT programming solution is only qualified for system prototyping
so the socket can be removed from the production bill of materials to save cost.
Alternatively, the Xilinx programming cables optionally support flying leads that push
on to standard 0.1-inch stake pins. However the ribbon cable and associated socket have
superior signal integrity and provide fast programming speeds. Also ensure that the
programming cable leads are connected correctly. The SPI programming capability is new
for the Xilinx programming cables and existing cables may have different signal labels, as
indicated in Table 4-13.
www.xilinx.com
123
Option 1
Hold the FPGA's PROG_B pin Low throughout the programming process. The
FPGA is unconfigured during the programming process and automatically
loads the new SPI Flash PROM image when PROG_B is released High.
Option 2
Change the FPGA's mode pins to JTAG mode (M[2:0] = <1:0:1>) and pulse the
FPGAs PROG_B pin. Do not perform any JTAG operations. All FPGA I/O pins
are forced to their high-impedance state. The FPGA is unconfigured during the
programming process. The FPGAs M[2:0] pins must be returned to the SPI
Flash setting and PROG_B pin must be pulsed Low before the FPGA reloads the
new SPI Flash PROM image.
Option 3
If using Option 1 or Option 2, be aware that pull-up resistors to VCCO_2 are enabled on the
FPGAs SPI pins if the FPGA's HSWAP or PUDC_B pin is Low. Using Option 3, the FPGAs
SPI pins are fully controlled by the FPGA application.
The Spartan-3A FPGA Starter Kit includes a design example that programs the attached
Atmel AT45DB161D DataFlash PROM using an RS-232 connection to a PC or workstation.
124
www.xilinx.com
MOSI
Spartan-3
Generation
FPGA
TDI
TDO
TMS
TCK
JTAG
MISO (DIN)
SCLK (CCLK)
SS (CSO_B)
SPI Flash
Memory
UG332_c4_xx_080906
Figure 4-8: Using FPGAs JTAG Test Chain to Program Attached SPI Flash
The advantage to this approach is that it requires minimal wiring for in-system
programming and that the SPI Flash PROM can be programmed during other JTAG-based
board test operations.
For easier development, Xilinx recommends including the JTAG programming cable
socket shown in Figure 4-1, page 102 and Figure 4-2, page 103. The FPGA configuration
can be downloaded directly into the FPGA for development purposes without requiring
that the SPI Flash PROM be programmed.
For more information on the JTAG interface, see Chapter 9, JTAG Configuration Mode
and Boundary-Scan,especially Programming Cables and Headers, page 209.
StartupClk: CCLK
By default, the configuration Startup clock source is the internally generated CCLK. Keep
the StartupClk bitstream generation option, shown as Step 13 in Figure 1-8, page 45.
-g StartupClk:Cclk
www.xilinx.com
125
Using ISE Project Navigator, check the Drive Done Pin High option, shown as Step 16 in
Figure 1-8, page 45.
-g DriveDone:Yes
iMPACT
The following steps graphically describe how to create an SPI-formatted PROM file using
iMPACT from within the ISE Project Navigator. To create a Spartan-3A/3A DSP MultiBoot
image for an SPI Flash memory, see Generating an Extended Spartan-3A Family
MultiBoot PROM Image using iMPACT, page 282.
1.
From within the ISE Project Navigator, double-click Generate PROM, ACE, or JTAG
File from within the Process pane, as shown in Figure 4-9.
UG332_c4_10_110206
Figure 4-9:
126
www.xilinx.com
2.
UG332_c4_11_19
Figure 4-10:
3.
Click Next.
4.
As shown in Figure 4-11, format the FPGA bitstream or bitstreams for a 3rd-Party SPI
PROM. This option automatically invokes the -spi option for generating the PROM
file.
www.xilinx.com
127
6
7
UG332_c4_12_110206
Figure 4-11:
5.
6.
7.
Click Next.
8.
As shown in Figure 4-12, select the SPI PROM Density of the targeted device,
measured in bits.
8
9
UG332_c4_13_110206
Figure 4-12:
9.
Click Next.
10. As shown in Figure 4-13, review that the settings are correct to format the SPI PROM.
Click Finish to confirm the settings or Back to change the settings.
128
www.xilinx.com
10
UG332_c4_14_111906
Figure 4-13:
11. As shown in Figure 4-14, click OK to start adding FPGA configuration bitstreams to
the PROM image.
11
12
13
UG332_c4_15_110206
Figure 4-14:
www.xilinx.com
129
14
16
15
UG332_c4_06_110206
Figure 4-15:
PROMGen
PROMGen is a command-line utility that provides an alternate means to create an SPI
PROM programming file. PROMGen can be invoked from within a command window or
from within a script file.
Table 4-14 shows the relevant options for SPI Flash PROM formatting.
Table 4-14:
PROMGen Option
-spi
Description
REQUIRED FOR SPI FLASH PROMs! Specifies the correct bit
ordering required to configure from an SPI Flash memory device.
-p <format>
PROM output file format. Specifies the file format required by the SPI
programming software. Refer to the third party programmer
documentation for details.
-s <size>
Specifies the PROM size in kilobytes. The PROM size must be a power
of 2, and the default setting is 64 kilobytes.
-u <address>
Loads the .bit file from the specified starting address in an upward
direction. This option must be specified immediately before the input
bitstream file.
130
www.xilinx.com
Formatted using the Intel MCS format by specifying the -p mcs option. The output
filename is specified by the -o <promdata>.mcs option, where <promdata> is a
user-specified file name.
The specified FPGA bitstream is loaded in the upward direction, starting at address 0
by specifying the -u 0 option.
The FPGA bitstream to be formatted for the PROM is specified as the last option,
<inputfile>.bit, where <inputfile> is the user-specified file name used when
generating the FPGA bitstream.
promgen -spi -p mcs -o <promdata>.mcs -s 2048 -u 0 <inputfile>.bit
2.
Ensure that the FPGA pins that connect to the SPI Flash are high-impedance (Hi-Z).
See Forcing FPGA SPI Bus Pins to High-impedance During Programming, page 123.
3.
Ensure that the programming cable is properly connected both the board and to the
computer or workstation. See Programmable Cable Connections, page 122.
Click Direct SPI Configuration from within iMPACT, as shown in Figure 4-16.
3
1
UG332_c4_03_101006
Figure 4-16:
www.xilinx.com
131
2.
3.
4.
4
5
UG332_c4_04_101006
Figure 4-17:
5.
Click Open.
6.
Select the Part Name for a supported SPI serial Flash, as shown in Figure 4-18.
6
7
UG332_c4_05_101006
Figure 4-18:
132
7.
Click OK.
8.
The iMPACT software displays the selected SPI Flash PROM, as shown in Figure 4-19.
www.xilinx.com
14
UG332_c4_06_101006
Figure 4-19:
9.
Click Program.
10
11
12
13
UG332_c4_07_101006
Figure 4-20:
11. Check Verify. Unchecking Verify reduces programming time but the iMPACT software
can only guarantee correct programming for a verified PROM.
www.xilinx.com
133
12. Check Erase Before Programming. Unchecking the Erase option reduces
programming time. However, Xilinx recommends erasing the PROM when
downloading a new FPGA bitstream.
13. Click OK.
14. The iMPACT software indicates successful programming, as shown in Figure 4-19.
During the programming process, the FPGA is configured with a special programming
application. Consequently, the FPGAs DONE pin will go High during the programming
process.
Programming Setup
To program the attached and selected SPI PROM using the Indirect method, configure the
board as described below.
1.
2.
Set the FPGA mode select pins for Master SPI mode.
3.
4.
Using iMPACT
To program the attached and selected SPI PROM using the iMPACT software and the
Indirect programming method, follow the steps outlined below. This specific example uses
the Spartan-3A FPGA Starter Kit board, which has an XC3S700A FPGA connected to an
XCF04S Platform Flash PROM on the JTAG chain.
1.
134
Invoke iMPACT and select Configure devices using Boundary Scan (JTAG), as
shown in Figure 4-21.
www.xilinx.com
UG332_c4_22_032807
Figure 4-21:
2.
Select Finish.
3.
(iMPACT 9.1i only) Select the FPGA bitstream file (*.bit) to be programmed into the
FPGA, as shown in Figure 4-22. This step is superfluous but required for iMPACT 9.1i.
This step is eliminated as of iMPACT 9.2i. This file is not the special FPGA-based SPI
programming application.
UG332_c4_23_032807
Figure 4-22:
4.
www.xilinx.com
135
5.
Click Open.
6.
The iMPACT software warns that it changed the Startup clock source over to the JTAG
clock pin, TCK. The SPI Flash image is not affected. This warning is safely ignored.
6
UG332_c4_24_032807
Figure 4-23:
iMPACT Uses the JTAG Clock Input TCK for Startup Clock when Programming via JTAG
7.
As shown in Figure 4-24, select the programming file for the attached SPI Flash PROM.
7
8
UG332_c4_26_032907
Click Open.
9.
Select the part number for the attached SPI Flash PROM, as shown in Figure 4-25.
9
10
UG332_c4_27_032907
Figure 4-25:
136
www.xilinx.com
11
UG332_c4_28_032907
Figure 4-26:
12. As shown in Figure 4-27, the iMPACT software then displays the JTAG chain for the
XC3S700A Spartan-3A FPGA followed by the XCF04S Platform Flash PROM. Click to
highlight the FLASH memory attached to the XC3S700A FPGA. This action enables
the command options shown in Step 13.
12
18
13
UG332_c4_25_032907
Figure 4-27:
www.xilinx.com
137
14
15
16
17
UG332_c4_29_032907
Figure 4-28:
15. Check Verify. Unchecking Verify reduces programming time but the iMPACT software
can only guarantee correct programming for a verified PROM.
16. Check Erase Before Programming. Unchecking the Erase option reduces
programming time. However, Xilinx recommends erasing the PROM when
downloading a new FPGA bitstream.
17. Click OK.
18. The iMPACT software indicates successful programming, as shown in Figure 4-28. The
FPGA is configured with the new programming file.
138
www.xilinx.com
1
PROG_B
(Input)
PUDC_B
HSWAP
HSWAP or PUDC_B must be stable before INIT_B goes High and constant throughout the configuration process.
(Input)
4
VS[2:0]
<1:1:1>
(Input)
Mode input pins M[2:0] and variant select input pins VS[2:0] are sampled when INIT_B
goes High. After this point, input values do not matter until DONE goes High, at which
point these pins become user-I/O pins.
M[2:0]
<0:0:1>
(Input)
TMINIT
INIT_B
(Open-Drain)
TINITM
10
7
TCCLKn
TMCCHn
TMCCLn
TCCLK1
TMCCL1 TMCCH1
T CCLK1
CCLK
TV
DIN
Data
(Input)
TCSS
11
Data
Data
TDCC
CSO_B
Data
TCCD
TCCO
9 Command
MOSI
(msb)
Command
(msb-1)
TDSU
T DH
Pin initially pulled High by internal pull-up resistor if HSWAP or PUDC_B input is Low.
Pin initially high-impedance (Hi-Z) if HSWAP input is High. External pull-up resistor required on CSO_B.
Figure 4-29:
UG332_c4_17_110206
1.
The FPGA powers on, releasing the internal Power-On Reset (POR) circuit or the
PROG_B input returns High.
2.
The FPGA begins clearing its internal configuration memory. The FPGA actively
drives the INIT_B output Low.
3.
Ensure that HSWAP or PUDC_B is at a stable logic level throughout the configuration
process. The value on this input pin defines whether pull-up resistors are enabled
during configuration. Some applications may depend on the pull-up resistors to define
the VS[2:0] variant-select pins and to hold CSO_B High before the FPGA actively
drives it Low.
4.
The VS[2:0] variant-select pins must be defined and stable before the INIT_B pin
returns High. The value on VS[2:0] defines the specific read command that the FPGA
issues to the SPI serial PROM. See Table 4-2, page 105.
5.
The M[2:0] mode-select pins must be defined for Master SPI mode (<0:0:1>) and stable
before the INIT_B pin returns High.
www.xilinx.com
139
6.
After the FPGA completes clearing the internal configuration memory, the FPGA
release the INIT_B pin, allowing it to float High via the dedicated internal pull-up
resistor to VCCO_2.
7.
After the INIT_B pin returns High, the FPGA begins toggling the CCLK output, which
controls all the configuration timing. The CCLK output initially starts at its lowest,
default frequency, approximately 1 MHz.
8.
The SPI Flash requires a High-to-Low transition on the CSO_B output. The FPGA
actively drives the CSO_B output High for one CCLK cycle before asserting the CSO_B
pin Low. This begins the SPI bus transaction.
9.
Based on the VS[2:0] pin values sampled when INIT_B pin returned High, the FPGA
begins issuing a SPI Flash read command. The FPGA sends the command, mostsignificant bit first. The FPGA subsequently sends a 24-bit address, all zeros, and the
appropriate number of dummy bits, also zero, for the select Flash memory. The FPGA
clocks out the command, address, and dummy bits on the MOSI output, clocked on the
falling edge of CCLK.
10. Within the first 384 bits of the configuration bitstream, the FPGA loads the ConfigRate
setting for the remainder of the configuration process. The ConfigRate setting defines
the CCLK frequency. All interface timing must be evaluated for the specific setting. See
CCLK Frequency, page 114 and ConfigRate: CCLK Frequency, page 125.
11. The SPI Flash PROM provides data on the falling edge of CCLK. This PROM data must
be valid and setup on the FPGAs DIN serial data input before next rising edge of
CCLK.
Table 4-15 lists the various FPGA timing parameters associated with the SPI configuration
interface.
Table 4-15: FPGA Timing Symbols for Serial Peripheral Interface (SPI)
Configuration Mode
Symbol
Description
TCCLK1
TCCLKn
TMINIT
Setup time on the VS[2:0] variant-select pins and the M[2:0] mode-select pins
before the rising edge of INIT_B
TCCLKL1
TCCLKLn
Minimum CCLK Low time at the ConfigRate setting specified in the FPGA
bitstream.
TINITM
Hold time on the VS[2:0] variant-select pins and the M[2:0] mode-select pins
before the rising edge of INIT_B
TCCO
TDCC
Setup time on the DIN data input before CCLK rising clock edge
TCCD
Hold time on the DIN data input after CCLK rising clock edge
Table 4-16 shows the relationship between the SPI Flash PROM timing specifications and
the FPGAs configuration timing specifications. For example, the SPI Flash clock-to-output
time, TV, must be less than or equal the FPGA minimum CCLK Low time and the specified
ConfigRate setting, TCCLKLn, minus the FPGAs setup time on the DIN input, TDCC. See
the TV parameter highlighted in Figure 4-29, page 139.
140
www.xilinx.com
Multi-Package Layout
All communication from the FPGA to the SPI Flash PROM, i.e., sending the read
command, address, and dummy bits, all occurs at the default CCLK ConfigRate setting,
which is the slowest setting in the Spartan-3E FPGAs, TCCLK1, which equates to
approximately 1 MHz. The Extended Spartan-3A family families default to 6 MHz.
Table 4-16:
Symbol
Description
Requirement
Units
TCCS
ns
TDSU
ns
TDH
TV
fC or fR
T DH T MCCH1
T V T MCCLn T DCC
1
f C -----------------------------T CCLKn ( min )
ns
ns
MHz
Notes:
1. These requirements are for successful FPGA configuration in SPI mode, where the FPGA provides the CCLK frequency. The postconfiguration requirements may be different, depending on the application loaded into the FPGA and the resulting clock source.
2. Subtract additional printed circuit board routing delay as required by the application.
Multi-Package Layout
Most of the SPI PROM vendors have a multi-package migration scheme that allows a
design to migrate to larger or smaller memory densities.
The multi-package layout provides ...
Density migration between smaller- and larger-density SPI Flash PROMs. Not all
SPI Flash memory densities are available in all packages. The SPI Flash migration
strategy follows nicely with the pinout migration provided by Xilinx FPGAs. Should
the application need more nonvolatile storage, there is always a convenient, upward
density migration path in the SPI Flash PROM, up to 128Mbits.
Supply security. If a certain SPI Flash density is not available in the desired package,
switch to a different package style or to a different density to secure availability.
Likewise, multiple vendors support the STMicroelectronics (Numonyx) footprint.
An example package layout for the M25Pxx SPI serial Flash family, from the Spartan-3E
FPGA Starter Kit Board, is provided in Figure 4-30. The multi-package layout supports the
8-lead 8x6 mm MLP package, the 8-pin SOIC package and the 16-pin SOIC package. Pin 1
for the 8-pin SOIC and MLP packages is located in the top-left corner. However, pin 1 for
the 16-pin SOIC package is located in the top-right corner, because the package is rotated
www.xilinx.com
141
90. The 16-pin SOIC package also has four pins at the center each side that do not connect
on the board. These pins must be left unconnected, i.e. floating.
HOLD
VCC
Pin 1:
16-pin SOIC
Pin 1:
8-pin SOIC
8-lead MLP
S
Q
W
GND
VCC
HOLD
C
D
(Do not connect)
C
D
GND
W
Figure 4-30:
UG230_c15_18_030606
Saving Power
Most SPI Flash memories support multiple power-saving options. The simplest and most
useful is the Standby Mode, which reduces power simply by de-selecting the SPI Flash
memory. Within the FPGA application, drive the CSO_B pin High.
142
www.xilinx.com
Chapter 5
SRAM
EEPROM
EPROM
Masked ROM
NAND Flash memory is a different technology and is commonly used in memory cards for
digital cameras. Extended Spartan-3A family and Spartan-3E FPGAs do not configure
directly from NAND Flash memories.
The FPGAs internal oscillator controls the interface timing and the FPGA supplies the
clock on the CCLK output pin. However, the CCLK signal typically is not connected in
single FPGA applications. The FPGA drives three pins Low during configuration
(LDC[2:0]) and one pin High during configuration (HDC) to the PROMs control inputs.
www.xilinx.com
143
+1.2V
VCCO_1
LDC0
LDC1
HDC
LDC2
A[16:0]
(User I/O)
VCCO_2
A[23:17]
D[7:0]
Not
available in
VQ 100
package
BPI Mode
JTAG
Voltage
2.5V
3.3V
Resistors
0
>68
0
1
0
0
M2
M1
M0
TCK
VCCO
+3.3V
CE#
x8 or
OE# x8/x16
NOR
WE#
Flash
BYTE#
A[n:0]
DQ[15:7] D
+3.3V
DQ[7:0]
+3.3V
Spartan-3E FPGA
BUSY
CCLK
CSI_B
CSO_B
RDWR_B
INIT_B
VREF
TMS
VCCO_0
VCCAUX
GND
NO LOAD
Address Control
0 = BPI-Up
1 = BPI-Down
+3.3V
NO LOAD
VCCINT
HSWAP
VCCO_0
+2.5
TMS
TCK
TDO
TDI
N.C.
N.C.
TDI
PROG_B
GND
TDO
DONE
14
PROGRAM
Figure 5-1:
144
UG332_c5_01_100809
www.xilinx.com
+1.2V
VCCO_1
LDC0
LDC1
HDC
LDC2
A[25:0]
(User I/O)
(User I/O)
VCCO_2
D[7:0]
Not
available on
XC3S50A
BPI Mode
J
1
X
X
TMS
TCK
DQ[15:7]
VCCAUX
+3.3V
DQ[7:0]
M2
M1
M0
Spartan-3A/3AN
Spartan-3A DSP
DOUT
CCLK
CSI_B
CSO_B
RDWR_B
INIT_B
VREF
VCCO
x8 or
CE#
x8/x16
OE#
NOR
WE#
Flash
BYTE#
A[n:0]
+3.3V
+3.3V
GND
NO LOAD
0
BPI-Up
Only 1
0
+3.3V
VCCO_0
VCC
AUX
NO LOAD
VCCINT
PUDC_B
VCCO_0
TMS
TCK
TDO
TDI
N.C.
N.C.
TDI
PROG_B
GND
TDO
DONE
14
PROGRAM
UG332_c5_02_091609
Figure 5-2: Extended Spartan-3A Family FPGA Configured from Parallel NOR Flash
www.xilinx.com
145
Spartan-3A/3AN
Spartan-3A DSP
FPGA
Yes
Yes
Yes
No
24
26
Banks 1 and 2
Bank 1 only
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
12
I/O
Yes
No
(dont care)
Spartan-3
FPGA
No
Optional,
controlled by
HSWAP
Yes
146
www.xilinx.com
Addresses are generally incremented (or decremented for BPI Down mode) on every
falling CCLK edge. The exception is when using Spartan-3A FPGAs as part of a serial daisy
chain (see Serial Daisy Chaining (Extended Spartan-3A Family FPGAs Only), page 157).
Table 5-2:
M2
M1
Mode
Addressing
Spartan-3A/3AN,
Spartan-3A DSP,
Spartan-3E FPGAs
Incrementing
BPI Down
Spartan-3E FPGAs
only
0xFF_FFFF
Decrementing
1
1
Start Address
BPI Up
0
0
Supported Families
The Spartan-3E addressing flexibility allows the FPGA to share the parallel Flash PROM
with an external or embedded processor. Depending on the specific processor architecture,
the processor boots either from the top or bottom of memory. The FPGA is flexible and
boots from the opposite end of memory from the processor. Only the processor or the
FPGA can boot at any given time. The FPGA can configure first, holding the processor in
reset or the processor can boot first, asserting the FPGAs PROG_B pin.
Spartan-3E FPGAs generally provide up to 24 address lines to access an attached parallel
memory. There are a few exceptions as described below.
Spartan-3E FPGAs available in the TQ144 package only provide 20 address lines,
which is more than sufficient for the smaller FPGA array sizes offered in the TQ144
package.
Similarly, the XC3S100E FPGA in the CP132 package only has 20 address lines while
the XC3S250E and XC3S500E FPGAs in the same package have 24 address lines.
The BPI address pins are not provided on Spartan-3E FPGAs offered in the VQ100.
Consequently, Spartan-3E FPGAs in the VQ100 package cannot configure from a
parallel NOR Flash, but can configure using parallel Xilinx Platform Flash (XCFxxP).
As shown in Figure 5-14, page 170, the mode select pins, M[2:0], are sampled when the
FPGAs INIT_B output goes High and must be at defined logic levels during this time.
After configuration, when the FPGAs DONE output goes High, the mode pins are
available as full-featured user-I/O pins.
P Similarly, the FPGAs HSWAP pin must be Low to enable pull-up resistors on all userI/O pins or High to disable the pull-up resistor. The HSWAP or PUDC_B control must
remain at a constant logic level throughout FPGA configuration. After configuration,
when the FPGAs DONE output goes High, the HSWAP or PUDC_B pin is available as fullfeatured user-I/O pin and is powered by the VCCO_0 supply.
On Spartan-3E FPGAs, the RDWR_B and CSI_B pins must be Low throughout the
configuration process, although the start of configuration is delayed until CSI_B is
asserted. After configuration, these pins also become user I/O. The RDWR_B and CSI_B
are not used and are ignored on Extended Spartan-3A family FPGAs.
In a single-FPGA application, the FPGAs CSO_B and CCLK pins are not used but are
actively driving during the configuration process. The Spartan-3E BUSY pin, not available
on Extended Spartan-3A family FPGAs, is not used but actively drives during
configuration and is available as a user I/O after configuration.
www.xilinx.com
147
After configuration, all of the interface pins except DONE and PROG_B are available as
user I/Os.
Table 5-3:
Pin Name
HSWAP
PUDC_B
P
FPGA
Direction
Input
Description
During Configuration
After Configuration
User I/O
Input
M2 = 0, M1 = 1. Set M0 = 0 to start
at address 0, increment addresses.
On Spartan-3E FPGAs, optionally
set M0 = 1 to start at address
0xFFFFFF and decrement
addresses. Sampled when INIT_B
goes High.
User I/O
Spartan-3E
FPGAs only:
CSI_B
Input
User I/O
Spartan-3E
FPGAs only:
RDWR_B
Input
User I/O
LDC0
Output
LDC1
Output
User I/O
HDC
Output
User I/O
148
www.xilinx.com
Table 5-3:
Pin Name
FPGA
Direction
Description
During Configuration
After Configuration
LDC2
D
Output
Spartan-3E
FPGAs:
A[23:0]
Output
Address
User I/O
Data Input
User I/O.
Spartan-3A
Spartan-3AN
Spartan-3A DSP
FPGAs:
A[25:0]
D[7:0]
Input
CSO_B
Output
User I/O
Not used in single-FPGA
applications. In a daisy-chain
configuration, this pin connects to
the CSI_B pin of the next FPGA in
the chain. If HSWAP or
PUDC_B = 1 in a multi-FPGA
daisy-chain application, connect
this signal to a 4.7 k pull-up
resistor to VCCO_2. Actively drives
Low when selecting a downstream
device in the chain.
Spartan-3E:
FPGAs
BUSY
Output
Busy Indicator.
User I/O.
Spartan-3A
Spartan-3AN
Output
User I/O.
Spartan-3A DSP
FPGAs:
DOUT
www.xilinx.com
149
Table 5-3:
Pin Name
FPGA
Direction
Description
During Configuration
After Configuration
CCLK
Output
INIT_B
Opendrain
bidirectional I/O
DONE
Opendrain
bidirectional I/O
PROG_B
Input
SUSPEND
Input
N/A
Enables SUSPEND
mode. Connect to
GND if unused.
Voltage Compatibility
V The FPGAs parallel Flash interface signals are within I/O Banks 1 and 2. The majority
of parallel Flash PROMs use a single 3.3V supply voltage. Consequently, in most cases, the
FPGAs VCCO_1 and VCCO_2 supply voltages must also be 3.3V to match the parallel
Flash PROM. There are some 1.8V parallel Flash PROMs available and Spartan-3E FPGAs
interface with these devices if the VCCO_1 and VCCO_2 supplies are also 1.8V. Extended
Spartan-3A family FPGAs do not support 1.8V PROMs because of the Spartan-3A FPGAs
Power-On Reset (POR) voltage threshold, VCCO2T, shown in the appropriate Extended
Spartan-3A family data sheet and summarized in Table 12-1, page 243.
Also, see Power-On Precautions if 3.3V Supply is Last in Sequence, page 168.
See also JTAG Cable Voltage Compatibility, page 200.
150
www.xilinx.com
Flash Vendor
Status
STMicroelectronics (Numonyx)
M29W
Hardware tested
Atmel
AT29 / AT49
Hardware tested
Spansion
S29
Intel (Numonyx)
Hardware tested
Macronix
MX29
Spartan-3A/3AN
Spartan-3A DSP
FPGA
Uncompressed
File Sizes (bits)
Smallest Usable
Minimum Required
Parallel Flash PROM
Address Lines
XC3S50A/AN
437,312
XC3S200A/AN
1,196,128
2 Mbit
A[17:0]
XC3S400A/AN
1,886,560
2 Mbit
A[17:0]
XC3S700A/AN
2,732,640
4 Mbit
A[18:0]
XC3S1400A/AN
4,755,296
8 Mbit
A[19:0]
XC3SD1800A
8,197,280
8 Mbit
A[19:0]
XC3SD3400A
11,718,304
16 Mbit
A[20:0]
www.xilinx.com
151
Table 5-5: Number of Bits to Program an Extended Spartan-3A Family or Spartan-3E FPGA and Smallest
Usable Parallel PROM (Contd)
FPGA
Uncompressed
File Sizes (bits)
XC3S100E
581,344
1 Mbit
A[16:0]
XC3S250E
1,353,728
2 Mbit
A[17:0]
XC3S500E
2,270,208
4 Mbit
A[18:0]
XC3S1200E
3,841,184
4 Mbit
A[18:0]
XC3S1600E
5,969,696
8 Mbit
A[19:0]
Family
Spartan-3E
Smallest Usable
Minimum Required
Parallel Flash PROM
Address Lines
CCLK Frequency
In BPI mode, the FPGAs internal oscillator generates the configuration clock frequency
that controls all the interface timing. The FPGA starts configuration at its lowest frequency
and increases its frequency for the remainder of the configuration process if so specified in
the configuration bitstream. The maximum frequency is specified using the ConfigRate
bitstream generator option.
Table 5-6: Maximum ConfigRate Settings for Parallel Flash PROMs (Commercial
Temperature Range)
ConfigRate
Bitstream Setting
Spartan-3A/3AN,
Spartan-3A DSP FPGAs
< 263 ns
< 609 ns
< 120 ns
< 189 ns
< 49 ns
< 85 ns
N/A
< 71 ns
N/A
< 60 ns
10
N/A
< 43 ns
12
< 14 ns
< 33 ns
13
N/A
< 28 ns
17
N/A
< 18 ns
Units
ns
Notes:
1. PCB signal propagation time assumed to be 1 ns.
152
www.xilinx.com
Table 5-6 shows the maximum ConfigRate settings for various PROM read access times
over the Commercial temperature operating range. See Byte Peripheral Interface (BPI)
Timing, page 170 for more detailed timing information. Extended Spartan-3A family
FPGAs have more ConfigRate options and therefore offer finer matching to specific
memory interface speeds. See Table 5-8, page 161 for ConfigRate settings when using
parallel Platform Flash PROMs.
Despite using slower ConfigRate settings, BPI mode is equally fast as the other
configuration modes. In BPI mode, data is accessed at the ConfigRate frequency and
internally serialized with an 8X clock frequency.
Similarly, the parallel Flash PROM interface can be expanded to additional parallel
peripherals. The address, data, LDC1 (OE#) and HDC (WE#) control signals are common
to all parallel peripherals. Connect the chip-select input on each additional peripheral to
one of the FPGA user I/O pins. If HSWAP or PUDC_B = 0 during configuration, the FPGA
holds the chip-select line High via an internal pull-up resistor. If HSWAP or PUDC_B = 1,
connect the select line to +3.3V via an external 4.7 k pull-up resistor to avoid spurious
read or write operations. After configuration, drive the select line Low to select the desired
peripheral. Refer to the individual peripheral data sheet for specific interface and
communication protocol requirements.
www.xilinx.com
153
The FPGA optionally supports a 16-bit peripheral interface by driving the LDC2 (BYTE#)
control pin High after configuration. See Precautions Using x8/x16 Flash PROMs for
additional information.
A Spartan-3E FPGA provides up to 24 address lines during configuration, addressing up
to 128 Mbits (16 Mbytes). An Extended Spartan-3A family provides up to 26 address lines,
addressing up to 512 Mbits (64 Mbytes). If using a larger parallel PROM, connect the upper
PROM address lines to FPGA user I/O. During configuration, the upper address lines will
be pulled High if HSWAP or PUDC_B = 0. Otherwise, use external pull-up or pull-down
resistors on these address lines to define their values during configuration.
Caution! Different Flash memory vendors use different nomenclature when naming address
pins. Make sure that the FPGA connects correctly to the selected memory.
32Mbit Flash
(4Mx8 Mode)
FPGA
32Mbit Flash
(2Mx16 Mode)
FPGA
LDC0
LDC1
HDC
LDC2
CE#
OE#
WE#
BYTE#
D[7:0]
DQ[7:0]
D[7:0]
DQ[7:0]
A[21:1]
A[20:0]
A[21:1]
A[20:0]
A0
(User I/O)
User_CE#
User_OE #
User_WE#
1
DQ15/A-1
User_D15
DQ[14:8]
User_D[14:8]
CE#
OE#
WE#
BYTE#
DQ15/A-1
DQ[14:8]
Figure 5-3:
FPGA Supports x8 Interface before Configuration and Optional x16 Interface after
Configuration
Connecting a Spartan-3E or Extended Spartan-3A family FPGA to a Flash PROM that
supports both x8/x16 modes is simple, but does require a precaution. Various Flash PROM
vendors use slightly different interfaces to support both x8 and x16 modes. Some vendors
(Intel/Numonyx, Micron, some STMicroelectronics/Numonyx devices) use a
straightforward interface with pin naming that matches the FPGA connections. However,
the PROMs A0 pin is wasted in x16 applications and a separate FPGA user-I/O pin is
required for the D15 data line. Fortunately, the FPGA A0 pin is still available as a user I/O
after configuration, even though it connects to the Flash PROM.
154
www.xilinx.com
Daisy Chaining
Other vendors (AMD, Atmel, Silicon Storage Technology, Spansion, and some
STMicroelectronics/Numonyx devices) use a pin-efficient interface but change the
function of one pin, called IO15/A-1, depending if the PROM is in x8 or x16 mode.
Figure 5-3 illustrates this interface. In x8 mode, BYTE# = 0 controlled by the FPGAs LDC2
pin, the Flashs IO15/A-1 pin becomes the least-significant address line into the Flash
memory. The IO15/A-1 line selects a byte location. The A0 address line, which one might
assume to be the least-significant address line, is actually the select line for word (x16)
locations.
After the FPGA configures successfully, the FPGA application can optionally access the
Flash memory using a 16-bit data interface. The FPGA application drives BYTE# = 1,
which switches the definition of the IO15/A-1 pin. This pin then becomes the mostsignificant data bit, D15 because byte addressing is not required in x16 mode. Check to see
if the Flash PROM has a pin named IO15/A-1 or DQ15/A-1. If so, be careful to connect
x8/x16 Flash PROMs correctly, as shown in Figure 5-3 and Table 5-7. Also, remember that
the D[14:8] data connections require FPGA user I/O pins but that the D15 data is already
connected for the FPGAs A0 pin.
Table 5-7:
FPGA Pin
LDC2
BYTE#
LDC1
OE#
LDC0
CS#
HDC
WE#
A[23:1]
A[n:0]
A[n:0]
A[n:0]
A0
IO15/A-1
D[7:0]
IO[7:0]
IO[7:0]
IO[7:0]
User I/O
IO[14:8]
Some x8/x16 Flash PROMs have a long setup time requirement on the BYTE# signal. For
the FPGA to configure correctly, the PROM must be in x8 mode with BYTE# = 0 at poweron or when the FPGAs PROG_B pin is pulsed Low. If required, extend the BYTE# setup
time for a 3.3V PROM using an external 680 pull-down resistor on the FPGAs LDC2 pin
or by delaying assertion of the CSI_B select input to the FPGA.
Daisy Chaining
If the application requires multiple FPGAs with different configurations, then configure
the FPGAs using a daisy chain, as shown in Figure 5-4, page 157 or Figure 5-5, page 159.
www.xilinx.com
155
Parallel daisy chains from a BPI mode master FPGA are supported by both Spartan3E and Extended Spartan-3A family FPGAs.
Serial daisy chains from a BPI mode master FPGA are only supported by Extended
Spartan-3A family FPGAs.
To successfully configure a daisy chain, the GTS_cycle bitstream option must be set to a
Startup phase after the DONE_cycle setting for all FPGAs in the chain. This is the software
default setting. Optionally, set GTS_cycle:Done.
156
www.xilinx.com
Daisy Chaining
Spartan-3A/3AN/3A DSP
Parallel NOR
Flash
M2
M1
M0
HSWAP
PUDC_B
LDC0
LDC1
HDC
LDC2
A[25:0]
CE#
OE#
WE#
BYTE#
A[n:0]
D[7:0]
DQ[7:0]
+3.3V
INIT_B
JUMPER
DONE
DONE
+3.3V
+3.3V
D[7:0]
1
1
0
M2
M1
M0
INIT_B
PROG_B
DONE
Figure 5-4:
D[7:0]
CSI_B
CSO_B
CCLK
RDWR_B
1
1
0
M2
M1
M0
INIT_B
PROG_B
DONE
W
W
CSI_B
CSO_B
CCLK
RDWR_B
W
W
Slave
Parallel
Mode
4.7k
4.7k
Master
FPGA
NO LOAD
0W
Intermediate
FPGAs
Last FPGA in
Daisy Chain
Spartan-3A/3AN/3A DSP,
Spartan-3E,
Virtex-5 FPGAs
PROG_B
CCLK
0
0
BUSY
DOUT
CCLK
CSI_B
CSO_B
RDWR_B INIT_B
NO LOAD
D[7:0]
UG332_c5_05_040107
After the master FPGAthe FPGA on the top left in Figure 5-4finishes loading its
configuration data from the parallel Flash PROM, the master device continues generating
addresses to the Flash PROM and asserts its CSO_B output Low, enabling the next FPGA
in the daisy chain. The next FPGA then receives parallel configuration data from the Flash
PROM. The master FPGAs CCLK output synchronizes data capture.
If the FPGAs HSWAP or PUDC_B pin is High, then pull-up resistors are disabled during
configuration and an external 4.7k pull-up resistor must be added on the CSO_B pin,
which guarantees a logic High to the CSI_B input of the next device in the chain. If FPGAs
HSWAP or PUDC_B pin is Low, no external pull-up is necessary.
www.xilinx.com
157
As shown in Figure 5-5, page 159, all downstream FPGAs in the serial daisy chain use
Slave Serial mode (M[2:0] = <1:1:1>) and can be from any Xilinx FPGA family.
The CCLK output from the master device operates at 8 times the frequency of the Flash
read interface and CCLK synchronizes all FPGAs in the daisy chain. The master FPGA
accesses the byte-wide Flash once every 8 CCLK cycles but provides serial data on its
DOUT output to downstream FPGAs every CCLK cycle. iMPACT programming software
automatically adjusts the CCLK frequency when serial daisy chains are selected in Step 14,
Figure 5-10, page 165. In standalone BPI mode, the ConfigRate option determines the bytewide interface frequency. When a BPI daisy chain is selected, the ConfigRate option
determines the serial interface frequency, and the parallel Flash interface will run at 1/8 of
that rate.
After the master FPGAthe FPGA on the top left in Figure 5-5finishes loading its
configuration data from the parallel Flash PROM, the master device continues generating
addresses to the Flash PROM. The master FPGA reads byte-wide data from the PROM,
internally serializes the data, and provides the data to downstream devices via its DOUT
output pin. The next FPGA in the daisy chain then receives serial configuration data from
the preceding FPGA in the chain. The master FPGAs CCLK output synchronizes data
capture.
158
www.xilinx.com
BPI Mode
CE#
OE#
WE#
BYTE#
A[n:0]
D[7:0]
DQ[7:0]
DOUT
CCLK
CSI_B
CSO_B
RDWR_B INIT_B
PROG_B
A[25:0]
CCLK
0
INIT_B
JUMPER
DONE
DONE
Master
FPGA
DOUT
DIN
DIN
1
1
1
M2
M1
M0
INIT_B
PROG_B
DONE
Slave
Serial
Mode
DOUT
CCLK
CCLK
Figure 5-5:
NO LOAD
0
0
PUDC_B
CCLK
LDC0
LDC1
HDC
LDC2
A[25:0]
1
1
1
M2
M1
M0
INIT_B
PROG_B
DONE
Intermediate
FPGAs
Last FPGA in
Daisy Chain
M2
M1
M0
0
1
0
Parallel NOR
Flash
NO LOAD
Spartan-3A/3AN/3A DSP
FPGA
UG332_c5_06_052107
Serial Daisy Chains are Only Available for Extended Spartan-3A Family BPI Mode
www.xilinx.com
159
+1.2V
+1.8V
VCCINT
PUDC_B
VCCO_0
VCCINT
VCCO_1
LDC0
LDC1
HDC
LDC2
Not
available on
XC3S50A
+3.3V
X
X
M2
M1
M0
Platform Flash
XCFxxP
VCCO_2
D[7:0]
V
D[7:0]
EN_EXT_SEL
REV_SEL0
REV_SEL1
BUSY
FPGA DOUT
CCLK
CSI_B
CSO_B
RDWR_B
INIT_B
VREF
VCCAUX
TMS
TMS
TCK
TCK
CEO
CE
Spartan-3A/3AN/3A DSP
Dont care
VCCO
A[25:0]
BPI Mode
0
BPI-Up
Only 1
0
VCCO_0
CLK
CLKOUT
OE /RESET
+3.3V
CF
+3.3V
VCCJ
TMS
TCK
TDO
TDI
TDI
PROG_B
GND
N.C.
N.C.
TDO
DONE
TDO
TDI
GND
14
PROGRAM
Figure 5-6:
160
UG332_c9_16_030309
Master BPI Mode Using Xilinx Parallel Platform Flash PROMs (XCFxxP)
The diagram in Figure 5-6 shows an Extended Spartan-3A family FPGA, but the same
approach also works with Spartan-3E FPGAs.
The Xilinx Parallel Platform Flash PROM family is in-system programmable using
JTAG, similar to the FPGA.
The FPGAs LDC2, LDC1, LDC0, and HDC outputs actively drive during
configuration. Use the LDC0 output to enable the Platform Flash PROM during
www.xilinx.com
configuration. After configuration, the FPGA application drives LDC0, now an I/O
pin to enable or disable the PROM.
After configuration, the FPGA application can control the I/O pins that connect to the
PROM, the application can read additional non-configuration data from the PROM.
A similar approach using Slave Parallel mode is possible, minus the MultiBoot capability.
The solution requires either an external configuration clock source or the Platform Flash
PROMs internal clock option. The advantage of the alternate solution is that the FPGAs
address pins are not active during configuration. Furthermore, if using an external clock
source, the clock frequency has little variation and likely operates at a higher average
frequency, which shortens configuration time.
Platform Flash
Part Number
I/O Voltage
(VCCO_2, VCCO)
Spartan-3E FPGA
ConfigRate Setting
Spartan-3A/3AN
and
Spartan-3A DSP FPGA
ConfigRate Setting
XCF08P
XCF16P
XCF32P
3.3V or 2.5V
25
33
StartupClk: CCLK
By default, the configuration Startup clock source is the internally generated CCLK. Keep
the StartupClk bitstream generation option, shown as Step 13 in Figure 1-8, page 45.
-g StartupClk:Cclk
www.xilinx.com
161
Using ISE Project Navigator, check the Drive Done Pin High option, shown as Step 16 in
Figure 1-8, page 45.
-g DriveDone:Yes
iMPACT
The following steps graphically describe how to create a PROM file for parallel NOR Flash
using iMPACT from within the ISE Project Navigator. iMPACT supports indirect
programming for the Spartan-3A and Spartan-3A DSP families. iMPACT supports
programming the internal Flash of the Spartan-3AN family. If creating a Spartan-3A/3A
DSP MultiBoot image for a parallel Flash memory, see Generating an Extended Spartan3A Family MultiBoot PROM Image using iMPACT, page 282.
1.
From within the ISE Project Navigator, double-click Generate PROM, ACE, or JTAG
File from within the Process pane, as shown in Figure 5-7.
UG332_c4_10_110206
Figure 5-7:
162
www.xilinx.com
2.
UG332_c4_11_190206
Figure 5-8:
3.
Click Next.
www.xilinx.com
163
4.
6
7
UG332_c5_10_111806
Figure 5-9:
164
5.
6.
7.
Click Next.
www.xilinx.com
8.
As shown in Figure 5-10, select the Parallel PROM Density, measured in bytes. This
example uses a 32 Mbit Flash PROM, equivalent to 4 Mbytes.
10
11
13
12
14
15
UG332_c5_12_111806
Figure 5-10:
9.
Click Add.
10. The selected PROM size appears in the 0 position. The Master BPI mode uses a single
PROM.
11. Check Create BPI-mode PROM.
12. Choose whether the BPI Master Device is either a Spartan-3E or Spartan-3A FPGA.
13. If the Spartan-3E option is selected, then choose whether the PROM file is loaded at
address 0 using incrementing addresses (BPI Up) or at the highest address location
using decrementing addresses (BPI Down). This option is not available if the
Spartan-3A option is the selected BPI Master Device.
14. If the Spartan-3A option is selected, then choose whether to create a Parallel or Serial
configuration daisy chain. This option is not available if the Spartan-3E option is the
selected BPI Master Device, although Spartan-3E FPGAs support parallel daisy chains.
15. Click Next.
www.xilinx.com
165
16. As shown in Figure 5-11, start selecting the FPGA bitstreams to store in the PROM.
16
19
17
22
20
18
21
UG332_c5_12_111806
166
www.xilinx.com
23. As shown in Figure 5-12, the iMPACT software graphically displays the selected
configuration topography. In this example, a single parallel PROM provides the
bitstreams to two XC3S700A FPGAs using a serial daisy-chain configuration.
23
25
24
UG332_c5_13_111806
Figure 5-12:
www.xilinx.com
167
The FPGA itself can also be used as a parallel Flash PROM programmer during
development and test phases. Because parallel NOR Flash is most commonly used with
the MicroBlaze processor core, the Xilinx Platform Studio (XPS) includes Flash
programming support. Essentially, XPS downloads a Flash programmer into the FPGA via
the FPGAs JTAG port. The FPGA then performs necessary the Flash PROM programming
algorithms and receives programming data from the host via the FPGAs JTAG interface.
Similarly, the FPGA application can leverage an existing communication channel in the
system to program or update the Flash memory. The Spartan-3E FPGA Starter Kit board
provides a design example that programs the on-board Intel (Numonyx) StrataFlash
PROM using the boards RS-232 serial port. Similarly, the Spartan-3A FPGA Starter Kit
board provides a similar example, but for the STMicro (Numonyx) M29DW323DT parallel
Flash PROM.
Flash PROM
Part Number
Value
Units
J3 v. D
tVCCPH
60
Spansion
S29AL016M
tVCS
50
Macronix
MX29LV004C
tVCS
50
Intel Corp.
(Numonyx)
In many systems, the 3.3V supply feeding the FPGA's VCCO_2 input is valid before the
FPGA's other VCCINT and VCCAUX supplies, and consequently, there is no issue. However,
if the 3.3V supply feeding the FPGA's VCCO_2 supply is last in the sequence, a potential
race occurs between the FPGA and the NOR Flash PROM, as shown in Figure 5-13.
168
www.xilinx.com
3.3V Supply
Flash cannot be selected
Flash PROM
minimum voltage
Flash
PROM
VCC setup
(tVCS )
(VCCO2T )
(VCCINT, VCCAUX
already valid)
Figure 5-13: Parallel NOR Flash PROM/FPGA Power-On Timing if 3.3V Supply is
Last in Power-On Sequence
If the FPGA's VCCINT and VCCAUX supplies are already valid, then the FPGA waits for
VCCO_2 to reach its minimum threshold voltage before starting configuration. This
threshold voltage is labeled as VCCO2T in Table 12-1, page 243 and ranges from
approximately 0.4V to 2.0V, substantially lower than the NOR Flash PROM's minimum
voltage. Once all three FPGA supplies reach their respective Power On Reset (POR)
thresholds, the FPGA starts the configuration process and begins initializing its internal
configuration memory. The initialization varies by family and arrays size, listed in
Table 12-2, page 244. After initialization, the FPGA deasserts INIT_B, selects the NOR
Flash PROM, and starts accessing data. The parallel NOR Flash PROM must be ready for
read operations at this time.
If the 3.3V supply is last in the sequence and does not ramp fast enough, or if the parallel
NOR Flash PROM cannot be ready when required by the FPGA, delay the FPGA
configuration process by holding either the FPGA's PROG_B input or INIT_B input Low,
described in Delaying Configuration, page 246. Release the FPGA when the parallel
NOR Flash PROM is ready. For example, a simple R-C delay circuit attached to the INIT_B
pin forces the FPGA to wait for a preselected amount of time. Alternately, a Power Good
signal from the 3.3V supply or a system reset signal accomplishes the same purpose. If
using a multi-FPGA daisy-chain configuration, use an open-drain or open-collector output
when driving PROG_B or INIT_B as multiple FPGAs are connected to the same node.
Similarly, if the Power Good signal is a 3.3V signal, remember that PROG_B is powered by
VCCAUX, which must be 2.5V on Spartan-3 and Spartan-3E FPGAs and may be 2.5V or 3.3V
on Spartan-3A/3A DSP FPGAs. Add a 68 or larger series resistor if there is a voltage
mismatch.
www.xilinx.com
169
Flash three times before failing. If the FPGA fails to configure, it then drives the INIT_B pin
Low, indicating a failure.
PUDC_B
HSWAP
(Input)
HSWAP or PUDC_B must be stable before INIT_B goes High and remain constant throughout configuration.
CSI_B
(Input)
RDWR_B
(Input)
M[2:0]
(Input)
Mode input pins M[2:0] are sampled when INIT_B goes High. After this point,
input values do not matter until DONE goes High, at which point the mode pins
become user-I/O pins.
<0:1:1>
TMINIT
TINITM
INIT_B
(Open-Drain)
Pin initially pulled High by internal pull-up resistor if HSWAP or PUDC_B input is Low.
LDC[2:0]
HDC
CSO_B
9
7
6
CCLK
TCCLK1
TCCLK1
T INITADDR
11
TCCLKn
TCCO
A[23:0]
0xFF_FFFF
Address
0xFF_FFFE
12 TAVQV
D[7:0]
(Input)
10
Byte 0
Byte 1
Shaded values indicate timing specifications for external parallel NOR Flash PROM.
Figure 5-14:
Data
Address
TCCD
TDCC
Data
Address
Data
Data
UG332_c5_08_012709
170
The M[2:0] mode pins must be set for BPI mode. Only the Spartan-3E FPGA supports
the BPI Down mode. Both Spartan-3E and Extended Spartan-3A family FPGAs
support BPI Up mode. See Table 5-2. The mode pin must be setup with sufficient time
before the rising edge of INIT_B.
www.xilinx.com
2.
On Spartan-3E FPGAs, the CSI_B select input and the RDWR_B read/write control
input must be Low before the rising edge of INIT_B. It is possible to delay the start of
BPI mode configuration by controlling when CSI_B is asserted Low. The CSI_B and
RDWR_B pins are not used for Extended Spartan-3A family FPGAs.
3.
The HSWAP or PUDC_B pull-up resistor control input must be setup and valid before
the rising edge of INIT_B. Similarly, the example in Figure 5-14 shows the pull-up
resistors enabled.
4.
The HSWAP or PUDC_B control input defines the initial condition for the FPGA pins
that control the Flash, including LDC2, LDC1, LDC0, HDC, and CSO_B. If HSWAP or
PUDC_B = 1, then these pins are floating (Hi-Z). If HSWAP or PUDC_B = 0, then these
pins have an internal pull-up resistor.
5.
After the FPGA completes its internal housecleaning and allows INIT_B to go High,
the FPGA actively drives the Flash control outputs.
6.
The FPGA begins driving the CCLK clock output, which controls all the timing for BPI
interface.
7.
The CCLK output begins operating at its lowest frequency option. The ultimate
frequency is controlled by a bitstream option called ConfigRate.
8.
The FPGA-generated address outputs are clocked by the falling edge of CCLK.
9.
The initial address is held for five CCLK cycles in BPI Up mode and two CCLK cycles
in BPI Down mode. BPI Down mode is only available on Spartan-3E FPGAs.
10. In response to the address inputs provided by the FPGA, the attached PROM
asynchronously presents output data.
11. During the first 320 bits in the bitstream, the FPGA loads the ConfigRate bitstream
setting that potentially increases the CCLK output frequency of in order to reduce
configuration time.
12. Two directly-related factors control the interface timing. One factor is the PROM data
access time, typically called TACC (tAVQV) or TAVQV in memory data sheets. The other
is the maximum CCLK frequency, controlled by the ConfigRate bitstream generator
setting. A faster PROM access time allows a higher ConfigRate setting, resulting in a
faster CCLK frequency and a correspondingly faster configuration time. See Table 5-6,
page 152.
Table 5-10 shows the timing requirements of the attached parallel Flash PROM, based on
FPGA data sheet timing values.
Table 5-10:
Symbol
Requirement
Units
TCE
(tELQV)
T CE T INITADDR
ns
TOE
(tGLQV)
T OE T INITADDR
ns
TACC
(tAVQV)
ns
www.xilinx.com
171
Table 5-10:
Symbol
TBYTE
(tFLQV,
tFHQV)
Requirement
Units
T BYTE T INITADDR
ns
Notes:
1. These requirements are for successful FPGA configuration in BPI mode, where the FPGA generates the CCLK clock signal. The
post-configuration requirements might be different, depending on the application loaded into the FPGA and the resulting clock
source.
2. Subtract additional printed circuit board routing delay as required by the application.
3. The initial BYTE# timing can be extended using an external, appropriately sized pull-down resistor on the FPGAs LDC2 pin. The
resistor value also depends on whether the FPGAs HSWAP or PUDC_B pin is High or Low.
172
www.xilinx.com
Table 5-11:
Pins
Device
Edge
Bottom
Right
Global Buffer
Input Pin
BPI Mode
Configuration Pin
GCLK0
RDWR_B
GCLK2
D2
GCLK3
D1
GCLK12
D7
GCLK13
D6
GCLK14
D4
GCLK15
D3
RHCLK0
A10
RHCLK1
A9
RHCLK2
A8
RHCLK3
A7
RHCLK4
A6
RHCLK5
A5
RHCLK6
A4
RHCLK7
A3
www.xilinx.com
173
174
www.xilinx.com
Chapter 6
www.xilinx.com
175
176
www.xilinx.com
Chapter 7
www.xilinx.com
177
+1.2V
M2
M1
M0
Spartan-3E/3A/3AN/3A DSP
D[7:0] FPGA
on Spartan-3A/
BUSY (DOUT
3AN/3A DSP)
CSI_B
CSO_B
INIT_B
RDWR_B
CCLK
VCCAUX
TMS
TCK
GND
TDI
PROG_B
Microcontroller
Processor
Tester
Computer
GND
PROGRAM
TDO
DONE
VCCAUX
NOTE:
Only Spartan-3A,
Spartan-3AN, and
Spartan-3A DSP
FPGAs support
VCCAUX = 3.3V
VCCAUX
NO LOAD
Internal memory
Disk drive
Over network
Over RF link
1
1
0
VCCO_2
4.7k
Configuration
Memory
Source
VCC
D[7:0]
BUSY
SELECT
READ/WRITE
CLOCK
PROG_B
DONE
INIT_B
Spartan-3A,
Spartan-3AN,
and Spartan-3A DSP
FPGAs have internal
pull-up resistors
VCCO _ 0
330
Intelligent
Download Host
VCCINT
HSWAP
VCCO_0
PUDC_B
NO LOAD
4.7K
Slave
Parallel
Mode
J
1
VREF
TMS
TCK
TDO
TDI
N.C.
N.C.
14
JTAG
Voltage
2.5V
3.3V
Resistors
0
>68
Figure 7-1:
178
www.xilinx.com
+1.2V
Microcontroller
Processor
Tester
Computer
HSWAP_EN
1
1
0
M2
M1 Spartan-3 FPGA
M0
Slave
Parallel
TMS
Mode
TCK
TDI
PROG_B
+2.5V
TDO
DONE
GND
PROGRAM
VCCAUX
NO LOAD
GND
VCCAUX
4.7k
CCLK
330
Internal memory
Disk drive
Over network
Over RF link
VCCINT
D[7:0]
VCCO_4
BUSY
VCCO_5
CS_B
RDWR_B
INIT_B
4.7k
Configuration
Memory
Source
VCC
D[7:0]
BUSY
SELECT
READ/WRITE
CLOCK
PROG_B
DONE
INIT_B
NO LOAD
Intelligent
Download Host
VCCAUX
VREF
TMS
TCK
TDO
TDI
N.C.
N.C.
14
JTAG
Voltage
2.5V
3.3V
Resistors
0
>68
Figure 7-2:
UG332_c7_02_022607
www.xilinx.com
179
Table 7-1:
FPGA Outputs
Function
PROG_B
CSI_B RDWR_B
D[7:0]
BUSY
CCLK
INIT_B
DONE
D[7:0]
to FPGA
D[7:0]
to FPGA
0 to 1
1 to 0s
D[7:0]
from
FPGA
8x
Notes:
X = dont care
= rising edge
CSI_B is CS_B in the Spartan-3 family
180
www.xilinx.com
Table 7-2:
Pin Name
Spartan-3E:
HSWAP
FPGA
Direction
Input
Spartan-3A:
Spartan-3AN
Spartan-3A DSP:
Description
User I/O Pull-Up Control. When
Low during configuration,
enables pull-up resistors in all
I/O pins to respective I/O bank
VCCO input.
During Configuration
Drive at valid logic level
throughout configuration.
PUDC_B
Spartan-3:
After Configuration
Spartan-3:
Dedicated pin (dont
care after configuration)
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP:
User I/O
HSWAP_EN
M[2:0]
Input
M2 = 1, M1 = 1, M0 = 0
Sampled when INIT_B goes
High.
User I/O
D[7:0]
Input
Data Input.
Spartan-3:
Spartan-3E:
BUSY
Output
Spartan-3E:
Input
RDWR_B
Input
CCLK
Input
External clock.
Spartan-3A
Spartan-3AN
Spartan-3A DSP:
CSI_B
Spartan-3:
CS_B
www.xilinx.com
181
Table 7-2:
Pin Name
Spartan-3E:
FPGA
Direction
Output
Spartan-3A
Spartan-3AN
Description
During Configuration
User I/O
Spartan-3A DSP:
CSO_B
After Configuration
INIT_B
Open-drain
bidirectional
I/O
DONE
Open-drain
bidirectional
I/O
PROG_B
Input
SUSPEND
Input
N/A
Enables SUSPEND
mode. Connect to GND
if unused.
Voltage Compatibility
V Most Slave Parallel interface signals are within the FPGAs I/O Bank 2, supplied by the
VCCO_2 supply input. The VCCO_2 voltage can be 2.5V or 3.3V to match the requirements
of the external host, ideally 2.5V. 1.8V configuration interfaces are possible with the
Spartan-3 and Spartan-3E families. Using 1.8V or 3.3V requires additional design
considerations because the DONE and PROG_B pins are powered by the FPGAs 2.5V
VCCAUX supply. Extended Spartan-3A family FPGAs do not support 1.8V PROMs because
of the Spartan-3A FPGAs Power-On Reset (POR) voltage threshold, VCCO2T, shown in the
appropriate Extended Spartan-3A family data sheet and summarized in Table 12-1,
page 243.
See XAPP453: The 3.3V Configuration of Spartan-3 FPGAs for additional information.
Also see JTAG Cable Voltage Compatibility, page 200.
182
www.xilinx.com
Daisy Chaining
Daisy Chaining
If the application requires multiple FPGAs with different configurations, then configure
the FPGAs using a daisy chain. Use Slave Parallel mode (M[2:0] = <1:1:0>) for all FPGAs in
the daisy chain. There are two possible topologies available, one that supports only
Spartan-3E and Extended Spartan-3A family FPGAs and another that works with any
modern Xilinx FPGA, Virtex or Spartan-II FPGA and later.
NO LOAD
+3.3V
D[7:0]
NO LOAD
CCLK
INIT_B
DONE
+3.3V
+3.3V
INIT_B
PROG_B
DONE
0
1
1
0
M2
M1
M0
INIT_B
PROG_B
DONE
M2
M1
M0
CSI_B
CSO_B
CCLK
RDWR_B
0
1
1
0
Slave
Parallel
Mode
4.7k
D[7:0]
W
W
CSI_B
CSO_B
CCLK
RDWR_B
W
W
4.7k
W
D[7:0]
PROG_B
First, Intermediate
FPGAs
Spartan-3A/3AN/3A DSP,
Spartan-3E,
Virtex-5 FPGAs
Figure 7-3:
Last FPGA in
Daisy Chain
www.xilinx.com
183
Slave Parallel Daisy Chains Using Any Modern Xilinx FPGA Family
Figure 7-4, page 184 describes an alternate Slave Parallel daisy-chain scheme that supports
any modern Xilinx FPGA family, including all Spartan-3 generation FPGAs. The topology
is similar to that shown in Figure 7-3, page 183 except that each FPGA has a separate CSI_B
or CS_B chip-select input.
D[7:0]
+3.3V
NO LOAD
FPGA_SEL1
FPGA_SEL0
NO LOAD
CCLK
RDWR_B
INIT_B
CSI_B
CSO_B
CCLK
RDWR_B
CSI_B
CSO_B
CCLK
RDWR_B
INIT_B
PROG_B
DONE
1
1
0
M2
M1
M0
INIT_B
PROG_B
DONE
M2
M1
M0
1
1
0
D[7:0]
Slave
Parallel
Mode
D[7:0]
DONE
PROG_B
First, Intermediate
FPGAs
Last FPGA in
Daisy Chain
Figure 7-4:
UG332_c7_c4_120106
CSI_B
The active-Low chip-select input (CSI_B) enables the SelectMAP interface. When CSI_B is
High, the FPGA ignores the SelectMAP interface. The data port and BUSY output pin are
high-impedance (Hi-Z). CSI_B in the Spartan-3E and Extended Spartan-3A families is
equivalent to CS_B in the Spartan-3 family.
If only one device is being configured through the SelectMAP and readback is not
required, or if ganged SelectMAP configuration is used, connect the CSI_B signal to GND.
184
www.xilinx.com
RDWR_B
The RDWR_B input controls whether the SelectMAP data pins are inputs or outputs.
When RDWR_B = 0, the D[7:0] data pins are inputs (writing to the FPGA).
When RDWR_B = 1, the D[7:0] data pins are outputs (reading from the FPGA).
When writing configuration data to the FPGA, the RDWR_B pin must be Low. When
reading back configuration information from the FPGA, the RDWR_B pin must be High,
while CSI_B is deasserted.
Changing the value of RDWR_B while CSI_B is Low triggers an ABORT if the FPGA
receives a rising edge on CCLK (see SelectMAP ABORT, page 188). If Readback is not
used, RDWR_B can be tied to ground or used for debugging with SelectMAP ABORT.
The RDWR_B signal is ignored while CSI_B is High. Read/write control (three-state
control) of the D[7:0] data pins is asynchronous. The FPGA actively drives SelectMAP data.
CCLK
All activity on the SelectMAP data bus is synchronous to CCLK. When writing
configuration data to the FPGA, RDWR_B is Low and the FPGA samples the data on rising
CCLK edges. When RDWR_B is set for read control (RDWR_B = 1, Readback), the FPGA
updates the SelectMAP data pins on rising CCLK edges.
Configuration can be paused by pausing CCLK as outlined in Non-Continuous
SelectMAP Data Loading, page 187.
BUSY
If the system writes data to or reads data from the FPGA at less than 50 MHz, then the
BUSY pin can be left unconnected. Extended Spartan-3A family FPGAs do not require a
BUSY pin but have the same functionality on the DOUT pin.
BUSY is an output indicating when the device is ready to receive configuration data or
drive Readback data.
When BUSY = 0, the FPGA is ready to receive or send data, depending on the
operation.
When BUSY = 1, the FPGA is not ready to receive or send data. If writing to the FPGA,
hold the current data value until BUSY returns Low.
When CSI_B is deasserted (CSI_B = 1), the BUSY pin is in a high-impedance (Hi-Z) state.
BUSY remains in a Hi-Z state until CSI_B is asserted. If CSI_B is asserted before power-up
for example, if the pin is tied to GND BUSY initially is in a Hi-Z state, then drives Low
after the Power-On Reset is released.
www.xilinx.com
185
On the next rising CCLK edge, the FPGA begins sampling the D[7:0] data pins. Actual
FPGA configuration begins after the FPGA recognizes the synchronization word, as
described in Synchronization, page 247.
After the configuration bitstream is loaded, the device enters the Startup sequence. The
FPGA asserts its DONE signal High in the Startup phase specified by the DONE_cycle
bitstream option. See Startup, page 251. The processor or controller must continue
sending CCLK pulses until after the Startup sequence successfully completes, which
requires several CCLK pulses after DONE goes High.
After configuration, the CSI_B and RDWR_B signals can be deasserted, or they can remain
asserted. Because the SelectMAP port is inactive, toggling RDWR_B at this time does not
cause an ABORT event. Figure 7-5 summarizes the timing of SelectMAP configuration
with continuous data loading.
PROG_B
4
INIT_B
CCLK
13
CSI_B
2
14
RDWR_B
8
DATA[7:0]
BUSY
Byte 0
9
Byte 1
10
11
Byte n
3
High-Z
12
DONE
UG332_c7_05_081006
Figure 7-5:
The following numbered items correspond to the markers provided in Figure 7-5.
1.
CSI_B signal can be tied Low if there is only one device on the SelectMAP bus. If CSI_B
is not tied Low, it can be asserted at any time.
2.
RDWR_B can be tied Low if readback is not needed. RDWR_B should not be toggled
after CSI_B has been asserted because this triggers an ABORT. See SelectMAP
ABORT, page 188.
3.
If CSI_B is tied Low, BUSY drives Low before INIT_B returns High.
4.
The FPGA samples the M[2:0] mode-select pins when INIT_B goes High.
5.
6.
7.
8.
The first D[7:0] byte is loaded on the first rising CCLK edge after CSI_B is asserted.
9.
The configuration bitstream is loaded one byte per rising CCLK edge.
10. After the last byte is loaded, the FPGA enters the Startup sequence.
11. The startup sequence lasts a minimum of eight CCLK cycles.
186
www.xilinx.com
12. The DONE pin goes High during the startup sequence. Additional CCLK cycles can be
required to complete the startup sequence. See Startup, page 251.
13. After configuration has finished, the CSI_B signal can be deasserted.
14. After the CSI_B signal is deasserted, RDWR_B can be deasserted.
Deassert the CSI_B signal with a free-running CCLK, shown in Figure 7-6 and
described in Deasserting CSI_B, page 187.
2.
Pause CCLK, shown in Figure 7-7 and described in Pausing CCLK, page 188.
Deasserting CSI_B
Note: This method is only supported in the Spartan-3 and Spartan-3E FPGAs. It is not supported in
the Extended Spartan-3A FPGAs, which should instead use the Pausing CCLK method. CSI_B is
labeled CS_B in the Spartan-3 family.
PROG_B
2
INIT_B
5
10
11
12
13
14
CCLK
3
CSI_B
DATA[7:0]
1
RDWR_B
4
BUSY
High-Z
High-Z
High-Z
UG332_c7_06_040207
Figure 7-6:
The following numbered items correspond to the markers provided in Figure 7-6.
1.
The external processor drives RDWR_B Low, setting the FPGAs D[7:0] pins as inputs
for configuration. The RDWR_B input can be tied Low if Readback is not used in the
application. RDWR_B should not be toggled after CSI_B has been asserted because this
triggers an ABORT, described in SelectMAP ABORT, page 188.
2.
www.xilinx.com
187
3.
The processor asserts CSI_B Low, enabling the SelectMAP interface. The CSI_B input
can be tied Low if there is only one device on the SelectMAP bus. If CSI_B is not tied
Low, it can be asserted at any time.
4.
BUSY goes Low shortly after CSI_B is asserted. If CSI_B is tied Low, BUSY is driven
Low before INIT_B returns High.
5.
6.
7.
8.
9.
Pausing CCLK
4
Byte 0
Byte 1
Byte n
CCLK
3
CSI_B
2
RDWR_B
1
DATA[7:0]
UG332_c7_07_081106
Figure 7-7:
The following numbered items correspond to the markers provided in Figure 7-7.
1.
The D[7:0] data pins are high-impedance (Hi-Z) while CSI_B is deasserted.
2.
3.
CSI_B is asserted by the processor. The FPGA captures configuration data on rising
CCLK edges.
4.
5.
6.
SelectMAP ABORT
An ABORT is an interruption in the SelectMAP configuration process or in the Readback
sequence that occurs if the RDWR_B pin changes state while CSI_B is asserted Low.
During a configuration ABORT, the FPGA drives internal status information onto the
D[7:4] pins over the next four CCLK cycles. The other data pins, D[3:0] remain High. After
the ABORT sequence finishes, the processor that is downloading the FPGA must
188
www.xilinx.com
SelectMAP ABORT
resynchronize the configuration logic before resuming configuration. For applications that
must deassert RDWR_B between bytes use the method described in Pausing CCLK,
page 188.
CCLK
CSI_B
RDWR_B
STATUS
DATA[7:0]
BUSY
ABORT
UG332_c7_08_081106
2.
The processor changes the value on the RDWR_B pin while the FPGA is still selected;
CSI_B is Low.
3.
BUSY goes High if CSI_B remains asserted Low. The FPGA drives the status word onto
the data pins if RDWR_B is High, reading data from the FPGA. The Status value is not
presented by the FPGA if RDWR_B is Low.
4.
The ABORT lasts for four clock cycles, and Status is updated.
www.xilinx.com
189
CCLK
CSI_B
RDWR_B
FPGA
DATA[7:0]
BUSY
ABORT
Figure 7-9:
UG332_c7_09_081106
1.
2.
The processor changes the RDWR_B pin while the FPGA is still selected; CSI_B is Low.
3.
BUSY (Spartan-3/3E only) goes High if CSI_B remains asserted Low. The FPGA drives
the status word onto the data pins if RDWR_B is High, reading data from the FPGA.
The Status value is not presented by the FPGA if RDWR_B is Low.
ABORT operations during Readback typically are not followed by a status word because
the RDWR_B signal will be Low, causing the ABORT. When RDWR_B is Low, the
processor is writing to the FPGA and the FPGAs D[7:0] pins are inputs. The FPGA cannot
present the Status value.
190
www.xilinx.com
SelectMAP ABORT
Table 7-3:
Bit Number
D7
CFGERR_B
Meaning
Configuration Error, active Low
0 = A configuration error has occurred.
1 = No configuration error.
D6
DALIGN
D5
RIP
Readback In Progress
0 = No readback in progress.
1 = A readback is in progress.
D4
IN_ABORT_B
D[3:0]
N/A
The ABORT sequence lasts four CCLK cycles. During those cycles, the status word changes
to reflect data alignment and ABORT status. An example ABORT sequence appears in
Table 7-4.
Table 7-4:
D[7:0] from
FPGA
D7
D6
D5
D4
D[3:0]
CFGERR_B
DALIGN
RIP
IN_ABORT_B
N/A
11011111
1111
11001111
1111
10001111
1111
10011111
1111
After the last cycle, the synchronization word can be reloaded to establish data alignment.
The FPGA can be resynchronized after the ABORT completes by resending the
configuration synchronization word. See Table 12-3, page 247.
2.
To resynchronize the device, CSI_B must first be deasserted then reasserted. To resume
configuration or readback, resend the last configuration or readback packet that was in
progress when the ABORT occurred. Alternatively, restart configuration or readback from
the beginning.
www.xilinx.com
191
Persist
Generally, the FPGAs dual-purpose configuration pins become user-I/O pins after
configuration. The SelectMAP configuration port can be maintained after configuration by
setting the bitstream generation option Persist:Yes or by selecting Allow SelectMAP Pins to
Persist in the Project Navigator. Allowing the configuration port to persist enables
readback or reconfiguration through the external configuration pins.
The pins that retain their configuration function when Persist:Yes is selected appear in
Table 7-5. These pins become disconnected from the user design when Persist is used and
therefore cannot be used by the design.
Table 7-5:
Pin Name
FPGA Families
Description
M[2:0]
Mode Select
CCLK
Configuration Clock
(Dedicated in Spartan-3)
INIT_B
Initialization
CSI_B
CS_B
Spartan-3
RDWR_B
Read/Write
BUSY
Spartan-3, Spartan-3E
D[7:0]
Data
A[23:20]
Spartan-3E
Highest-order Address
Lines
SelectMAP Reconfiguration
The term reconfiguration refers to reprogramming an FPGA after its DONE pin has gone
High, which is distinctly different than programming the FPGA immediately after power
is applied. To reconfigure the FPGA, pulse the PROG_B pin Low, which is identical to
configuration, or reconfigure by resynchronizing the FPGA and sending configuration
data.
Generally, the FPGAs SelectMAP pins become user-I/O pins after configuration, because
the Persist:No bitstream option is set by default. To reconfigure a device in SelectMAP
mode without pulsing PROG_B, set the bitstream option Persist:Yes, which reserves the
Slave Parallel (SelectMAP) interface pins after configuration, preventing them from
becoming user-I/O pins.
Reconfigure the FPGA by clocking the appropriate synchronization word, shown in
Table 12-3, page 247, into the SelectMAP port. The remainder of the operation is identical
192
www.xilinx.com
to configuration as described above. The devices support full reconfiguration through the
SelectMAP port.
CCLK
Cycle
Hex
Equivalent
D7
D6
D5
D4
D3
D2
D1
D0
0xAB
0xCD
Notes:
1. D[0:7] represent the SelectMAP DATA pins.
Some applications can accommodate the non-conventional data ordering without much
difficulty. For other applications, it may be more convenient to store the source
configuration data file with the data bits already bit-swapped, meaning that the bits in
each byte of the data stream are reversed. The Xilinx PROM file generation software
provides the option to generate bit-swapped PROM files.
Byte Swapping
The .mcs, .exo, and .tek PROM file formats are byte-swapped unless the -spi option is
used. The .hex file format can be byte-swapped or not byte-swapped, depending on user
options. The bitstream files (.bit, .rbt, .bin) are never byte-swapped.
The .hex file format contains only configuration data. The other PROM file formats
include address and checksum information that should not be sent to the FPGA. The
address and checksum information is used by some third-party device programmers, but
is not programmed into the PROM.
Figure 7-10 shows how two bytes of data (0xABCD) are byte-swapped.
www.xilinx.com
193
Hex:
SelectMAP D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5 D6 D7
Data Pin:
Binary:
ByteSwapped
Binary:
SelectMAP
D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
Data Pin:
ByteSwapped
Hex:
3
ug071_30_120903
Figure 7-10:
The MSB of each byte goes to the D0 pin regardless of the orientation of the data:
In the byte-swapped version of the data, the bit that goes to D0 is the rightmost bit
In the non-byte-swapped data, the bit that goes to D0 is the leftmost bit.
194
www.xilinx.com
Chapter 8
www.xilinx.com
195
+1.2V
HSWAP
VCCINT
VCCO_0
VCCO_2
Slave
Serial
Mode
Internal memory
Disk drive
Over network
Over RF link
VCC
CLOCK
SERIAL_OUT
PROG_B
DONE
INIT_B
V
M2
M1
M0
CCLK
DIN
Spartan-3E
FPGA
DOUT
INIT_B
VCCAUX
TDO
TDI
TMS
TCK
GND
Microcontroller
Processor
Tester
Computer
+2.5V
+2.5V
PROG_B
DONE
GND
4.7k
Configuration
Memory
Source
1
1
1
4.7k
Intelligent
Download Host
VCCO_0
330
PROG_B
Recommend
open-drain
driver
+2.5V
JTAG
TDI
TMS
TCK
TDO
Figure 8-1:
DS312-2_54_022305
The mode select pins, M[2:0], are sampled when the FPGAs INIT_B output goes High and
must be at defined logic levels during this time. After configuration, when the FPGAs
DONE output goes High, the mode pins are available as full-featured user-I/O pins.
P Similarly, the FPGAs HSWAP (PUDC_B) pin must be Low to enable pull-up resistors
on all user-I/O pins or High to disable the pull-up resistors. The HSWAP (PUDC_B)
control must remain at a constant logic level throughout FPGA configuration. After
configuration, when the FPGAs DONE output goes High, the HSWAP (PUDC_B) pin is
available as a full-featured user-I/O pin in the Spartan-3E and Extended Spartan-3A
FPGAs and is powered by the VCCO_0 supply.
196
www.xilinx.com
Voltage Compatibility
Voltage Compatibility
V Most Slave Serial interface signals are within the FPGAs I/O Bank 2, supplied by the
VCCO_2 supply input. The VCCO_2 voltage can be 3.3V or 2.5V to match the requirements
of the external host, ideally 2.5V. 1.8V configuration interfaces are possible with the
Spartan-3 and Spartan-3E families. Using 3.3V or 1.8V requires additional design
considerations because the DONE and PROG_B pins are powered by the FPGAs 2.5V
VCCAUX supply. Extended Spartan-3A family FPGAs do not support 1.8V PROMs because
of the Spartan-3A FPGAs Power-On Reset (POR) voltage threshold, VCCO2T, shown in the
appropriate Extended Spartan-3A family data sheet and summarized in Table 12-1,
page 243.
See XAPP453: The 3.3V Configuration of Spartan-3 FPGAs for additional information.
Daisy Chaining
If the application requires multiple FPGAs with different configurations, then configure
the FPGAs using a serial daisy chain, as shown in Figure 1-3, page 33. Use Slave Serial
mode (M[2:0] = <1:1:1>) for all FPGAs in the daisy chain. After the lead FPGA is filled with
its configuration data, the lead FPGA passes configuration data via its DOUT output pin to
the next FPGA on the falling CCLK edge.
www.xilinx.com
197
Table 8-1:
Pin Name
HSWAP_EN,
HSWAP, or
PUDC_B
FPGA
Direction
Input
Description
User I/O Pull-Up Control. When
Low during configuration, enables
pull-up resistors in all I/O pins to
respective I/O bank VCCO input.
During Configuration
Drive at valid logic level
throughout configuration.
After Configuration
Spartan-3:
Dedicated pin (dont
care after
configuration)
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP:
User I/O
M[2:0]
Input
M2 = 1, M1 = 1, M0 = 1
Sampled when INIT_B goes
High.
User I/O
DIN
Input
Data Input.
User I/O
CCLK
Input
External clock.
User I/O
INIT_B
Open-drain
bidirectional
I/O
DONE
Open-drain
bidirectional
I/O
PROG_B
Input
SUSPEND
Input
N/A
Enables SUSPEND
mode. Connect to
GND if unused.
198
www.xilinx.com
Chapter 9
www.xilinx.com
199
+1.2V
P
1
JTAG
Mode 0
1
+1.2V
VCCINT
HSWAP
VCCO_0
PUDC_B
VCCO_2
M2
M1
M0
VCCO_0
VCCO_2
1
JTAG
Mode 0
1
VCCINT
HSWAP
VCCO_0
PUDC_B
VCCO_2
M2
M1
M0
VCCO_0
VCCO_2
J
Spartan-3E/3A FPGA
VREF
TMS
TCK
VCCAUX
Spartan-3E/3A FPGA
VCCAUX
VCCAUX
TMS
TCK
VCCAUX
TMS
TCK
TDO
TDI
N.C.
N.C.
TDI
PROG_B
TDO
DONE
TDI
PROG_B
GND
TDO
DONE
GND
14
PROGRAM
= Dedicated internal pull-up resistor
UG332_c9_01_120106
Figure 9-1:
200
www.xilinx.com
JTAG Device ID
Table 9-1:
Current-Limiting Resistors
2.5V
2.5V
3.3V
2.5V
3.3V
3.3V
JTAG Device ID
Each Spartan-3 generation FPGA array type has a 32-bit device-specific JTAG device
identifier as shown in Table 12-4, page 249. The lower 28 bits represent the device vendor
(Xilinx) and device identifier. The upper four bits, ignored by most tools, represent the
revision level of the silicon mounted on the printed circuit board.
JTAG User ID
The Spartan-3 generation JTAG interface provides the option to store a 32-bit User ID,
loaded during configuration. The User ID value is specified via the UserID configuration
bitstream option, shown in Table 11-2, page 234 or in Step 11, Figure 1-7, page 44 from the
ISE Project Navigator software.
The user ID provides a convenient means to store an identifier or revision code for the
FPGA bitstream loaded into the FPGA. This is different than the Device DNA identifier,
which is unique to a specific Extended Spartan-3A family FPGA, not the bitstream, and
permanently factory-programmed in the FPGA.
www.xilinx.com
201
Test-Logic-Reset
TMS
Run-Test/Idle
Select-DR
Select-IR
0
1
0
1
Capture-DR
Capture-IR
0
0
0
Shift-DR
1
Exit1-DR
Exit1-IR
0
0
Pause-IR
1
Exit2-IR
TCK
TDI
Update-DR
0
Pause-DR
Exit2-DR
Shift-IR/Shift-DR
Shift-IR
1
1
Update-IR
0
Instruction Register
Select Data
Register
Instruction Decoder
TDO
Bypass[1] Register
IDCODE[32] Register
Boundary-Scan[n ] Register
I/O
I/O
I/O
I/O
UG332_c9_02_081506
Figure 9-2:
202
www.xilinx.com
TEST-LOGIC-RESET
0
0
RUN-TEST/IDLE
SELECT-DR-SCAN
1
SELECT-IR-SCAN
1
CAPTURE-DR
0
CAPTURE-IR
0
0
0
SHIFT-DR
EXIT1-DR
EXIT1-IR
0
0
PAUSE-DR
PAUSE-IR
1
EXIT2-DR
EXIT2-IR
1
1
UPDATE-DR
1
SHIFT-IR
UPDATE-IR
1
0
UG332_C9_03_080906
Figure 9-3:
Table 9-2:
State
Description
TEST-LOGIC-RESET
All JTAG logic is disabled, enabling the normal operation of the FPGA. No matter what the
initial state of the controller is, the Test-Logic-Reset state can be entered by holding TMS High
and pulsing TCK five times. This is why the Test Reset (TRST) pin is optional.
RUN-TEST/IDLE
The JTAG logic is active only if certain instructions are present. For example, if an instruction
activates the self test, then it is executed when the controller enters this state. The JTAG logic is
idle otherwise.
SELECT-DR-SCAN
SELECT-IR-SCAN
Controls whether or not to enter the Instruction Path. The Controller can return to the TESTLOGIC-RESET state otherwise.
CAPTURE-IR
The shift register bank in the Instruction Register parallel loads a pattern of fixed values on the
rising edge of TCK. The last two significant bits must always be "01".
SHIFT-IR
The Instruction Register gets connected between TDI and TDO, and the captured pattern gets
shifted on each rising edge of TCK. The instruction available on the TDI pin is also shifted in to
the Instruction Register.
EXIT1-IR
PAUSE-IR
EXIT2-DR
UPDATE-IR
The instruction in the Instruction Register is latched to the latch bank of the Instruction Register
on every falling edge of TCK. This instruction becomes the current instruction once it is latched.
www.xilinx.com
203
Table 9-2:
State
Description
CAPTURE-DR
The data is parallel-loaded into the data registers selected by the current instruction on the rising
edge of TCK.
SHIFT-DR
EXIT1-DR
These controller states are similar to the SHIFT-IR, EXIT1-IR, PAUSE-IR, EXIT2-IR and
UPDATE-IR states in the Instruction path.
PAUSE-DR
EXIT2-DR
UPDATE-DR
Table 9-3:
Pin
Description
TDI
Test Data In. This pin is the serial input to all JTAG instruction and data
registers. The state of the TAP controller and the current instruction determine
the register that is fed by the TDI pin for a specific operation. TDI has an
internal resistive pull-up to provide a logic High to the system if the pin is not
driven. TDI is applied into the JTAG registers on the rising edge of TCK.
TDO
Test Data Out. This pin is the serial output for all JTAG instruction and data
registers. The state of the TAP controller and the current instruction determine
the register (instruction or data) that feeds TDO for a specific operation. TDO
changes state on the falling edge of TCK and is only active during the shifting
of instructions or data through the device. TDO is an active driver output.
TMS
Test Mode Select. This pin determines the sequence of states through the TAP
controller on the rising edge of TCK. TMS has an internal resistive pull-up to
provide a logic High if the pin is not driven.
TCK
Test Clock. TCK sequences the TAP controller and the JTAG registers.
Notes:
1. As specified by the IEEE Standard, the TMS and TDI pins both have internal pull-up resistors. These
internal pull-up resistors are active before configuration, regardless of the mode selected. See
Table 2-13, page 65 for resistor values. After configuration, these resistors are controlled by the TmsPin
and TdiPin bitstream generator option settings, shown in Table 11-2, page 234.
2. The active-High SUSPEND mode control input in Extended Spartan-3A FPGAs disables the TAP
controller; connect to GND if unused.
TAP Controller
Figure 9-3 diagrams a 16-state finite state machine. The four TAP pins control how data is
scanned into the various registers. The state of the TMS pin at the rising edge of TCK
determines the sequence of state transitions. There are two main sequences, one for
shifting data into the data register and the other for shifting an instruction into the
instruction register.
Spartan-3 generation FPGAs support the mandatory IEEE 1149.1 commands, as well as
several Xilinx vendor-specific commands. The EXTEST, INTEST, SAMPLE/PRELOAD,
BYPASS, IDCODE, USERCODE, and HIGHZ instructions are all included. The TAP also
supports internal user-defined registers (USER1 and USER2) and configuration/readback
of the device.
204
www.xilinx.com
Boundary-Scan Architecture
Spartan-3 generation FPGA registers include all registers required by the IEEE 1149.1
Standard. In addition to the standard registers, the family contains optional registers for
simplified testing and verification, as described in Table 9-4.
Table 9-4:
Register Name
Register Length
Description
Instruction Register
6 bits
BYPASS Register
1 bit
Boundary-Scan Register
Identification Register
32 bits
32 bits
USERCODE Register
32 bits
User-Defined Registers
(USER1 and USER2)
Design-specific
Design-specific
Boundary-Scan Register
Each user I/O block (IOB), whether connected to a package pin or unbonded, contains
additional logic that forms the boundary-scan data register, as shown in Figure 9-4.
Boundary-Scan operations are independent of how an individual I/O block is configured.
By default, each I/O block starts as bidirectional with 3-state control. Later, it can be
configured via JTAG operations to be an input, output, or 3-state pin.
www.xilinx.com
205
TDI
Capture
Register
1x
01
00
Update
Latch
LE
INTEST
IOB.I
0
1x
01
00
LE
1
PAD
0
IOB.O
IOB.T
0
1x
01
00
LE
EXTEST
SHIFT
CLOCK DATA
REGISTER
Figure 9-4:
TDO UPDATE
INTEST or EXTEST
UG332_c9_04_081506
When conducting a data register (DR) operation, the DR captures data in a parallel fashion
during the CAPTURE-DR state. The data is then shifted out and replaced by new data
during the SHIFT-DR state. For each bit of the DR, an update latch is used to hold the input
data stable during the next SHIFT-DR state. The data is then latched during the UPDATEDR state when TCK is Low.
The update latch is opened each time the TAP controller enters the UPDATE-DR state. Care
is necessary when exercising an INTEST or EXTEST to ensure that the proper data has been
latched before exercising the command. This is typically accomplished by using the
SAMPLE/PRELOAD instruction.
Internal pull-up and pull-down resistors should be considered when test vectors are being
developed for testing opens and shorts. The Boundary-Scan mode determines whether an
I/O block has a pull-up resistor.
206
www.xilinx.com
Instruction Register
The Instruction Register (IR) for the Spartan-3 generation FPGA is connected between TDI
and TDO during an instruction scan sequence. In preparation for an instruction scan
sequence, the instruction register is parallel-loaded with a fixed instruction capture
pattern. This pattern is shifted out onto TDO (LSB first), while an instruction is shifted into
the instruction register from TDI.
To invoke an operation, load the desired OPCODE from Table 9-5 into the Instruction
Register (IR). The length of the instruction register varies by device type. However, the IR
is six bits wide for all Spartan-3 generation FPGAs.
Note: In general, all JTAG OPCODEs are identical among Spartan-3 generation FPGA families.
However, the EXTEST instruction is different between Spartan-3 FPGAs and FPGAs from the
Spartan-3E or Extended Spartan-3A family families.
Table 9-5:
Boundary-Scan
Command
Instruction
EXTEST
(Spartan-3E,
Spartan-3A/3AN,
Spartan-3A DSP
FPGAs)
EXTEST
(Spartan-3 FPGA)
Description
Enables Boundary-Scan EXTEST operation.
001111
000000
SAMPLE
000001
USER1
000010
USER2
000011
CFG_OUT
000100
CFG_IN
000101
INTEST
000111
USERCODE
001000
IDCODE
001001
HIGHZ
001010
JPROGRAM
001011
JSTART
001100
JSHUTDOWN
001101
ISC_ENABLE
010000
ISC_PROGRAM
010001
ISC_NOOP
010100
No operation.
ISC_READ
010101
www.xilinx.com
207
Table 9-5:
Boundary-Scan
Command
ISC_DISABLE
Instruction
Description
010110
110001
BYPASS
111111
Enables BYPASS.
RESERVED
All other
codes
ISC_DNA
Table 9-6 shows the instruction capture values loaded into the IR as part of an instruction
scan sequence.
Table 9-6:
TDI
IR[4]
IR[3]
IR[2]
IR[1:0]
DONE
INIT(1)
ISC_ENABLED
ISC_DONE
01
TDO
BYPASS Register
The BYPASS register, which consists of a single flip-flop between TDI and TDO, is required
in all JTAG IEEE 1149.1-compliant devices. It passes data serially from the TDI pin to the
TDO pin during a bypass instruction. The BYPASS register initializes to zero when the TAP
controller is in the CAPTURE-DR state.
208
www.xilinx.com
Configuration bus commands must arrive at the FPGA TDI pin on a 32-bit shift boundary
as explained in XAPP188, Configuration and Readback of Spartan-II and Spartan-IIE FPGAs
Using Boundary Scan.
USERCODE Register
The USERCODE instruction is supported in Spartan-3 generation FPGAs. This register
allows a user to specify a design-specific identification code. The USERCODE can be
programmed into the device and can be read back for verification later. The USERCODE is
embedded into the bitstream during bitstream generation (BitGen -g UserID option) and is
valid only after configuration. If the device is blank or the USERCODE was not
programmed, the USERCODE register contains 0xFFFFFFFF.
TMS
TDI
TCK
TDO
Data Valid
Data to be captured
Data Valid
UG332_c9_05_012709
Figure 9-5:
www.xilinx.com
209
Parallel Cable IV
http://www.xilinx.com/products/devkits/HW-PC4.htm
If possible, place a target interface connector on the FPGA board to facilitate easy
programming. Xilinx recommends using the high-performance ribbon cable option,
pictured in Figure 9-6, page 210, for maximum performance and best signal integrity.
0.248"
0.299"
Slave Serial
SPI
JTAG
INIT_B
N.C.
DIN
DONE
CCLK
PROG_B
VREF
N.C.
N.C.
N.C.
N.C.
MOSI
MISO
SCK
SS_B
VREF
TDI
TDO
TCK
TMS
VREF
0.0787" (2 mm)
14
12
10
8
6
4
2
13
11
9
7
5
3
1
GND
GND
GND
GND
GND
GND
GND
Figure 9-6:
0.472"
0.
0.0787"
TYP.
UG332_c9_06 _1
Such connectors are available in both through-hole and surface mount configurations, as
shown in Table 9-7. Use shrouded or keyed connectors to ensure guarantee proper
orientation when inserting the cable. The specified connector requires only 0.162 square
inches of board space.
Table 9-7:
Manufacturer(1)
Surface Mount,
Vertical
Through-Hole,
Vertical
Through-Hole, Right
Angle
Vendor Website
Molex
87832-1420
87831-1420
87833-1420
www.molex.com
FCI
98424-G52-14
98414-G06-14
98464-G61-14
www.fciconnect.com
Comm Con
Connectors
2475-14G2
2422-14G2
2401R-G2-14
www.commcon.com
Notes:
1. Some manufacturer pin assignments may not conform to Xilinx pin assignments. Please refer to the manufacturers data sheet for
more information.
2. Additional ribbon cables can be purchased separately from the Xilinx Online Store (www.xilinx.com/store).
Pin 2 of the connector provides a reference voltage for the output buffers that drive the
TDI, TCK, and TMS pins. Because these pins are powered by VCCAUX on Spartan-3
generation FPGAs, connect the VCCAUX supply to pin 2 of the connector.
210
www.xilinx.com
From within the ISE Project Navigator, double-click Configure Device (iMPACT)
from the Processes pane, as shown in Figure 9-7.
UG332_c9_14_112006
Figure 9-7:
2.
UG332_c9_07_112006
Figure 9-8:
3.
If the board is powered and the Xilinx programming cable properly connected, the
iMPACT software automatically initializes the JTAG chain and detects the various
devices on the chain.
4.
Click Finish.
www.xilinx.com
211
5.
As shown in Figure 9-9, the iMPACT software automatically detected the devices on
the chain. In this example, a Xilinx XC3S500E Spartan-3E FPGA is first in the chain,
followed by a Xilinx XCF04S Platform Flash PROM, followed by a Xilinx XC2C64A
CPLD in the final position. The devices are yet unprogrammed.
UG332_c9_xx_112006
Figure 9-9:
6.
As shown in Figure 9-10, the iMPACT software automatically prompts for the FPGA
bitstream. Select the desired bitstream to download specifically to the FPGA.
7.
Click Open.
UG332_c9_09_112006
Figure 9-10:
8.
212
As shown in Figure 9-11, the iMPACT software automatically detects that the FPGA
bitstream was generated for a non-JTAG configuration method. The iMPACT software
automatically adjusts the Startup clock setting for successful JTAG configuration
(StartupClk:JtagClk). The original bitstream file is unaffected.
www.xilinx.com
8
UG332_c9_09_112006
Figure 9-11: iMPACT Automatically Adjusts FPGA Startup Clock for JTAG Configuration
9.
For faster downloading and a shorter FPGA debugging cycle, there is no need to
program the Platform Flash PROM or CPLD unless actually desired. To skip
programming the Platform Flash PROM, click Bypass, as shown in Figure 9-12.
9
UG332_c9_10_112006
Figure 9-12:
10. Similarly, click Bypass to skip programming of the CPLD, as shown in Figure 9-13.
www.xilinx.com
213
10
UG332_c9_11_112006
Figure 9-13:
11. As shown in Figure 9-14, the iMPACT software updates the display, showing the files
assigned to each device in the JTAG chain. In this example, the XCF04S Platform Flash
and XC2C64A CPLD are bypassed and are not programmed. Click the FPGA to
highlight it on the display.
11
16
12
UG332_c9_12_112006
214
www.xilinx.com
13
14
15
UG332_c9_13_112006
www.xilinx.com
215
216
www.xilinx.com
Chapter 10
P
Internal
SPI Mode 0
1
1
Variant
Select
?
?
3.3V
(VCCAUX) ?
VCCINT
PUDC_B
VCCO_0
VCCO_0
VCCO_2
VCCO_2
M2
M1
M0
Spartan-3AN
VS2
VS1
VS0
INIT_B
VREF
TMS
TCK
VCCAUX
+3.3V
TMS
TCK
TDO
TDI
N.C.
N.C.
TDI
PROG_B
TDO
DONE
GND
14
PROGRAM
Figure 10-1:
UG332_c10_01_112906
www.xilinx.com
217
FPGA
XC3S50AN
437,312
1 Mbit
XC3S200AN
1,196,128
4 Mbit
XC3S400AN
1,886,560
4 Mbit
XC3S700AN
2,732,640
8 Mbit
XC3S1400AN
4,755,296
16 Mbit
SUSPEND Pin
The active-High SUSPEND mode control input should be connected to GND if unused.
218
www.xilinx.com
Table 10-2:
Supported by
Spartan-3AN FPGA
Family?
Maximum CLK
Frequency
<1:1:1>
FAST_READ
(0x0B)
Yes
50 MHz
<1:0:1>
READ
(0x03)
Yes
33 MHz
All Others
--
No
--
VCCAUX
The VCCAUX supply input must be 3.3V. The VCCAUX rail supplies power to the In-System
Flash memory.
VCCO_2
The VCCO_2 supply rail, which must be the same voltage as the configuration memory in
other configuration modes, has no such restriction on Spartan-3AN FPGAs. However,
VCCO_2 must reach 2.0V to meet the power-on requirements; after configuration, it can
drop down to a lower level.
Sequencing
When configuring from the In-System Flash, VCCAUX must be in the recommended
operating range; on power-up make sure VCCAUX reaches at least 3.0V before INIT_B goes
High to indicate the start of configuration. VCCINT, VCCAUX, and VCCO supplies to the
FPGA can be applied in any order if this requirement is met. However, an external
configuration source might have specific requirements. Check the data sheet for the
attached configuration source. Apply VCCINT last for lowest overall power consumption
(see the chapter called Powering Spartan-3 Generation FPGAs in UG331 for more
information). The FPGA typically delays configuration long enough for the configuration
source to be ready. If the configuration source is not ready when the FPGA begins
configuration, the Configuration Watchdog Timer will allow the FPGA to automatically reattempt configuration.
www.xilinx.com
219
SPI_ACCESS
MOSI
MISO
CSB
CLK
UG332_C13_06_081506
Figure 10-2:
Details on accessing the In-System Flash memory after configuration, from inside the
FPGA application, are found in UG333: Spartan-3AN In-System Flash User Guide.
StartupClk: CCLK
By default, the configuration Startup clock source is the internally generated CCLK. Keep
the StartupClk bitstream generation option, shown as Step 13 in Figure 1-8, page 45.
-g StartupClk:Cclk
220
www.xilinx.com
-g DriveDone:Yes
www.xilinx.com
221
iMPACT
The following steps graphically describe how to create an SPI-formatted PROM file using
iMPACT from within the ISE Project Navigator. To create a Spartan-3AN MultiBoot image
for an SPI Flash memory, see Generating an Extended Spartan-3A Family MultiBoot
PROM Image using iMPACT, page 282.
1.
From within the ISE Project Navigator, double-click Generate PROM, ACE, or JTAG
File from within the Process pane, as shown in Figure 10-3.
UG332_c4_10_110206
Figure 10-3:
2.
222
www.xilinx.com
UG332_c4_11_19
Figure 10-4:
3.
Click Next.
4.
As shown in Figure 10-5, format the FPGA bitstream or bitstreams for a PROM
Supporting Multiple Design Versions.
www.xilinx.com
223
5
4
6
7
8
UG332_c10_02_022307
Figure 10-5:
224
5.
6.
7.
8.
Click Next.
9.
www.xilinx.com
9
10
11
UG332_c10_03_052207
Figure 10-6:
10. Choose a specific Spartan-3AN FPGA device. The bit size of the In-System Flash
memory for the associated FPGA is also displayed.
11. Click Next.
12. The Default Spartan-3AN configuration bitstream (Bitstream 0) is always located at
address 0. Bitstream 0 is the bitstream that the FPGA automatically loads when power
is applied or whenever the PROG_B pin is pulsed Low.
www.xilinx.com
225
12
13
14
15
UG332_c10_04_022307
Figure 10-7:
13. Click the option box to include a second MultiBoot bitstream (Bitstream 1). Bitstream 1
is always aligned to the next ISF memory sector boundary following Bitstream 0. The
iMPACT software displays the sector address based on the current addressing mode,
as shown in Table 10-3. This is the address used for MultiBoot operations to load the
second bitstream.
Table 10-3:
Bitstream
Bitstream
0
Bitstream
1
ISF
Memory
Page
Power-of-2
Hex
Hex
All
0x00_0000
0x00_0000
XC3S50AN
256
0x02_0000
0x01_0000
XC3S200AN
768
0x06_0000
0x03_0000
XC3S400AN
1,024
0x08_0000
0x04_0000
XC3S700AN
1,536
0x0C_0000
0x06_0000
XC3S1400AN
1,280
0x14_0000
0x0A_0000
14. By default, leave this option box unchecked! Check this box only if the intended
Spartan-3AN target was previously and specifically programmed to support the
optional Power-of-2 addressing mode. See UG333: Spartan-3AN In-System Flash User
Guide for more information.
15. Click Next.
16. As shown in Figure 10-8, review that the settings are correct to format the Spartan3AN In-System Flash. Click Finish to confirm the settings or Back to change the
settings.
226
www.xilinx.com
16
UG332_c10_05_022307
Figure 10-8:
17. As shown in Figure 10-9, click OK to start adding FPGA configuration bitstreams to
the In-System Flash image.
17
18
19
20
UG332_c10_06_022307
Figure 10-9:
www.xilinx.com
227
21. As shown in Figure 10-10, the iMPACT software graphically displays the selected
Spartan-3AN FPGA and any associated FPGA bitstream(s).
22
21
UG332_c10_07_022307
Figure 10-10:
22. The location of the first and second bitstreams is also highlighted.
23. As shown Figure 10-11, click Generate File.
23
24
UG332_c10_08_022307
Figure 10-11:
24. The iMPACT software indicates when the PROM file is successfully created.
PROMGen
PROMGen is a command-line utility that provides an alternate means to create a Spartan3AN programming file. PROMGen can be invoked from within a command window or
from within a script file.
Table 10-4 shows the relevant options for formatting a Spartan-3AN programming file.
228
www.xilinx.com
Table 10-4:
PROMGen Option
Description
-spi
-p <format>
PROM output file format. Specifies the file format required by the SPI
programming software. Refer to the third party programmer
documentation for details.
-s <size>
Specifies the PROM size in kilobytes. The PROM size must be a power
of 2, and the default setting is 64 kilobytes. PROMGen always assumes
power-of-2 addressing (see Table 10-5).
-u <address>
Loads the .bit file from the specified starting address in an upward
direction. This option must be specified immediately before the input
bitstream file. See Table 10-3, page 226 for starting addresses by
Spartan-3AN FPGA part type.
Table 10-5:
-s <size> Setting
XC3S50AN
1M
128
XC3S200AN
4M
512
XC3S400AN
4M
512
XC3S700AN
8M
1,024
XC3S1400AN
16M
2,048
Spartan-3AN FPGA
Power-of-2
The example PROMGen command, provided below, generates a PROM file for an
XC3S700AN FPGA with the following characteristics.
Formatted for the SPI-based In-System Memory by specifying the -spi option.
Formatted using the Intel MCS format by specifying the -p mcs option. The output
filename is specified by the -o <promdata>.mcs option, where <promdata> is a
user-specified file name.
The XC3S700AN In-System Flash memory is only slightly larger than 8 Mb or 1,024
bytes. However, set the size option to twice the size, or -s 2048, because the default
addressing method uses an additional address line. When using the power-of-2
addressing mode, which requires an additional programming step, set the size option
to -s 1024.
The first FPGA bitstream (bitstream0) is loaded in the upward direction, starting at
address 0 by specifying the -u 0 option. A second MultiBoot bitstream
(bitstream1) is loaded at the next sector boundary, shown in Table 10-3, page 226,
0x0C_0000 for the XC3S700AN.
The FPGA bitstreams to be added to the In-System Flash memory are specified as the
last option, <bitstream0>.bit and <bitstream1>.bit, where <inputfile> is
the user-specified file name used when generating the FPGA bitstream.
promgen -spi -p mcs -o <promdata>.mcs -s 2048 -u 0 <bitstream0>.bit
-u c0000 <bitstream1>.bit
www.xilinx.com
229
BPM Microsystems
BPM Microsystems is a global supplier of engineering and production device
programmers and is the leading supplier of automated programming systems to the
semiconductor and electronics industries.
230
www.xilinx.com
Status
Programmer Type
3610
4610
4710
Automated Production
3710MK2
BP-2610
BP-2710
Multi-site Concurrent
BP-1410
BP-1610
Single-site Engineering
BP-1710
4700
3700MK2
BP-3500
BP-3510
BP-3600
Automated Production
BP-4500
Legacy model. May
already be installed in
many programming
centers
BP-4510
BP-4600
BP-2500
BP-2510
BP-2600
Multi-site Concurrent
BP-2700
BP-1600
BP-1700
Single-site Engineering
www.xilinx.com
231
Table 10-7:
FPGAs
Programming Software
ASM256BGT
SM256BGT
XC3S700AN
ASM484BGD
SM484BGD
XC3S1400AN
ASM676BG
SM676BG
Spartan-3AN FPGA
XC3S50AN
XC3S200AN
XC3S400AN
232
www.xilinx.com
Chapter 11
The option name and value are separated by a colon with no spaces.
For more information and a complete listing of all options, see the BitGen chapter in the
following document:
For a quick summary of available options for particular FPGA family, type the command
shown in Table 11-1 in a DOS box or command window.
Table 11-1:
FPGA Family
Command Line
Spartan-3
Spartan-3E
Spartan-3A
Spartan-3AN
Spartan-3A DSP
Some of the bitstream options can be controlled from the ISE Project Navigator, as
described in ISE Software Project Navigator, page 42. Any option not specifically listed
in the graphic interface can be included as Step 5 shown in Figure 1-6, page 43.
www.xilinx.com
233
Table 11-2:
Option Name
ConfigRate
Pins/Function
Affected
CCLK,
Configuration,
Master Modes
only
Values
(default)
Description
Extended
Spartan-3A
FPGA:
1, 3, 6, 7, 8, 10,
12, 13, 17, 22,
25, 27, 33, 44,
50, 100
Spartan-3E
FPGA:
1, 3, 6,
12, 25, 50
Spartan-3
FPGA:
3, 6,12, 25, 50
StartupClk
ProgPin
UnusedPin
234
Configuration,
Startup
PROG_B pin
Cclk
UserClk
JtagClk
The JTAG TCK input controls the startup sequence when the
FPGA transitions from the configuration mode to the user
mode. See Startup, page 251.
Pullup
Pullnone
Pulldown
Pullup
Pullnone
All unused I/O pins and input-only pins are left floating (HiZ, high-impedance, three-state). Use external pull-up or pulldown resistors or logic to apply a valid signal level.
www.xilinx.com
Table 11-2:
Option Name
Persist
Security
Pins/Function
Affected
Values
(default)
Description
SelectMAP
interface pins,
Slave mode,
Configuration
No
Yes
JTAG,
SelectMAP,
Readback
None
Level1
Level2
Level3
Compress
FPGA bitstream
size
No
Yes
CclkPin
M2Pin
Spartan-3 FPGA
only:
Pullup
HSWAP_EN pin
Pulldown
Pullnone
Spartan-3 FPGA
only:
Pullup
CCLK pin
Pullnone
Spartan-3 FPGA
only:
Pullup
M2 pin
Pulldown
Pullnone
www.xilinx.com
235
Table 11-2:
Option Name
M1Pin
M0Pin
Pins/Function
Affected
Values
(default)
Description
Spartan-3 FPGA
only:
Pullup
M1 pin
Pulldown
Pullnone
Spartan-3 FPGA
only:
Pullup
M0 pin
Pulldown
Pullnone
Pullup
Pullnone
No
Yes
No
Default. The input path from DONE pin input back to the
Startup sequencer is not pipelined. See DONE pin
ConfigRate: Bitstream Option for CCLK, page 60.
Yes
1, 2, 3, 4, 5, 6
DriveDone
DonePipe
DONE pin
DONE pin
DONE pin
236
DONE pin,
Configuration
Startup
www.xilinx.com
Table 11-2:
Option Name
GWE_cycle
GTS_cycle
LCK_cycle
Match_cycle
Pins/Function
Affected
Values
(default)
All flip-flops,
LUT RAMs, and
SRL16 shift
registers, Block
RAM,
Configuration
Startup
1, 2, 3, 4, 5, 6
Done
Waits for the DONE pin input to go High before asserting the
internal write-enable signal to all flip-flops, LUT RAMs and
shift registers (SRL16). Block RAM read and write operations
are enabled at this time.
1, 2, 3, 4, 5, 6
Done
Waits for the DONE pin input to go High before releasing the
internal three-state control, holding all I/O buffers in highimpedance (Hi-Z). Output buffers actively drive, if so
configured, after this point.
Keep
DCMs,
Configuration
Startup
NoWait
Default. The FPGA does not wait for selected DCMs to lock
before completing configuration.
0, 1, 2, 3, 4, 5, 6
Spartan-3 FPGA
only:
Auto
The BitGen software examines the FPGA design for any I/O
standards that use DCI. If found, BitGen automatically sets
Match_cycle:2, causing the Startup sequence to stall in state 2
while the DCI circuitry matches the target impedance.
Otherwise, Match_cycle:NoWait.
NoWait
0, 1, 2, 3, 4, 5, 6
Specify the Startup cycle where the FPGA waits for the DCI
circuitry to match the target impedance value, specified using
external resistors.
Spartan-3 FPGA
only:
AsRequired
DCI
Continuous
Quiet
Description
DCI
DCIUpdateMode
www.xilinx.com
237
Table 11-2:
Option Name
Pins/Function
Affected
Values
(default)
Description
JTAG-Related Options
See Chapter 9, JTAG Configuration Mode and Boundary-Scan.
TckPin
TdiPin
TdoPin
TmsPin
UserID
JTAG User ID
register
Pullup
Pulldown
Pullnone
Pullup
Pulldown
Pullnone
Pullup
Pulldown
Pullnone
Pullup
Pulldown
Pullnone
0xFFFFFFFF
Extended
Spartan-3A
FPGA only:
Suspend mode
drive_awake
Extended
Spartan-3A
FPGA only:
Suspend mode,
AWAKE pin
238
No
Yes
No
Yes
www.xilinx.com
Table 11-2:
Option Name
suspend_filter
Pins/Function
Affected
Extended
Spartan-3A
FPGA only:
Values
(default)
Description
Yes
No
No
Yes
StartupClk
InternalClk
1,..,5,...,1024
1,..,4,...,1024
Suspend mode,
SUSPEND pin
en_sw_gsr
Extended
Spartan-3A
FPGA only:
Suspend mode,
wake-up timing
sw_clk
Extended
Spartan-3A
FPGA only:
Suspend mode,
wake-up timing
sw_gwe_cycle
Extended
Spartan-3A
FPGA only:
Suspend mode,
wake-up timing
sw_gts_cycle
Extended
Spartan-3A
FPGA only:
Suspend mode,
wake-up timing
Extended
Spartan-3A
FPGA only:
Auto
No
Yes
0x0000000
ICAP, MultiBoot
next_config_addr
Extended
Spartan-3A
FPGA only:
MultiBoot
www.xilinx.com
239
Table 11-2:
Option Name
Pins/Function
Affected
Values
(default)
Description
Reset_on_err
Configuration
Extended
Spartan-3A
FPGA only:
MultiBoot, CRC,
watchdog timer
post_crc_en
Extended
Spartan-3A
FPGA only:
Enable
Disable
No
Yes
No
Yes
1, 3, 6, 7, 8, 10,
12, 13, 17, 22,
25, 27, 33, 44,
50, 100
No
Yes
Yes
Default. Mask out the Look-Up Table (LUT) bits from the
SLICEM logic slices. SLICEMs support writable functions
such as distributed RAM and SRL16 shift registers, which
generate CRC errors when bit locations are modified.
No
Include the LUT bits from SLICEM logic slices. Use this
option only if the application does not include any
distributed RAM or SRL16 shift registers.
Postconfiguration
CRC checker
post_crc_freq
Extended
Spartan-3A
FPGA only:
Postconfiguration
CRC checker
post_crc_keep
Extended
Spartan-3A
FPGA only:
Postconfiguration
CRC checker
glutmask
Extended
Spartan-3A
FPGA only:
Postconfiguration
CRC checker
Readback Options
See Table 18-6, page 346
240
www.xilinx.com
Chapter 12
Sequence of Events
Overview
This chapter outlines the multi-stage configuration process for Spartan-3 generation
FPGAs.
While each FPGA configuration mode uses a slightly different interface, the basic steps
involved are the same for all modes. Figure 12-1 shows the general Spartan-3 generation
FPGA configuration process. The details of the bitstream will also include the formatting
and command bits. The following subsections describe each step in detail, where the
current step is highlighted at the beginning of each subsection.
Steps
1
Wake from
Reset
(power-on or
PROG_B)
Start
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Finish
UG332_c12_01_110406
Figure 12-1:
Pre-Configuration Power-Up
None of the FPGA I/O will drive the output pins during power-up of the voltage rails
(VCCINT, VCCAUX, and VCCO). It is safe to externally drive the I/Os during all steps in the
configuration sequence of events with the exception of configuration output pins (see
Table 2-15, page 66). Since the I/Os are unconfigured at this time, it is recommended that
the I/Os are ignored until configuration is complete.
The I/O pins are disabled until reaching Step 1, where internal pull-up termination is
enabled if the hot swap pin is Low. The hot swap pin is HSWAP_EN in the Spartan-3
family, HSWAP in the Spartan-3E family, and PUDC_B in the Extended Spartan-3A family.
Independent of the hot swap pin, if VCCO is applied after VCCINT and VCCAUX, the internal
pull-ups are enabled for all I/O from the time VCCO reaches approximately 0.4V until
VCCO exceeds VCCINT. If this pull-up is not desired, avoid this power sequence, or place
pull-down resistors to hold the pin at a Low logic level. Selection of a pull-down value
should be based on the minimum resistor value of the FPGA data sheet
(RPU, VCCO = 1.14V) and the VIL maximum specification of the downstream device.
www.xilinx.com
241
Start
2
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Finish
UG332_c12_02_110406
Figure 12-2:
The FPGA powers on and the FPGAs internal Power-On Reset (POR) circuit holds the
FPGA in reset until the required voltage supplies reach appropriate levels.
2.
The system pulses the PROG_B pin Low, which resets the FPGA.
3.
The FPGA is reset via the dedicated JTAG interface using the JPROGRAM instruction.
4.
The FPGA is reset via the Extended Spartan-3A family REBOOT command available
using the SelectMAP, JTAG, or ICAP interfaces.
5.
242
1.
2.
3.
www.xilinx.com
VCCO_2
VCCO 2T
POWER_GOOD
VCCINT
VCCINTT
FPGA_RESET
VCCAUX
VCCAUXT
Glitch Filter
PROG_B
TDI
JPROGRAM
instruction
TMS
JTAG
TCK
TCK
Figure 12-3:
UG332_c12_11_113006
The FPGA monitors all three supplies. Once all three supplies exceed the specified
threshold voltage, summarized in Table 12-1, page 243 from the associated FPGA data
sheet, the POR circuit releases the internal reset and the FPGA can continue with the
configuration process unless the PROG_B pin is Low.
Table 12-1:
Voltage Supply
POR Threshold
Specification
Spartan-3A/3AN
Spartan-3A DSP
FPGA
Spartan-3E FPGA
Spartan-3 FPGA
Units
Min
Max
Min
Max
Min
Max
VCCINT
VCCINTT
0.4
1.0
0.4
1.0
0.4
1.0
VCCAUX
VCCAUXT
1.0
2.0
0.8
2.0
0.8
2.0
VCCO_2
VCCO2T
1.0
2.0
0.4
1.0
VCCO_4 (or
VCCO_BOTTOM)
VCCO4T
V
0.4
1.0
VCCINT should rise monotonically within the specified ramp rate. If this is not possible,
delay configuration by holding the INIT_B pin or the PROG_B pin Low (see Delaying
Configuration, page 246) while the system power supplies reach the required POR
threshold.
www.xilinx.com
243
After successfully configuring, the POR circuit continues to monitor the VCCINT and
VCCAUX supply inputs. Should either supply drop below the its associated threshold
voltage, the POR circuit again resets the FPGA. VCCO_2 is not monitored after
configuration so that the user can reduce it as needed for low-voltage standards.
Note that the Extended Spartan-3A family has a requirement that VCCO_2 reach 2.0V for
successful power-on. This level is higher than in the Spartan-3 and Spartan-3E FPGAs, and
helps make sure that external configuration memories are ready before the FPGA starts
attempting access. If the design only requires 1.8V (or lower) I/Os in bank 2 then the
VCCO_2 supply would temporarily need to rise to 2.0V and then could drop down to the
1.8V level for operation. See Lowering VCCO_2 After Configuration in Extended
Spartan-3A Family in Chapter 2.
PROG_B Pin
The PROG_B resets the FPGA, regardless of the current state of the FPGA. For additional
information, see Program or Reset FPGA: PROG_B, page 56.
Power-Up Timing
Figure 12-4 shows the general power-up timing, showing the relationship between the
input voltage supplies, the INIT_B pin, and the PROG_B pin.
1.2V
VCCINT
(Supply)
1.0V
VCCAUX
(Supply)
2.0V
2.5V
VCCO Bank 2
(Supply)
(See Table)
TPOR
PROG_B
(Input)
TPROG
INIT_B
(Open-Drain)
TPL
TICCK
CCLK
(Output)
TMINIT TINITM
M[2:0]
VS[2:0]
(Input)
Pins Sampled
Figure 12-4:
UG332_c12_13_091609
Table 12-2 lists and describes the power-up timing specifications shown in Figure 12-4.
Refer to the associated FPGA data sheet for any unlisted values.
Table 12-2:
Symbol
Description
Family
Value
Spartan-3
5 to 7
Spartan-3E
5 to 7
Spartan-3A
18
TPOR
244
www.xilinx.com
Units
ms
Table 12-2:
Symbol
TPL
Description
Family
Value
Spartan-3
2 to 3
Spartan-3E
0.5 to 2
Spartan-3A
0.5 to 2
Spartan-3
300
Spartan-3E
Spartan-3A
500
All
0.5 to 4
All
50
ns
TPROG
TICCK
TMINIT
Units
ms
ns
Notes:
1. Spartan-3A represents the Spartan-3A, Spartan-3AN, and Spartan-3A DSP FPGA families.
Start
2
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Finish
UG332_c12_03_110406
Figure 12-5:
Configuration memory is cleared automatically after the FPGA wakes from a reset event.
During this time, I/Os are placed in a high-impedance (Hi-Z) state except for the dedicated
Configuration and JTAG pins (see Pre-Configuration Power-Up, page 241). The INIT_B
pin actively drives Low during initialization, and then released after TPOR during a powerup event or after TPL for other cases. See Figure 12-4. If the INIT_B pin is held Low
externally, the FPGA waits at this point in the initialization process until the pin is released.
The minimum Low pulse time for PROG_B is defined by the TPROG timing parameter. The
PROG_B pin can be held active (Low) for as long as necessary.
www.xilinx.com
245
Wake from
Reset
(power-on or
PROG_B)
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Start
Finish
UG332_c12_04_110406
Figure 12-6:
When the INIT_B pin returns High after initialization, the FPGA samples the M[2:0] mode
select pins and the VS[2:0] variant select pins. Shortly after, the FPGA begins driving CCLK
if the M[2:0] mode select pins define one of the Master configuration modes. The VS[2:0]
values are only used in Master SPI configuration mode. At this point, the FPGA begins
sampling the configuration data input pins on the rising edge of the configuration clock.
Delaying Configuration
There are three methods to delay configuration for Spartan-3 generation FPGAs.
1.
Hold the PROG_B pin Low, which holds the FPGA in reset, Step 1 shown in
Figure 12-2, page 242.
2.
Hold the INIT_B pin Low during initialization, which stalls the configuration process
in Step 2 shown in Figure 12-5, page 245. However, after the FPGA releases INIT_B
High, the application cannot subsequently delay configuration by pulling INIT_B
Low.
3.
Hold the DONE pin Low, which prevents the FPGA from completing the Startup
Sequence, shown as Step 8 in Figure 12-11, page 251.
Synchronization
Array ID check
CRC check
246
www.xilinx.com
Synchronization
Steps
1
Wake from
Reset
(power-on or
PROG_B)
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Start
Finish
UG332_c12_05_110406
Figure 12-7:
Synchronization
FPGA Family
Length (bits)
Contents (hexadecimal)
Spartan-3A/3AN
Spartan-3A DSP
16
0xAA99
Spartan-3
Spartan-3E
32
0xAA995566
Eliminate the sync word in flash memory (program over a byte of the sync word to
corrupt only the sync word).
2.
3.
Program the new bitstream except for the sync word (replace a byte of the sync word
in bitstream file).
4.
Verify that the flash memory correctly contains the newly programmed bitstream
(except for the sync word).
5.
www.xilinx.com
247
Start
2
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Finish
UG332_c12_06_110406
Figure 12-8:
Check Array ID
After the FPGA is synchronized, the FPGA checks that the array ID embedded in the
bitstream matches its internal array ID. This prevents the FPGA from mistakenly
attempting to load configuration data intended for a different FPGA array. For example,
the array ID check prevents an XC3S1000 from being configured with an XC3S200
bitstream.
The Spartan-3AN FPGA family can be configured with a Spartan-3A bitstream for the
equivalent size device, since they are compatible.
The array ID check is built into the bitstream, making this step transparent to most
designers. Table 12-4 shows the Spartan-3 generation array ID codes. Although the array
ID code is identical to the JTAG IDCODE register value, the array ID check is performed
using bitstream commands to the internal configuration logic, not through the JTAG
IDCODE register.
The array identifier is a 32-bit value. Within the 32-bit value, 28 bits are unique to a specific
FPGA array size while the additional four bits are a mask revision code, which varies
between 0x0 to 0xF.
There are three components to the 28-bit vendor/array identifier value.
The least-significant 12 bits, 0x093, represent the Xilinx vendor code (0x49),
appended to the least-significant bit which is always 1, resulting in the value 0x093.
These 12 bits are consistent for all Spartan-3 generation FPGAs.
248
www.xilinx.com
Table 12-4:
FPGA Family
FPGA Array
4-bit Revision
Code
XC3S50A
0xX
0x22 10 093
XC3S200A
0xX
0x22 18 093
XC3S400A
0xX
0x22 20 093
XC3S700A
0xX
0x22 28 093
XC3S1400A
0xX
0x22 30 093
XC3S50AN
0xX
0x26 10 093
XC3S200AN
0xX
0x26 18 093
XC3S400AN
0xX
0x26 20 093
XC3S700AN
0xX
0x26 28 093
XC3S1400AN
0xX
0x26 30 093
XC3SD1800A
0xX
0x38 40 093
XC3SD3400A
0xX
0x38 4E 093
XC3S100E
0xX
0x1C 10 093
XC3S250E
0xX
0x1C 1A 093
XC3S500E
0xX
0x1C 22 093
XC3S1200E
0xX
0x1C 2E 093
XC3S1600E
0xX
0x1C 3A 093
XC3S50
0xX
0x14 0C 093
XC3S200
0xX
0x14 14 093
XC3S400
0xX
0x14 1C 093
XC3S1000
0xX
0x14 28 093
XC3S1500
0xX
0x14 34 093
XC3S2000
0xX
0x14 40 093
XC3S4000
0xX
0x14 48 093
XC3S5000
0xX
0x14 50 093
Spartan-3A
FPGAs
Spartan-3AN
FPGAs
Spartan-3A DSP
FPGAs
Spartan-3E
FPGAs
Spartan-3
FPGAs
The FPGA indicates if the array value does not match by setting Bit 1 (ID_Err) in the STAT
(Status) register, as shown in Table 12-5. There are various methods to read the status
register, including via JTAG using the Xilinx iMPACT software, or by using the SelectMAP
interface.
www.xilinx.com
249
Table 12-5:
STAT Register
Name
Bit
ID_Err
Description
0: Array ID value matched expected value.
1: Array ID value embedded in bitstream does not match the value
read from the FPGA
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Start
Finish
UG332_c12_07_110406
Figure 12-9:
After the synchronization word is loaded and the array ID is checked, the configuration
data frames are loaded.
Start
2
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Finish
UG332_c12_08_110406
Figure 12-10:
As the configuration data frames are loaded, the FPGA calculates a Cyclic Redundancy
Check (CRC) value from the configuration data packets. After the configuration data
frames are loaded, the configuration bitstream, by default (CRC:Enable), issues a Check
CRC instruction to the FPGA, followed by an expected CRC value. If the CRC value
calculated by the FPGA does not match the expected CRC value in the bitstream, then the
FPGA pulls INIT_B Low and aborts configuration.
Refer to CRC Checking during Configuration, page 313 for additional information.
250
www.xilinx.com
Startup
Startup
Steps
1
Wake from
Reset
(power-on or
PROG_B)
Clear
Configuration
Memory
Sample Control
Synchronization
Pins
(M[2:0], VS[2:0])
Array ID
Check
Load
Configuration
Data
CRC Check
Startup
Sequence
Bitstream
Loading
Setup
Start
Finish
UG332_c12_09_110406
Figure 12-11:
Startup Sequence
After successfully loading the configuration frames, the bitstream instructs the FPGA to
enter the Startup sequence. The Startup sequence is controlled by an 8-phase (phases 0-7)
sequential state machine. The startup sequencer performs the tasks outlined in Table 12-6.
Table 12-6:
BitGen
Control
1-6
LCK_cycle
1-6
Match_cycle
1-6
GWE_cycle
1-6
GTS_cycle
1-6
DONE_cycle
N/A
Startup Event
The specific order of startup events, except for the End of Startup (EOS) is userprogrammable through various bitstream generator options. Table 12-7 and Figure 12-12,
page 252 show the general sequence of events, although the specific phase for each of these
startup events is user-programmable. EOS is always the last phase. By default, startup
events occur as shown in Table 12-7.
Table 12-7:
BitGen
Control
Default
Setting
(Phase)
DONE_cycle
GTS_cycle
GWE_cycle
Assert the global write-enable (GWE), allowing RAM and flipflops to change state
N/A
Assert EOS
Event
The FPGA automatically pulses the Global Set/Reset (GSR) signal when entering the
Startup sequence, forcing all flip-flops and latches in a known state. The sequence and
timing of how the FPGA switches over is programmable as is the clock source controlling
the sequence.
www.xilinx.com
251
In most cases, the GSR is asynchronous to the system clock. It is the designer's
responsibility to make sure sensitive parts of the design, such as state machines, are
equipped with a local reset circuit to guarantee a clean start-up. Refer to
WP272, Get Smart About Reset: Think Local, Not Global for further details.
The default start-up sequence appears in Figure 12-12, where the Global Three-State signal
(GTS) is released one clock cycle after DONE goes High. This sequence allows the DONE
signal to enable or disable any external logic used during configuration before the user
application in the FPGA starts driving output signals. One clock cycle later, the Global
Write Enable (GWE) signal is released. This allows signals to propagate within the FPGA
before any clocked storage elements such as flip-flops and block ROM are enabled.
The function of the dual-purpose I/O pins, such as M[2:0], VS[2:0], HSWAP, PUDC_B, and
A[25:0], also changes when the Global Three-State (GTS) signal is released. The dualpurpose configuration pins become user I/Os. The exception on Spartan-3E and Extended
Spartan-3A family FPGAs is the CCLK pin, which becomes a user-I/O pin at the End of
Startup (EOS).
Default Cycles
Start-Up Clock
Phase
6 7
DONE
GTS
GWE
Sync-to-DONE
Start-Up Clock
Phase
6 7
DONE High
DONE
GTS
GWE
UG332_c12_10_110406
252
www.xilinx.com
Startup
By default, the start-up sequence is synchronized to CCLK. The Cclk option or the
UserClk option is required for Master Mode or Slave Mode configuration.
2.
3.
When using JTAG configuration, the start-up sequence must be synchronized to the
TCK clock input (StartupClk:JtagClk).
www.xilinx.com
253
Table 12-8:
Signal Name
DONE
Type
Access
Bidirectional
DONE pin or
Status Register
Description
Indicates configuration is complete.
Can be held Low externally to
synchronize startup with other
FPGAs.
Release_DONE
GWE
GTS
EOS
Status
Status Register
DCI_MATCH
DCM_LOCK
Figure 12-13 is a generalized block diagram of the configuration logic, showing the
interaction of different device inputs and Bitstream Generator (BitGen) options.
254
www.xilinx.com
Figure 12-13:
www.xilinx.com
TCK
M2
M1
Glitch Filter
VCCAUXT
VCCINTT
VCCO2T
CCLK
PROG_B
VCCAUX
VCCINT
VCCO_2
Internal
Oscillator
ConfigRate
0
POWER_GOOD
= Design Attribute
Option
Option
LOCKED
DONE
JTAG_CLOCK
WAIT
All DCMs
RESET
ERROR
StartupClk
USER
USER
Configuration Error
Detection
(CRC Checker)
ENABLE
USER_CLOCK
CRC
DONE
Load application
data into CMOS
configuration latches
ENABLE
CONFIGURATION
INTERNAL_CONFIGURATION_CLOCK
RESET
CLEARING_MEMORY
ENABLE
INITIALIZATION
STARTUP_WAIT=TRUE
DCM in User
Application
*
*
DONE
WAIT
DonePipe
GWE
GSR
GTS
GWE_cycle
GTS_cycle
DONE_cycle
EN
EN
RESET
GSR_IN
GTS_IN
ENABLE
DCMs_LOCKED
LCK_cycle
STARTUP
DriveDone
INIT_B
Disable write
operations to
storage elements
DONE
Startup
DS312-2_57_102605
255
256
www.xilinx.com
Chapter 13
Configuration-Related Design
Primitives
The following configuration primitives provide access to FPGA configuration resources
during or after FPGA configuration.
Boundary-Scan (BSCAN)
The BSCAN component, shown in Figure 13-1, provides access to and from the JTAG
Boundary Scan logic controller from internal FPGA logic, allowing communication
between the internal FPGA application and the dedicated JTAG pins of the FPGA. The
BSCAN primitive is not required for normal JTAG operations. It is only required when
implementing private JTAG scan chains within the FPGA logic. Although the BSCAN
primitive is functionally equivalent on all Spartan-3 generation FPGAs, the primitive
name varies by family, as shown in Table 13-1, page 258.
(Use for Spartan-3A/3AN/3A DSP)
BSCAN_SPARTAN3A
TDO1
TCK
TMS
TDO2
BSCAN_SPARTAN3
CAPTURE
TDO1 CAPTURE
DRCK1
DRCK1
DRCK2
DRCK2
RESET
RESET
SEL1
SEL1
SEL2
SEL2
SHIFT
SHIFT
TDI
TDI
UPDATE
TDO2
UPDATE
UG332_C13_01_040107
Figure 13-1:
www.xilinx.com
257
Table 13-1:
Primitive
Spartan-3A/3AN FPGAs
BSCAN_SPARTAN3A
BSCAN_SPARTAN3
Spartan-3 FPGAs
The BSCAN primitive on Spartan-3 generation FPGAs allows up to two internal, private
boundary scan chains called USER1 and USER2.
A signal on the TDO1 input is passed to the external TDO output when the USER1
instruction is executed; the SEL1 output goes High to indicate that the USER1 instruction is
active. The DRCK1 output provides USER1 access to the data register clock (generated by
the TAP controller). The TDO2 and SEL2 pins perform a similar function for the USER2
instruction and the DRCK2 output provides USER2 access to the data register clock
(generated by the TAP controller). The RESET, UPDATE, SHIFT, and CAPTURE pins
represent the decoding of the corresponding state of the boundary scan internal state
machine. The TDI pin provides access to the TDI signal of the JTAG port in order to shift
data into an internal scan chain.
Usage
The BSCAN component is generally used with IP, such as the ChipScope analyzer tool,
for communications via the JTAG pins of the FPGA to the internal device logic. When used
with this IP, this component is generally instantiated as a part of the IP and nothing more
is needed by the user to ensure it is properly used. However, the BSCAN component can
be instantiated in any FPGA design although only one BSCAN component can be used in
any single design.
Port Descriptions
Table 13-2:
Port Name
Direction
TDI
Output
TCK
Output
TMS
Output
DRCK1, DRK2
Output
The value of the TCK input pin to the FPGA when the
JTAG USER instruction is loaded and the JTAG TAP
controller is in the SHIFT-DR state. DRCK1 applies to the
USER1 logic while DRCK2 applies to USER2.
RESET
Output
Output
SEL1, SEL2
258
Function
www.xilinx.com
Start-Up (STARTUP)
Table 13-2:
Port Name
Direction
Function
SHIFT
Output
CAPTURE
Output
UPDATE
Output
TDO1, TDO2
Input
Start-Up (STARTUP)
The STARTUP primitive is used to either interface device pins and/or logic to the global
asynchronous set/reset (GSR) signal, or for global, 3-state (GTS) dedicated routing. This
primitive can also be used to specify a different clock for the device startup sequence at the
end of configuring the device.
STARTUP_SPARTAN3
STARTUP_SPARTAN3A
STARTUP_SPARTAN3E
GSR
GSR
GTS
GTS
MBT
CLK
CLK
UG332_C13_02_120106
Figure 13-2:
As shown in Figure 13-2, the STARTUP primitive is similar between Spartan-3 generation
FPGA families, although the Spartan-3E STARTUP primitive has an additional input pin to
support MultiBoot functions. The specific STARTUP primitive name also varies by family,
as indicated in Table 13-3.
Table 13-3:
Spartan-3A/3AN FPGAs
Spartan-3A DSP FPGAs
Primitive
STARTUP_SPARTAN3A
Spartan-3E FPGAs
STARTUP_SPARTAN3E
Spartan-3 FPGAs
STARTUP_SPARTAN3
www.xilinx.com
259
Usage
The STARTUP primitive must be instantiated into the design. To use the dedicated GSR
circuitry, connect the sourcing pin or logic to the GSR pin. However, avoid using the GSR
circuitry of this component unless certain precautions are taken first. Since the skew of the
GSR net cannot be guaranteed, either use general routing for the set/reset signal in which
routing delays and skew can be calculated as a part of the timing analysis of the design, or
ensure that possible skew during the release of GSR will not interfere with proper circuit
operation.
Similarly, if the dedicated global 3-state is used, connect the appropriate sourcing pin or
logic to the GTS input pin of the primitive. In order to specify a user clock for the startup
sequence of configuration, connect a clock from the design to the CLK pin of the STARTUP
component.
Port Descriptions
Table 13-4:
Port Name
Direction
Function
GSR
Input
GTS
Input
MBT
Input
CLK
Input
CAPTURE_SPARTAN3A
CAP
CLK
UG332_C13_03_081406
Figure 13-3:
Caution! On Spartan-3E FPGAs, Readback is available on all devices except for the
XC3S1200E and XC3S1600E in the -4 speed grade, in the commercial temperature range.
Readback is supported on all Spartan-3E FPGAs available in the -5 speed grade or in the
industrial temperature range.
260
www.xilinx.com
Usage
The CAPTURE primitive is optional within a design. Without it, Readback is still
performed, but the asynchronous capture function it provides for register states is not
available.
Spartan-3 generation FPGAs only capture register (flip-flop and latch) states. Although
LUT RAM, SRL, and block RAM bit values are read back, their values cannot be captured.
To capture the register states, assert the CAP signal High. The state is captured on the next
rising edge of CLK.
By default, data is captured after every trigger (transition on CLK while CAP is asserted).
To limit the readback operation to a single data capture, add the ONESHOT attribute to
CAPTURE devices.
Although the CAPTURE primitive functions equivalently on all Spartan-3 generation
FPGA families, the required design primitive varies by family, as indicated in Table 13-5.
Table 13-5:
Primitive
Spartan-3A/3AN FPGAs
CAPTURE_SPARTAN3A
CAPTURE_SPARTAN3
Spartan-3 FPGAs
For more information on Readback and the CAPTURE primitive, see XAPP452: Spartan-3
Advanced Configuration Architecture.
Port Description
Table 13-6:
Port Name
Direction
Description
CLK
Input
CAP
Input
Attributes
Table 13-7 describes the ONESHOT attribute available on the CAPTURE primitive.
Table 13-7:
CAPTURE Attributes
Attribute
Type
Allowed
Values
Default
Description
ONESHOT
Boolean
TRUE,
FALSE
FALSE
www.xilinx.com
261
Usage
The ICAP_SPARTAN3A primitive works similar to the Slave Parallel (SelectMAP)
configuration interface except it is available to the FPGA application using internal routing
connections. Furthermore, the ICAP primitive has separate read and write data ports, as
opposed to the bidirectional bus on the Slave Parallel (SelectMAP) interface. ICAP allows
the FPGA application to access configuration registers, readback configuration data, or to
trigger a MultiBoot event after configuration successfully completes.
For additional information on the Slave Parallel (SelectMAP) interface, see Chapter 7,
Slave Parallel (SelectMAP) Mode.
For additional information on Extended Spartan-3A family MultiBoot, Chapter 14,
Reconfiguration and MultiBoot.
ICAP_SPARTAN3A
I[0:7]
WRITE
O[0:7]
BUSY
CE
CLK
UG332_C13_04_111906
Figure 13-4:
Port Description
Caution! Xilinx convention defines I0 and O0 as the most-significant bits; I7 and O7 are the
least-significant bits. This is different than conventions elsewhere. Watch out for bit reversals!
Table 13-8:
Signal
Name
Equivalent
SelectMAP Pin
Name
Direction
CLK
CCLK
Input
CE
CS_B or CSI_B
Input
Active-Low select
Description
RDWR_B
Input
0 = WRITE
1 = READ
262
I[0:7]
D[0:7]
Input
O[0:7]
D[0:7]
Output
BUSY
DOUT
Output
www.xilinx.com
DNA_PORT
DIN
DOUT
READ
SHIFT
CLK
UG332_C13_05_081406
Figure 13-5:
The DNA_PORT provides access to a dedicated shift register which can be loaded with the
Device DNA data bits (unique ID) for a given Extended Spartan-3A family device. In
addition to shifting out the DNA data bits, this component allows for the inclusion of
supplemental data bits for additional user data or allow for the DNA data to rollover
(repeat DNA data after initial data has been shifted out). This component is primarily used
in conjunction with other circuitry to build anti-cloning protection for the FPGA bitstream
from possible theft. See Chapter 15, Protecting FPGA Designs, for additional
information.
Usage
The DNA_PORT component must be instantiated in order to be used in a design. To do so, use
the instantiation template found within the ISE software Project Navigator HDL Templates
and place this instance declaration within the code. Connect all inputs and outputs to the
design in order to ensure proper operation.
In order to access the Device DNA data, the shift register must first be loaded by setting the
active high READ signal for one clock cycle. After the shift register is loaded, the data may be
synchronously shifted out by enabling the active high SHIFT input and capturing the data out
the DOUT output port. If desired, additional data may be appended to the end of the 57-bit shift
register by connecting the appropriate logic to the DIN port. If DNA data rollover is desired,
connect the DOUT port directly to the DIN port to allow for the same data to be shifted out after
completing the 57-bit shift operation. If no additional data is necessary, the DIN port may be
tied to a logic zero. The attribute SIM_DNA_VALUE may be optionally set to allow for
simulation of a possible DNA data sequence. By default, the Device DNA data bits are all zeros
in the simulation model.
See Operation, page 298 for additional information.
www.xilinx.com
263
Port Descriptions
Table 13-9:
Port Name
Direction
Function
DOUT
Output
DIN
Input
READ
Input
SHIFT
Input
CLK
Input
Clock Input
Attributes
Table 13-10:
264
DNA_PORT Attributes
Attribute
Type
Allowed
Values
SIM_DNA_VALUE
57-bit
vector
Any 57-bit
value
www.xilinx.com
Default
All zeros
Description
Specifies a DNA value for
simulation purposes (the actual
value will be specific to the
particular device used)
Chapter 14
www.xilinx.com
265
Table 14-1:
Spartan-3E
Extended Spartan-3A
Simple
Yes
Yes
No
Yes
No
Spartan-3AN only
No
Yes
MBT input on
STARTUP primitive
Via command
sequence to ICAP
primitive, JTAG
interface, Slave Serial,
or Slave Parallel
(SelectMAP) interface
Application complexity
MultiBoot not
available on Spartan3 FPGA family.
Ether at address 0
with incrementing
addresses or highest
PROM address with
decrementing
addresses
Controlled by M0
mode pin.
0 = Address 0
Always at address 0
1 = Highest PROM
address
Can FPGA application specify MultiBoot start
address?
Configuration watchdog timer automatically
reconfigures FPGA starting at address 0 if
MultiBoot operation fails
Yes
No
Yes
Spartan-3E MultiBoot
After the FPGA configures itself using BPI mode from one end of the parallel Flash PROM,
then the FPGA can trigger a MultiBoot event and reconfigure itself from the opposite end
of the parallel Flash PROM. MultiBoot is only available when using BPI mode and only for
applications using a single Spartan-3E FPGA. MultiBoot does not support multi-FPGA
configuration daisy chains.
266
www.xilinx.com
Spartan-3E MultiBoot
By default, the MultiBoot feature is disabled. To use MultiBoot in an application, the FPGA
design must first include a STARTUP_SPARTAN3E design primitive, described in
Start-Up (STARTUP), page 259. To trigger a MultiBoot event, assert a Low pulse lasting
at least 300 ns on the MultiBoot Trigger (MBT) input to the primitive. When the MBT signal
returns High after the Low pulse, the FPGA automatically reconfigures from the opposite
end of the parallel Flash memory.
Figure 14-1 illustrates a simple MultiBoot design example. At power up, the FPGA loads
itself from the attached parallel Flash PROM. In this specific example, the M0 mode pin is
Low so the FPGA configures starting at Flash address 0 and increments through the PROM
memory locations. After the FPGA completes configuration, this example FPGA
application performs a board-level or system test using FPGA logic. If the test is successful,
the FPGA then triggers a MultiBoot event, causing the FPGA to reconfigure from the
opposite end of the Flash PROM memory, in this case starting at address 0xFFFF. The
FPGA actually starts at address 0xF_FFFF but the upper four address bits, A[23:20], are
not connected to the PROM in this example. The FPGA addresses the second configuration
image, which in this example contains the FPGA application for normal operation.
Similarly, the second FPGA application could trigger another MultiBoot event at any time
to reload the diagnostics design from address 0, and so on.
1Mbyte Parallel PROM
0xFFFFF
General
FPGA
Application
STARTUP_SPARTAN3E
MultiBoot
Trigger
pulse from
application
User Area
0xFFFFF
General
FPGA
Application
GSR
User Area
GTS
MBT
> 300 ns
CLK
Di agnostics
FPGA
Application
Reconfigure
0
Di agnostics
FPGA
Application
0
First Configuration
Second Configuration
DS332_c14_01_082006
Figure 14-1:
www.xilinx.com
267
Asserting the PROG_B pin Low overrides the MultiBoot feature and forces the FPGA to
reconfigure starting from the end of memory defined by the mode pins, shown in
Table 5-2, page 147.
2.
UG332_c14_04_112906
Figure 14-2:
268
3.
Click Next.
4.
www.xilinx.com
Spartan-3E MultiBoot
UG332_c14_03_112906
6.
7.
8.
Click Next.
9.
As shown in Figure 14-4, select the Initial Boot Direction. This is the location from
where the first configuration image loads. The initial location depends on the BPI
mode pin settings.
www.xilinx.com
269
10
UG332_c14_05_112906
Figure 14-4:
11
12
13
UG332_c14_06_112906
Figure 14-5:
12. Click Add to use the PROM density specified in Step 11. In Spartan-3E MultiBoot
mode, only a single PROM is allowed. The PROM density also determines the highest
PROM address location.
13. Click Next.
14. The iMPACT software summarizes the current settings, as shown in Figure 14-6. Click
Finish to continue.
270
www.xilinx.com
Spartan-3E MultiBoot
14
UG332_c14_07_112906
Figure 14-6:
15. As shown in Figure 14-7, start selecting the FPGA configuration bitstream for the
design that initially loads at power-up or when the PROG_B input is pulsed Low.
15
16
17
UG332_c14_08_081906
Figure 14-7:
16. Using the file selection mechanism for your operating system, choose the initial
bitstream. This bitstream is loaded at the initial PROM location specified in Step 9.
17. Click Open.
www.xilinx.com
271
18. As shown in Figure 14-8, the iMPACT software then prompts for the second MultiBoot
configuration image.
18
19
20
21
UG332_c14_09_082006
Figure 14-8:
272
www.xilinx.com
Spartan-3E MultiBoot
23
22
UG332_c14_10_082006
Figure 14-9:
23. The iMPACT software successfully generates a PROM file using the name specified in
Step 7 with the format and file extension specified in Step 6. The file is created in the
current directory. A PROMGen Report File is also created.
www.xilinx.com
273
Mcs 86 (32-bit)
1024K
0000:0000
000f:ffff
07515767
Addr2
0004 :547f
000b:ab80
7 0000:0000
8 000f:ffff
Figure 14-10:
2.
Various formats are available. The Intel MCS format is one of the popular options.
3.
The base output file name. The extension depends on the selected format.
4.
In the example shown above, the first MultiBoot file is loaded for the BPI Up mode,
meaning that the file starts at address 0.
5.
The second MultiBoot file is loaded at the opposite end of memory, in this case at the
maximum PROM address and loaded downward.
6.
The PROM size is specified in kilobytes (K). In the example, the PROM is 1Mbyte or
1024K.
7.
The first MultiBoot image is loaded starting at PROM address 0 and ends at
hexadecimal address 0x4547F.
8.
The second MultiBoot image is loaded starting at the highest PROM address, which is
at hexadecimal 0xFFFFF for a 1Mbyte PROM. The image is loaded downward
(decrementing address) and ends at hexadecimal address 0xBAB80.
274
www.xilinx.com
The maximum number of FPGA images supported is limited either by the size of the
configuration PROM or the total number of address bits.
If the FPGA is set to wait for the Digital Clock Managers (DCMs) to lock before
finishing configuration, then there must be sufficient padding between images to
allow for this time. The padded region can contain data, but it cannot contain a
valid configuration synchronization word.
Fixed, Known Address: If the next address is predefined and known at design time,
the next MultiBoot address can be preloaded within the current FPGA bitstream using
the next_config_addr bitstream generator (BitGen) option. The parallel NOR Flash
address or the SPI serial Flash address is specified as an seven-character hexadecimal
string.
next_config_addr = 0x0000000
www.xilinx.com
275
2.
Variable or Calculated Address: The FPGA application itself can supply the address
of the next MultiBoot image by writing a command sequence to the FPGAs
ICAP_SPARTAN3A design primitive.
Spacing MultiBoot bitstreams sufficiently apart in memory prevents the FPGA from ever
seeing the second synchronization word. The following are some points to consider.
276
Is the DCM_WAIT option being used in the FPGA application? The potential issue
only occurs if DCM_WAIT=TRUE.
Which DCM outputs are used? There are two lock time specifications in the data
sheet: LOCK_DLL specifies the lock time for the DLL outputs from the DCM (CLK0,
CLK90, CLK180, CLK270, CLK2X, CLK2X180, CLKDV) and LOCK_DFS specifies the
lock time for the DFS outputs (CLKFX, CLKFX180).
www.xilinx.com
The specified lock time also depends on the input clock frequency. Again, consider
both the DLL and DFS specifications. The lock time is longest at 5 ms for input
frequencies below 15 MHz
The amount of spacing between bitstreams also depends on the ConfigRate bitstream
option setting in the bitstream and the maximum frequency of CCLK at that
ConfigRate setting.
The number of spacing bits required also depends on the configuration mode. The SPI
Flash mode receives one bit per clock while the BPI mode receives eight bits or one
byte per clock.
Example
A Spartan-3A MultiBoot application includes an FPGA bitstream that contains at least
one DCM with the DCM_WAIT option set TRUE. The FPGA application uses a DLL
output from the DCM. The input clock frequency to the DCM is 33 MHz. The data
sheet lock time specification (LOCK_DLL) for DCM clocks faster than 15 MHz is 600
s. The FPGA bitstream has the ConfigRate option set to 25. According to
DS529: Spartan-3A FPGA Family Data Sheet, setting ConfigRate:25 means that CCLK
will never have a period shorter than 45 ns. The MultiBoot application configures from
an SPI serial Flash.
Dividing the 600s lock time by the 45 ns CCLK period yields 13,334 clock cycles. In
SPI mode, the FPGA receives one bit per clock cycle. Consequently, under these
conditions, two MultiBoot configuration images must be place more than 13,334 bit
locations from each other in memory.
If the FPGA configured from parallel Flash, then the FPGA receives 8 bits per clock
cycle. Consequently, the application must space the two configurations apart by more
than 13,334 byte locations, which is equivalent to 106,672 bits.
The memory space between two configuration images can contain data as long as it does
not contain a valid Spartan-3A configuration synchronization word, shown in Table 12-3,
page 247. Alternatively, leave the space between locations programmed with 0xFF, which
is the same state as an unprogrammed Flash location.
Design Specification
Enable the ICAP interface, which is required for MultiBoot functionality, in the FPGA
configuration bitstream, using the ICAP_Enable:Auto or ICAP_Enable:Yes bitstream
generator option setting.
Caution! The ICAP interface will not be available until the first configuration has completed
startup, including the End of Startup cycle. Allow a few additional clock cycles after the end of
configuration before beginning the ICAP MultiBoot sequence. See Startup in Chapter 12.
www.xilinx.com
277
If the next address is fixed and already known at design time, preload the GENERAL1
and GENERAL2 registers with default values by setting the next_config_addr
bitstream generation (BitGen) option.
If the FPGA application calculates the next MultiBoot configuration start address,
load the GENERAL1 and GENERAL2 registers via ICAP with the start address of the
next MultiBoot configuration image.
The GENERAL1 and GENERAL2 registers are preloaded during configuration via the
next_config_addr bitstream generation (BitGen) option.
The next MultiBoot address is in the same memory originally used to configure the
FPGA or the same memory used during the last MultiBoot operation.
Each 16-bit command is written as two bytes to the ICAP interface, with the high byte
presented first, followed by the low byte. Note that D0 is the most-significant bit (msb) for
the ICAP interface, which is the opposite direction from most processors.
Table 14-2:
CLK
Cycle
1
2
3
4
5
6
7
8
SYNC WORD
Type 1 Write CMD
(1 Word)
REBOOT Command
No Op
High or
Low Byte
D0
D1
D2
D3
D4
D5
D6
D7
Hex
High
0xAA
Low
0x99
High
0x30
Low
0xA1
High
0x00
Low
0x0E
High
0x20
Low
0x00
278
www.xilinx.com
Each 16-bit command is written as two bytes to the ICAP interface, with the high byte
presented first, followed by the low byte. Note that D0 is the most-significant bit (MSB) for
the ICAP interface, which is the opposite direction from most processors.
The sequence in Table 14-3 uses 16 steps, and consequently 16 CLK cycles and 16 memory
locations. The sequence can be shortened to 12 CLK cycles by making the following simple
changes.
Table 14-3:
CLK
Cycle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Align the next MultiBoot address to a 16-bit (64K) boundary and pre-assign the
contents of the GENERAL1 register to 0x0000 by setting the
next_config_addr:00000000 bitstream generator option. The next MultiBoot address
is then selectable solely by writing to the GENERAL2 register. This eliminates the four
steps between CLK cycles 3 and 6.
D0
D1
D2
D3
D4
D5
D6
D7
Hex
High
0xAA
Low
0x99
High
0x32
Low
0x61
High
A15
A14
A13
A12
A11
A10
A9
A8
Low
A7
A6
A5
A4
A3
A2
A1
A0
High
0x32
Low
0x81
High
C7
C6
C5
C4
C3
C2
C1
C0
Low
A23
A22
A21
A20
A19
A18
A17
A16
High
0x30
Low
0xA1
High
0x00
Low
0x0E
High
0x20
Low
0x00
Command
SYNC WORD
REBOOT Command
No Op
www.xilinx.com
279
MultiBoot Registers
Generally, there are three ICAP registers involved in a MultiBoot application. The address
of the next MultiBoot bitstream is stored in registers GENERAL1 and GENERAL2,
although they can be preloaded via BitGen option next_config_addr. To trigger a
MultiBoot event, the FPGA application must issue a REBOOT command using the CMD
register.
GENERAL1
Address 01_0011 (0x13)
15
14
13
12
11
10
A15
A14
A13
A12
A11
A10
A9
A8
A7
A6
A5
A4
A3
A2
A1
A0
The context of the GENERAL2 register depends on whether the next MultiBoot address is
in an external parallel NOR Flash (BPI mode) or an external SPI serial Flash (SPI mode).
In BPI mode, the GENERAL2 register contains the upper 10 bits of the 26-bit BPI address,
as shown in Table 14-5. The upper six bits of the register are reserved.
280
www.xilinx.com
Table 14-5:
GENERAL2
Address 01_0100 (0x14)
15
14
13
12
11
10
A25
A24
A23
A22
A21
A20
A19
A18
A17
A16
In SPI mode, the GENERAL2 register contains the upper 8 bits of the 24-bit SPI address, as
shown in Table 14-6. The upper eight bits of the register contain the specific byte-wide read
command for the attached external SPI serial Flash device.
Table 14-6:
15
14
12
11
10
C6
C5
C4
C3
C2
C1
C0
A23
A22
A21
A20
A19
A18
A17
A16
CMD
Address 00_0101 (0x05)
15
14
13
12
11
10
REBOOT
Command
Reserved
Only one command is required for MultiBoot operations, the REBOOT command, which is
binary 01110.
www.xilinx.com
281
MODE_REG
Address 01_0101 (0x15)
Name
Bit(s)
Description
Default
Reserved
[15:7]
Reserved
NEW_MODE
BOOTMODE
5:3
Reserved
2:0
Reserved
001
(SPI)
111
282
www.xilinx.com
Bitstream Spacing
Flash sector boundary
alignment
Minimum spacing
requirements if
DCM_WAIT=TRUE
Spartan-3A
FPGA
(XC3S700A)
16Mbit
SPI Flash
15
14
13
12
11
10
9
8
MultiBoot
7
Up
Bitstream 2
6
0xC0000
5
MultiBoot
4
Up
Bitstream 1
3
0x60000
2
Initial Bitstream
1
(Default)
Up
Always
0 at 0
0x0
UG332_c14_19_082106
Figure 14-11:
1.
2.
UG332_c14_04_112906
Figure 14-12:
3.
Click Next.
www.xilinx.com
283
4.
8
UG332_c14_12_082006
Figure 14-13:
284
5.
6.
7.
8.
Click Next.
www.xilinx.com
9.
10
UG332_c14_13_082006
Figure 14-14:
11
12
13
14
15
UG332_c14_14_082006
Figure 14-15:
www.xilinx.com
285
What are the page or sector boundaries of the Flash device? Ideally, the FPGA
bitstream should start on a Flash sector boundary.
If using the DCM_WAIT option on a Digital Clock Manager (DCM) with the
FPGA application, is there enough additional spacing between images to
accommodate the extra lock time?
16
UG332_c14_15_082006
Figure 14-16:
17. As shown in Figure 14-17, add the initial FPGA bitstream. This is the design that is
loaded into the FPGA at power-up, or whenever the PROG_B pin is pulsed Low. This
is also the default bitstream that is automatically loaded if the Configuration
Watchdog Timer (CWDT) expires during a MultiBoot operation.
286
www.xilinx.com
17
18
20
19
UG332_c14_16_082106
Figure 14-17:
22
23
25
24
26
UG332_c14_17_082106
Figure 14-18:
www.xilinx.com
287
28
27
UG332_c14_18_082106
Figure 14-19:
28. The iMPACT software successfully generates a PROM file using the name specified in
Step 7 with the format and file extension specified in Step 6. The file is created in the
current directory. A PROMGen Report File is also created.
Configuration Fallback
The Spartan-3A, Spartan-3AN, and Spartan-3A DSP families include logic to automatically
fallback and re-start configuration after a configuration failure. These features are
particularly useful when providing the FPGA with live Flash updates. This feature is
especially useful in MultiBoot applications, including applications that will be updated in
the field, to help protect against failed updates. Two events may cause the device to
fallback.
288
1.
2.
www.xilinx.com
Configuration Fallback
The CWDT is a 16-bit counter, clocked by the CCLK configuration clock signal. Upon any
FPGA configuration operation, be it from power-up, a PROG_B pulse, or a MultiBoot
event, the CCLK clock begins operation at its lowest ConfigRate setting, which is
approximately 1 MHz. The CWDT expires 64K clock cycles after the start of configuration,
or in approximately 65 ms.
If, during a MultiBoot operation, the FPGA does not see a valid configuration
synchronization word before the CWDT expires, then the FPGA will automatically fallback
to the default bitstream located at address 0. The FPGA automatically reconfigures from
the default bitstream, even resending the appropriate SPI Flash read command if using the
SPI configuration mode.
www.xilinx.com
289
Advanced Capabilities
Switching between MultiBoot Configuration Memory Types
The Extended Spartan-3A family MultiBoot feature also provides the advanced capability
to jump between configuration modes and hence different types of external memory. This
feature is not recommended for most applications because switching to the SPI mode does
not support the Configuration Watchdog Timer.
As shown in Figure 14-20, during a MultiBoot event, the Extended Spartan-3A family
internal configuration controller determines which FPGA configuration mode to execute.
By default, the FPGA uses the mode select values physically defined on the FPGAs M[2:0]
mode select pins. Similarly, if the FPGA mode pins specify the Master SPI Flash mode, then
the controller uses the Read Command associated with the variant select values, VS[2:0],
defined by the associated FPGA pins.
However, by setting the control bit NEW_MODE = 1 in the MODE_REG register, the
internal configuration controller uses the configuration mode specified by the
BOOTMODE bits. If BOOTMODE = 001 to specify the Master SPI Flash mode, then the
controller uses the Read Command specified in the higher-order byte {15:8] of the
GENERAL2 register, and the remaining lower-order byte of the GENERAL2 register
provides the upper 8 bits of the 24-bit MultiBoot address. If BOOTMODE = 010 to specify
the BPI Flash mode, then the lower 10 bits of the GENERAL2 register become the upper 10
bits of the 26-bit BPI MultiBoot address. In both cases, the GENERAL1 register provides
the lower 16 bits of the MultiBoot address (see Next MultiBoot Start Address
(GENERAL1, GENERAL2), page 280).
Caution! Fallback is not supported when switching to the SPI mode during MultiBoot.
FPGA
BOOTMODE
M2 M1 M0
GENERAL2
15
14 13
Mode
Select Pins
Variant
Select Pins
Internal Configuration
Controller
VS2
VS1
VS0
Read
Cmd
Lookup
1
0
M2
M1
M0
0 = From Pins
1 = From Mode Register
NEW_MODE
UG332_c14_02_110507
Figure 14-20:
290
www.xilinx.com
Configuration Fallback
www.xilinx.com
291
292
www.xilinx.com
Chapter 15
Extended Spartan-3A Family Unique Device Identifier (Device DNA), page 298
www.xilinx.com
293
Table 15-1:
Security Level
Description
None
Level1
Disable all Readback functions from either the SelectMAP or JTAG port.
Level2
Security Level
Description
None
Level1
Disable all Readback functions from both the SelectMAP or JTAG ports.
Readback via the Internal Configuration Access Port (ICAP) allowed.
Level2
Level3
294
www.xilinx.com
UG332_c1_04_120306
Figure 15-1:
1.
2.
Select Properties.
From the Process Properties dialog box shown in Figure 15-2, set the following options.
3
4
UG332_c16_07_0918
Figure 15-2:
3.
4.
Choose the Security level value that best meets the needs of the application.
www.xilinx.com
295
Table 15-3:
Value
Spartan-3A/3AN
Spartan-3A DSP
FPGAs
None
None
Disable Readback
Level1
Level1
Level2
Level3
Encryption
Authentication
Xilinx CPLDs
Virtex-II, Virtex-II
Pro, Virtex-4, Virtex5 FPGAs
Spartan-3A/3AN/
3A DSP FPGA (but
variations possible in
Spartan-3/3E FPGAs)
No
No, only in
encrypted form
Yes
Yes
Yes
N/A
Configures
(easily supports
test and debug)
Behavior defined by
FPGA application (see
Handling Failed
Authentications)
No
No
Yes
No
No
Yes
Requires a large
amount of on-chip
nonvolatile memory
Key management
Technical Limitations
296
www.xilinx.com
Security Bits
Complex PLD (CPLD) designs are programmed into on-chip, nonvolatile memory, similar
to simple microcontrollers. As such, CPLDs and microcontrollers typically offer a
security bit or bits that locks the internal memory array, preventing the array from being
read. Locking the array prevents the design from being easily copied.
Encryption
Some FPGAs employ bitstream encryption. Encryption essentially scrambles the external
bitstream so that it is unusable unless loaded into an FPGA containing the correct key to
decrypt the bitstream. The encryption circuitry is typically a dedicated embedded function
on the FPGA, consuming valuable silicon area. Applications that do not use encryption
pay for the feature regardless.
Encryption is considered highly secure, as implemented with battery back-up on the Xilinx
Virtex, Virtex-II Pro, Virtex-4, and Virtex-5 FPGA families.
The built-in encryption circuitry only protects the FPGA bitstream and is typically not
available after configuration to protect application data.
The primary downside of encryption is key management and key distribution.
Authentication
Authentication is another protection technique, widely used in a variety of applications.
Authentication is distinctly different than using either security bits or encryption. Here
are a few examples of everyday applications using authentication.
When you access an Automated Teller Machine (ATM), you insert your bank card and
authenticate your identity by entering a Personal Identification Number (PIN). If
someone steals your ATM card, they cannot use it without also having your PIN
number.
When you log onto your computer network, you enter your login name and your
password. The password authenticates your identity. An imposter must have both
your login name and your password to access the network from your account.
Many software programs, including the Xilinx ISE development software, require an
authorization code before they operate on your computer. You can freely copy the
DVD but it can only be used when unlocked by the authorization code.
Unique
2.
www.xilinx.com
297
DNA_PORT
DIN
DOUT
READ
SHIFT
CLK
UG332_C13_05_081406
Figure 15-3:
Identifier Value
As shown in Figure 15-4, the Device DNA value is 57 bits long. The two most-significant
bits are always 1 and 0. The remaining 55 bits are unique to a specific Extended Spartan3A family FPGA.
Operation
Figure 15-4 shows the general functionality of the DNA_PORT design primitive. An FPGA
application must first instantiate the DNA_PORT primitive, shown in Figure 15-3, within a
design.
To read the Device DNA, the FPGA application must first transfer the identifier value into
the DNA_PORT output shift register. Assert the READ input during a rising edge of CLK,
as shown in Table 15-5. This action parallel loads the output shift register with all 57 bits of
the identifier. Because bit 56 of the identifier is always 1, the DOUT output is also 1. The
READ operation overrides a SHIFT operation.
To continue reading the identifier values, assert SHIFT followed by a rising edge of CLK, as
shown in Table 15-5. This action causes the output shift register to shift its contents toward
the DOUT output. The value on the DIN input is shifted into the shift register.
Caution! Avoid a Low-to-High transition on SHIFT when CLK is High as this causes a spurious
initial clock edge. Ideally, only assert SHIFT when CLK is Low or on a falling edge of CLK.
298
www.xilinx.com
SHIFT=1
56
READ=0
DIN
CLK
DOUT
54 55 56
0 1
UG332_c15_01_110206
DNA_PORT Operation
If both READ and SHIFT are Low, the output shift register holds its value and DOUT
remains unchanged.
Table 15-5:
DNA_PORT Operations
Operation
DIN
READ
SHIFT
CLK
Shift Register
DOUT
HOLD
Hold previous
value
READ
Bit 56 of
identifier, which
is always 1
SHIFT
DIN
Bit 56 of Shift
Register
Notes:
X = Dont care
= Rising clock edge
The Spartan-3A Starter Kit board has a design example that demonstrates how to read the
Device DNA value. This design displays the value from MSB to LSB (bit 0).
Interface Timing
Table 15-6 provides the interface timing for the DNA_PORT design primitive. The timing
is the same regardless of the FPGAs speed grade. As always, please refer to the associated
data sheet for official timing values.
Table 15-6:
Symbol
Description
Min
Max
Unit
tDNASSU
1.0
ns
tDNASH
0.5
ns
tDNADSU
1.0
ns
tDNADH
0.5
ns
tDNARSU
5.0
10,000
ns
tDNARH
ns
www.xilinx.com
299
Table 15-6:
Symbol
Description
Min
Max
Unit
tDNADCKO
0.5
1.5
ns
tDNACLKF
CLK frequency
100
MHz
tDNACLKL
1.0
ns
tDNACLKH
1.0
ns
Symbol
DNA_CYCLES
Description
Minimum
Units
30,000,000
Read cycles
300
www.xilinx.com
DNA_PORT
DNA_PORT
DIN DOUT
READ
SHIFT
CLK
DIN DOUT
READ
SHIFT
CLK
a) Shift in constant
b) Circular shift
Application Code
DIN
READ
SHIFT
CLK
DOUT
DNA_PORT
DIN DOUT
READ
SHIFT
CLK
READ
SHIFT
CLK
c) Bitstream specific code
Figure 15-5:
UG332_c15_02_120106
www.xilinx.com
301
Authenticating any FPGA Design Using External Secure PROM, page 307
Configuration PROM
FPGA Fabric
FPGA Bitstream
Device DNA
Authentication
Check Value
UG332_c16_03_040107
Figure 15-6:
As shown in Figure 15-7, part of the FPGA application includes circuitry that validates that
the bitstream programmed into the PROM is authorized to operate on the associated
Extended Spartan-3A family FPGA. In reality, the Device DNA and the authentication
check value are both multi-bit binary values. However, for the sake of clarity, this example
uses symbolic values. In this example, the FPGAs Device DNA is Blue and the
configuration PROM is programmed with the check value Blueberry.
Spartan-3A/3AN/3A DSP FPGA
FPGA OK
Application
Valid
PROM?
Blue
Configuration PROM
FPGA Bitstream
Blueberry
UG332_c16_04_040107
Figure 15-7:
302
www.xilinx.com
After configuration, the FPGA checks that the value contained in the PROM matches the
value expected by the FPGA application. In this example, the FPGA validates that a
Blueberry is indeed Blue. The bitstream loaded from the PROM is authentic, and the
FPGA application is enabled for full operation.
What happens if an attacker copies the contents of an authenticated PROM, shown in
Figure 15-7, and uses it with a different, similarly sized Extended Spartan-3A family
FPGA? If the check value in the PROM does not match the value expected by the FPGA
application, then the FPGA application decides how to handle this unauthorized copy.
There are a variety of potential scenarios, as described in Handling Failed
Authentications, page 308. In this example, the PROM image fails because the FPGA
application checks that a Blueberry is not Yellow.
Spartan-3A/3AN/3A DSP FPGA
Configuration PROM
FAIL!
FPGA
Application
Valid
PROM?
FPGA Bitstream
Blueberry
Yellow
UG332_c16_06_040107
Figure 15-8:
Vendor
Family
Data
Format
Density
Unique ID Field
User Field
STMicro
(Numonyx)
M29W
Parallel
16 Mbit and
larger
64 bits
Spansion
S29A
Parallel
32 Mbit and
larger
256 bytes
(ESN)
Atmel
AT45DBxxxD
Serial
All
64 bytes
64 bytes
Atmel
AT45BV
Parallel
8 Mbit and
larger
64 bits
64 bits
www.xilinx.com
303
Table 15-8:
Vendor
Family
Data
Format
Density
Unique ID Field
User Field
Intel
(Numonyx)
Embedded
Flash
(J3 v. D)
Parallel
All
64 bits
64 bits
Intel
(Numonyx)
S33
Serial
All
64 bits
64 bits + 3,920
bits
Macronix
MX29
Parallel
32 Mbit and
larger
Figure 15-9 shows an authentication example using a Spartan-3E FPGA and a commodity
Flash PROM with an embedded device identifier. In this example, the configuration
PROM must contain a unique identifier. The PROM also contains the FPGA configuration
bitstream and the authentication check value, specific to this implementation.
At power-up or when PROG_B is pulsed Low, the FPGA configures normally.
Spartan-3E FPGA
Configuration PROM
with Device ID
FPGA Bitstream
FPGA Fabric
Device ID
Authentication
Check Value
UG332_c16_08_100406
Figure 15-9:
As shown in Figure 15-10, part of the FPGA application includes circuitry that validates
that the bitstream programmed into the PROM is authorized to load. The PROMs
Device ID and the authentication check value are both multi-bit binary values. For the sake
of clarity, this example uses symbolic values. The PROMs Device ID is Blue and the
configuration PROM is programmed with the check value Blueberry. The Flash ID plus
the authentication check value should be as large as practical. A larger number of bits
thwarts a possible spoof or middleman attack using an extra interposing device or
devices that intercepts the access to the off-FPGA identifier and check value. The
interposing device or devices mimics the response from an authentic PROM. This
technique requires additional components and a new printed circuit board, the additional
development and component costs of which act as a suitable deterrent.
If the FPGA authentication application accesses a large data field or check value, then the
interposing device or devices must be more sophisticated and consequently more
expensive. This potential vulnerability also highlights the advantage of the Extended
Spartan-3A family Device DNA, which is securely accessed from inside the FPGA.
304
www.xilinx.com
Spartan-3E FPGA
OK
Valid
PROM?
FPGA
Application
Configuration PROM
with Device ID
FPGA Bitstream
Blue
Blueberry
UG332_c16_09_100406
Figure 15-10:
After configuration, the FPGA checks that the value contained in the PROM matches the
value expected by the FPGA application. In this example, the FPGA validates that a
Blueberry is indeed Blue. The bitstream loaded from the PROM is authentic, and the
FPGA application is enabled for full operation.
The Spartan-3E Starter Kit board includes a design example demonstrating this technique.
This same method also applies for Spartan-3A, Spartan-3AN, Spartan-3A DSP FPGAs.
www.xilinx.com
305
FPGA
Bitstream
FPGA Fabric
Device DNA
UG332 c16 11 040107
Figure 15-11:
In Figure 15-12, the intelligent host reads the FPGAs Device DNA identifier, either
through the FPGA fabric or via the FPGAs JTAG port. Using the Device DNA value, the
host either computes an authentication check value locally or communicates to a remote
host that generates the check value or looks up the value in a list of authenticated devices.
Intelligent Host
FPGA
Bitstream
FPGA Fabric
Device DNA
Authentication
Check Value
Figure 15-12:
In Figure 15-13, the intelligent host writes the resulting authentication check value back
into the FPGA. The FPGA then uses this value and the Device DNA value to authenticate
the bitstream. If deemed authentic, the FPGA application is enabled for full operation.
Intelligent Host
FPGA
Bitstream
FPGA Fabric
OK
Valid
PROM?
Device DNA
UG332_c16_13_040107
Figure 15-13:
306
www.xilinx.com
Configuration
PROM
FPGA
DS2432
Secure
EEPROM
+3.3V
680
SIO
FPGA
Application
Authentication Core
1 Block RAM
~100 Slices
SIO
FOE
IFF
Bitstream
DESIGN
DISABLE
CHECK
REQUEST
UG332_c16_10_120406
Figure 15-14:
The FPGA configures normally from any configuration PROM. Alternatively, the FPGA
bitstream can be downloaded using one of the Slave configuration modes.
The FPGA application contains an Authentication Core that communicates to an external
DS2432 secure EEPROM. The authentication challenge between the FPGA and the
EEPROM uses a random number and SHA-1 hashing to thwart attacks. If the
authentication challenge fails, the FPGA application is disabled. Similarly, the FPGA
application can re-authenticate the design at any time, during normal operation.
This application is discussed in more detail in Xilinx application note XAPP780. The
Spartan-3E Starter Kit board includes all the necessary components.
DS2432 1Kb Protected 1-Wire EEPROM with SHA-1 Engine (Note that this is a
third-party design that is not tested by Xilinx or supported by Xilinx tools.)
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2914
Although not supported by an application note or example design, similar solutions are
possible using external components with similar security features, such as the following.
Note that these are third-party products that are not tested by Xilinx or supported by Xilinx
tools.
www.xilinx.com
307
No functionality
Limited functionality
No Functionality
The simplest way to respond to an unauthorized copy is for the application to stop
functioning. This is easily accomplished using features already on the FPGA, such as the
following.
Assert the Global Set /Reset (GSR) signal on the STARTUP design primitive, which
holds all flip-flops reset. See Start-Up (STARTUP), page 259. The signal driving GSR
must be either a logic-based latch or from an SRL16 shift register, neither of which are
affected by the GSR signal.
Assert the global three-state control on the STARTUP design primitive, which forces
all output pins to high-impedance (Hi-Z).
Disable global clock signals using a BUFGCE global clock primitive that has an enable
input, which prevents the clock signal from being distributed within the design.
Drive the set or reset inputs to key logic in Configurable Logic Blocks (CLBs).
Use a gating signal to disable key logic in Configurable Logic Blocks (CLBs).
Limited Functionality
Limited functionality provides partial or basic functionality. This approach allows a 3rd
party test house or contract manufacturers (CM) to build and test the unauthenticated
systems. This technique allows the CM to program the configuration PROM but does not
provide them authentication capability, eliminating the risk of potential overbuilding.
Disable key functions or special IP using one or more of the techniques described in No
Functionality. Optionally, degrade the performance of key features. For example, drop to
a lower communications data rate or a lower display resolution.
308
www.xilinx.com
Authentication Algorithm
In addition, the time out function makes a potential attack significantly more difficult. If
the system functions for awhile before failing, significantly more time is required to attack
the system using a brute force approach. Similarly, using a random time out value makes it
difficult for an attacker to determine if he or she cracked the system or whether there is an
inherent system design problem.
Active Defense
The final level of protection against unauthorized copying is an active defense. The active
defense can take many forms, again depending on the application requirements. For
example, the application can track the number of failed authentication attempts. Once the
number of failed attempts reaches a predefined threshold, the application can take more
drastic protection means such as erasing the configuration PROM or permanently locking
down sectors in the PROM.
Authentication Algorithm
The obvious question is What is the authentication algorithm? The answer is Its a
secret. Something in the authentication process must be secret, either the authentication
algorithm or the authentication values. In the examples using the Extended Spartan-3A
family Device DNA or the Flash PROM with a Device ID, the authentication algorithm
must be kept secret.
Because the authentication algorithm is implemented using FPGA logic, the algorithm is
flexible and changeable. The algorithm need only be as simple or complex as required by
the application being protected. The algorithm can be changed between design releases or
versions. Similarly, multiple and different authentication checks can co-exist in the same
application. This approach tunes the cost and complexity of security to the needs of the
application.
Manufacturing Logistics
Authentication simplifies manufacturing logistics, especially for high-volume
applications, built at contract manufacturers.
There are no special keys that need to be programmed into the FPGA. There is a a
programming step where the PROM is married to or authenticated with either the
FPGAs Device DNA, the PROMs Unique ID, or both but this operation does not
affect the FPGA bitstream.
The FPGA bitstream is common to all units. There is no need to match a bitstream to a
specific FPGA or a set of FPGAs. The authentication step can be completely separate
from bitstream programming.
Using the Limited Functionality, page 308 or Full Functionality with Time Out,
page 308 techniques described early, the contract manufacturer can build and test the
end product without risk of overbuilding or unauthorized cloning.
www.xilinx.com
309
Data Memory
MicroBlaze
32-bit RISC
CPU
Data
Encrypter/
Decrypter
Code
Decrypter
Instruction
Memory
Key
Device DNA
UG332_c16_14_092806
Figure 15-15:
310
www.xilinx.com
File an application to register the copyright claim for the bitstream program with the U.S.
Copyright Office.
If practical, given the size of the printed circuit board, notice should also be given that the
user is claiming that the bit-stream program is the company's trade secret. A statement
could be added to the PCB such as: Bitstream proprietary to XYZ Company. Copying or
other use of the bitstream program except as expressly authorized by XYZ Company is
prohibited.
To the extent that documentation, data books, or other literature accompanies the FPGAbased design, appropriate wording should be added to this literature providing third
parties with notice of the user's claim of copyright and trade secret in the bitstream
program.
For example, this notice could read: Bitstream 2006 XYZ Company. All rights reserved.
The bitstream program is proprietary to XYZ Company and copying or other use of the bitstream program except as expressly authorized by XYZ Company is expressly prohibited.
To help prove unauthorized copying by a third party, additional nonfunctional code
should be included at the end of the bitstream program. Therefore, should a third party
copy the bitstream program without proper authorization, if the non-functional code is
present in the copy, the copier cannot claim that the bitstream program was independently
developed.
These are only suggestions, and Xilinx makes no representations or warranties with
respect to the legal effect or consequences of the above suggestions. Each end-user
company is advised to consult legal counsel with respect to seeking protection of a
bitstream program and to determine the applicability of these suggestions to the specific
circumstances.
www.xilinx.com
311
Additional Information
For additional information see the following references on xilinx.com.
312
www.xilinx.com
Chapter 16
Configuration CRC
All Spartan-3 generation FPGAs have an embedded cyclic-redundancy checker (CRC)
circuit designed to flag errors when loading the configuration bitstream. The configuration
CRC circuit is always active during configuration unless specifically disabled in the
configuration bitstream. Extended Spartan-3A family FPGAs also optionally allow the
CRC circuit to continue operating after configuration.
www.xilinx.com
313
Invalid Bitstreams
An invalid bitstream can begin but not complete configuration if a proper sync word and
configuration commands are found. The device will not start up due to the failure of the
CRC check, but invalid configuration can cause an increase in current until cleared.
Therefore, caution must be used when programming or erasing nonvolatile memory. If
possible, the bitstream should be programmed in reverse so that the sync word is the last
to be programmed. Similarly, when erasing the memory, the sector/page that contains the
sync word must be erased first. These precautions ensure that the FPGA does not read the
sync word, enter a configuration state, and attempt to load an invalid bitstream. For
MultiBoot applications, a data integrity check should be implemented in the Golden image
on the MultiBoot image before triggering the MultiBoot event.
314
www.xilinx.com
checking of all configuration memory locations. Extended Spartan-3A family FPGAs offer
this capability. The configuration CRC checker can be enabled so that it continues to
monitor the FPGA bitstream after configuration.
Overview
Figure 16-1, page 315 provides a conceptual overview of the post-configuration CRC
checker circuit.
Block RAM
18K
Block
RAM
18K
Block
RAM
SLICEM
SLICEL
SLICEM
LUT
Logic LUT
LUTRAM
SRL16
LUTRAM
SRL16
LUT
Logic LUT
LUTRAM
SRL16
LUT
SLICEM
SLICEL
LUT
LUTRAM
SRL16
FPGA Configuration
LUT
18K
Block
RAM
18K
Block
RAM
SLICEL
SLICEM
LUT
LUTRAM
SRL16
LUT
Logic LUT
LUTRAM
SRL16
Logic LUT
LUTRAM
SRL16
LUT
Logic LUT
LUTRAM
SRL16
SLICEL
Logic
LUT
Logic
Logic
LUT
Logic
LUT
glutmask:Yes
ENABLE
POST_CRC
Cyclic Redundancy
Checker (CRC)
Internal
Oscillator
Calculated CRC
POST_CRC_FREQ
Expected CRC
The internal oscillator is the most
common clock source. However,
see Clock Source for additional
information.
VCCO_2
Open-drain
output
INIT_B
Figure 16-1:
If the POST_CRC=ENABLE configuration constraint is set, then the CRC checker circuit
continuously scans the FPGA bitstream, calculates a resulting CRC value, then compares
this value against a previously calculated, expected CRC value. If there is a difference
between the two CRC check values, then the CRC checker flags the error by driving the
FPGAs INIT_B pin Low.
The calculated CRC value changes if any unmasked bit, in any location, changes for any
reason, including SEU events. The FPGA application will modify some locations during
www.xilinx.com
315
the course of normal operation. Consequently, all writable bits, such as flip-flops, latches,
and block RAM are automatically excluded from the CRC calculation. Any write
operations to these locations would otherwise result in a different calculated CRC value
and a subsequent CRC error. Similarly, the look-up tables (LUTs) within the SLICEM
logic slices in each Configurable Logic Block (CLB) also potentially contain writable
functions, such as distributed RAM or SRL16 shift registers.
Consequently, by default, all LUTs in all SLICEM logic slices are excluded from the
calculated CRC value. However, if all the LUTs in the FPGA application are only used for
logic, that is, there is no distributed RAM or SRL16 shift registers in the design, then the
SLICEM LUTs can be included in the calculation by setting the glutmask:No bitstream
option. See the ISE software project summary report to determine if the design uses any
distributed RAM or SRL16 shift registers.
Block RAM is excluded from the CRC calculation because a change in the RAM content
would have a subsequent change in the CRC result. Byte-, half-word-, or word-level
changes are easily detected using the available parity bits provided as part of the block
RAM function. See Techniques to Check Distributed and Block RAM Contents, page 319
for more information.
The configuration controller receives a valid synchronization word, which can occur if
the FPGA is being reconfigured or from a MultiBoot operation.
There is an active configuration operation via the JTAG port, or the Mode pins are set
to JTAG mode.
If enabled in the bitstream, the CRC checker will reset and restart at the end of the
configuration event or when the FPGA awakens from Suspend mode.
Clock Source
If enabled, the post-configuration CRC checker is clocked by one of three sources,
depending on the specific FPGA application, ordered from least-likely to most-likely.
If the bitstream option Persist:Yes is selected and the FPGA is configured using one of
the Slave configuration modes, then the post-configuration CRC checker is clocked
using the FPGAs CCLK input pin.
If the Internal Configuration Access Port (ICAP) feature is enabled, the postconfiguration CRC checker is clocked by the CLK input on the ICAP design primitive.
316
www.xilinx.com
12 MHz, the CRC check will take 0.0364 seconds. The XC3S1400A has 4,755,296 bits;
running at 12 MHz, the CRC check will take 0.39627 seconds.
The post-configuration CRC checker is clocked by one of three possible clock sources
as described in Clock Source. Be sure that the application or system is providing the
required clock input. In most applications, the CRC checker uses the FPGAs internal
oscillator as the clock source. Set the oscillator frequency using the POST_CRC_FREQ
configuration constraint. By default, the oscillator is set at 1, which roughly equates to
a 1 MHz clock. See Table 16-2 for available options.
If any look-up tables (LUTs) in the FPGA application are used as distributed RAM or
SRL16 shift registers, then leave the glutmask bitstream generator option at its default
value.
www.xilinx.com
317
CONFIG Constraints
Table 16-1 lists the available CONFIG constraints that control the post-configuration CRC
feature.
Table 16-1:
CONFIG Constraint
POST_CRC
POST_CRC_FREQ
Setting
Description
DISABLE
ENABLE
1, 3, 6, 7, 8, 10, 12,
13, 17, 22, 25, 27,
33, 44, 50, 100
POST_CRC_ACTION CONTINUE
HALT
BitGen Option
post_crc_en
318
Setting
(default)
Description
No
Yes
www.xilinx.com
Table 16-2:
BitGen Option
post_crc_freq
1, 3, 6, 7, 8, 10, 12,
13, 17, 22, 25, 27,
33, 44, 50, 100
post_crc_keep
Description
Sets the clock frequency used for the postconfiguration CRC checker. The available options are
the same as for the ConfigRate bitstream option.
No
Yes
Yes
No
glutmask
Design Considerations
While all flip-flop and latch values are automatically ignored, the initial values for each
flip-flop and latch are included in the CRC calculation. Consequently, do not issue a
Readback CAPTURE operation when the post-configuration CRC feature is enabled. The
CAPTURE operation captures the current flip-flop and latch values and writes them back
to the memory cells that originally contained the initial values.
www.xilinx.com
319
RAMB16_S9
DI[7:0]
DO[7:0]
8
DIP
Parity Generator
Figure 16-3:
ERROR
DOP
Parity Checker
UG332_c17_02_092006
Although Figure 16-3 shows a block RAM example, the same technique applies for
distributed RAM.
Similarly, both block RAM and distributed RAM support dual-port read operations. The
parity checker function can be moved to the second read port so that it can continuously
monitor the RAM contents without affecting normal operation. Similarly, if the block RAM
contents are static, if used to store PicoBlaze processor code as an example, then FPGA
logic can use the second block RAM port and continuously calculate a CRC signature for
the block RAM contents. If the signature changes between subsequent checking
operations, then the circuit flags an error. This is similar to the method used to
continuously check the FPGA configuration memory cells.
For more details on single-event upsets in FPGAs, see UG116, Device Reliability Report and
the Xilinx Reliability Application Notes website at:
http://www.xilinx.com/support/documentation/andesignoptimiz_reliability.htm
320
www.xilinx.com
Chapter 17
Configuration Details
This chapter provides more extensive details on the configuration logic in the Extended
Spartan-3A family, including the Spartan-3A, Spartan-3AN, and Spartan-3A DSP
platforms. The Spartan-3E family is similar, and details on the Spartan-3 family can be
found in XAPP452.
All user-programmable features inside Extended Spartan-3A devices are controlled by
volatile memory cells that must be configured at power-up. These memory cells are
collectively known as configuration memory. They define the LUT equations, signal routing,
IOB voltage standards, and all other aspects of the user design.
To program configuration memory, instructions for the configuration control logic and
data for the configuration memory are provided in the form of a bitstream. The bitstream
is automatically generated by the Xilinx ISE design tools and is delivered to the device
through one of the configuration interfaces.
The composition of the bitstream is largely independent of the configuration method. A
bitstream for the Slave Parallel (SelectMAP) interface can look exactly the same as a
bitstream for the Master Serial interface. Certain configuration operations, however, such
as readback, can only be performed through the SelectMAP and JTAG interfaces.
The user generally does not need to know the details of the configuration format and
commands. However, this detail can be useful for debugging purposes. After initial
configuration, the user can send configuration commands to the device through the
permanent JTAG interface, through the SelectMAP port if Persist is selected, or through the
Internal Configuration Access Port if ICAP_SPARTAN3A is included in the design. The
easiest method for sending configuration commands using the JTAG interface is with an
SVF file (see XAPP503 SVF and XSVF File Formats for Xilinx Devices).
www.xilinx.com
321
Extended Spartan-3A frame counts and configuration sizes are shown in Table 17-1.
Depending on bitstream generator (BitGen) options, additional overhead exists in the
configuration bitstream. The exact bitstream length is available in the .rbt (rawbits) file
created by using the "-b" option with BitGen or selecting "Create ASCII Configuration File"
in the Generate Programming File options popup in the ISE software. Bitstream length
(words) are roughly equal to the configuration array size (words) plus configuration
overhead (words). Bitstream length (bits) are roughly equal to the bitstream length in
words times 16.
Table 17-1:
Frame Length
(words) (1)
Configuration Array
Size (words) (2)
Configuration
Overhead (words) (3)
XC3S50A/AN
367
74
147,600
174
XC3S200A/AN
540
138
243,048
238
XC3S400A/AN
692
170
381,792
270
Device
XC3S700A/AN
844
202
552,352
302
XC3S1400A/AN
996
298
726,520
398
XC3SD1800A
1414
362
958,416
462
XC3SD3400A
1718
426
1,259,520
526
Notes:
1. All Extended Spartan-3A family configuration frames consist of 16-bit words.
2. Configuration array size equals the number of configuration frames times the number of words per
frame.
3. Configuration overhead consists of commands in the bitstream that are needed to perform
configuration, but do not themselves program any memory cells. Configuration overhead contributes
to the overall bitstream size.
Packet Types
The FPGA bitstream consists of two packet types: Type 1 and Type 2. These packet types
and their usage are described below.
Type 1 Packet
The Type 1 packet is used for register writes and reads. Only 6 register address bits are
used in Extended Spartan-3A FPGAs. The header section is always a 16-bit word.
Following the Type 1 packet header is the Type 1 Data section, which contains the number
of 16-bit words specified by the word count portion of the header. See Table 17-2,
Table 17-3, and Table 17-4.
322
www.xilinx.com
Table 17-2:
Header Type
Opcode
Register Address
Word Count
[15:13]
[12:11]
[10:5]
[4:0]
001
xx
xxxxxx
xxxxx
Table 17-3:
[15:0]
Word 1
xxxxxxxxxxxxxxxx
...
xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx
Table 17-4:
Opcode Format
Opcode
Function
00
NOOP
01
Read
10
Write
11
Reserved
Type 2 Packet
The Type 2 packet, which must follow a Type 1 packet, is used to write long blocks. The
header section is always a 16-bit word. See Table 17-5.
Following the Type 2 packet header is the Type 2 Word count section, which contains two
16-bit words with the MSB in the first word. See Table 17-6 and Table 17-7.
Following the Type 2 Word count section is the Type 2 Data section, which contains the
number of 16-bit words specified by the Word count section. See Table 17-8.
Table 17-5:
Header Type
Opcode
Register Address
Reserved
[15:13]
[12:11]
[10:5]
[4:0]
010
xx
xxxxx
RRRRR
Notes:
1. R means the bit is not used and is reserved for future use.
Table 17-6:
Word Count 1
[31:16]
0000xxxxxxxxxxxx
www.xilinx.com
323
Table 17-7:
Word Count 2
[15:0]
xxxxxxxxxxxxxxxx
Table 17-8:
[15:0]
Word 1
xxxxxxxxxxxxxxxx
...
xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx
Configuration Registers
All bitstream commands are executed by reading or writing to the configuration registers.
Table 17-9 summarizes these registers. A detailed explanation of selected registers follows.
Table 17-9: Configuration Registers
Reg. Name
Description
Read/Write
00 0000
FAR_MAJ
Write
00 0001
FAR_MIN
Write
00 0010
FDRI
Write
00 0011
CRC
FDRO
Read
00 0100
CMD
Read/Write
00 0101
CTL
Read/Write
00 0110
MASK
Read/Write
00 0111
Masking Register for CTL (1 allows bit to be written default is all 0s)
STAT
Read
00 1000
LOUT
Write
00 1001
COR1
Read/Write
00 1010
COR2
Read/Write
00 1011
PWRDN_REG
Read/Write
00 1100
Write
00 1101
Read/Write
00 1110
FLR
IDCODE
324
Read/Write Address
www.xilinx.com
Read/Write Address
Description
SNOWPLOW
Write
00 1111
HC_OPT_REG
Read/Write
01 0000
01 0001
Write
01 0010
GENERAL1
Read/Write
01 0011
GENERAL2
Read/Write
01 0100
MODE_REG
Read/Write
01 0101
PU_GWE
Write
01 0110
PU_GTS
Write
01 0111
MFWR
Write
01 1000
CCLK_FREQ
Write
01 1001
SEU_OPT
Write
01 1010
EXP_SIGN
Read/Write
01 1011
Read
01 1100
reserved
CSBO
RDBK_SIGN
Description
NULL
00000
Null Command
WCFG
00001
MFWR
00010
LFRM
00011
RCFG
00100
www.xilinx.com
325
Table 17-10:
Command
Description
START
00101
RCAP
00110
Reset Capture: resets the CAPTURE signal after performing readbackcapture in single-shot mode (see Readback Capture in Chapter 18).
RCRC
00111
AGHIGH
01000
reserved
01001
GRESTORE
01010
SHUTDOWN
01011
GCAPTURE
01100
Pulse GCAPTURE: loads the readback capture cells with the current
register states (see Readback Capture in Chapter 18).
DESYNC
01101
REBOOT
01110
reserved
01111
Description
Enable MultiBoot mode.
EN_MBOOT
0:
1:
Reserved
Security Level.
SBITS
326
5:4
www.xilinx.com
Table 17-11:
Name
Bit Index
Description
PERSIST
0:
1:
No (default)
Yes
0:
1:
Reserved
GTS_USER_B
2.
3.
Write two words to FAR_MAJ (update FAR_MAJ with first data and FAR_MIN with
second data)
Table 17-12:
Address Type
Bit Index
Description
FAR_MAJ Register
Reserved
15:13
Block Type
12:10
Reserved
9:8
Major Address
7:0
Reserved
15:8
Minor Address
7:0
FAR_MIN Register
www.xilinx.com
327
Bit Index
Description
Configuration Watchdog Timer expired.
SYNC_TIMEOUT
15
SEU_ERR
14
0:
1:
DONE
13
INIT
12
0:
1:
Default
Failed to find SYNC word before counter time out
MODE
11:9
VSEL
8:6
GHIGH_B
GWE
GTS_CFG_B
GHIGH_B asserted
GHIGH_B deasserted
DCM_LOCK
ID_ERROR
CRC_ERROR
0:
1:
No ID_ERROR
ID_ERROR
0:
1:
No CRC error
CRC error
Name
Bit
Index
Description
Default
COR1
0:
DRIVE_AWAKE
15
1:
Reserved
328
14:5
www.xilinx.com
0111111000
Table 17-14:
Name
Bit
Index
Description
CRC enabled.
CRC disabled.
0:
1:
DONE_PIPE
DRIVE_DONE
0:
1:
CRC_BYPASS
1:0
Default
0
0
0
00
00: CCLK
01: UserClk (per connection on the
STARTUP_SPARTAN3A block)
1x: JTAGClk
COR2
Do not fall back
On CRC error, fall back and retry first
configuration file
RESET_ON_ERR
15
0:
1:
Reserved
14
13
0:
1:
BPI_DIV8
12
SINGLE
1: Readback is single-shot.
The RCAP instruction must be loaded into the CMD
register between successive readbacks.
Startup cycle to release the DONE pin.
DONE_CYCLE
11:9
100
www.xilinx.com
329
Table 17-14:
Name
Description
Startup cycle to stall in until DCMs lock.
LOCK_CYCLE
8:6
5:3
2:0
101
GWE_CYCLE
111
GTS_CYCLE
Default
110
330
Name
Bit Index
Description
Default
WAKE_DELAY2
13:9
00100
WAKE_DELAY1
8:6
010
FILTER_B
0:
1:
EN_PGSR
0:
1:
Unused
EN_PWRDN
0
0:
1:
Suspend disabled.
Suspend enabled.
www.xilinx.com
Bitstream Composition
Table 17-15:
Name
Bit Index
EN_PORB
KEEP_SCLK
Description
Default
0:
1:
Name
Bit Index
Description
Default
BRAM_SKIP
0:
1:
TWO_ROUND
0:
1:
1 round of housecleaning.
2 rounds of housecleaning.
HC_CYCLE
3:0
1111
2.
3.
4.
5.
6.
7.
8.
Bitstream Composition
Configuration can begin after the device is powered and initialization has finished, as
indicated by the INIT pin being released. After initialization, the packet processor ignores
all data presented on the configuration interface until it receives the synchronization word.
www.xilinx.com
331
After synchronization, the packet processor waits for a valid packet header to begin the
configuration process.
Configuration Sequence
Configuration
Data (hex)
332
Explanation
FFFF
Dummy word
AA99
Sync word
30A1
0007
RCRC command
3321
05BE
CCLK frequency
31A1
0XXX
Frame length
3141
3F00
3161
09EE
31C2
XXXX
MSB Device_ID
XXXX
LSB Device_ID
30E1
0000
Data word 0
30C1
0001
Data word 0
3181
0881
Data word 0
3201
001F
Data word 0
32C1
0006
Data word 0
32E1
0005
Data word 0
32A1
www.xilinx.com
Bitstream Composition
Table 17-17:
Configuration
Data (hex)
Explanation
000E
Data word 0
3261
0000
Data word 0
3281
0000
Data word 0
3301
3FF0
Data word 0
3362
0000
Data word 0
0000
Data word 1
3022
0XXX
FAR_MAJ
00XX
FAR_MIN
30A1
0001
WCFG command
5062
0XXX
XXXX
XXXX
Data 1
...
...
XXXX
3001
XXXX
Data word 0
30A1
000A
GRESTORE command
30A1
0003
LFRM command
2000
Type 1 NOOP
...
Type 1 NOOPs
2000
Type 1 NOOP
30A1
0005
START command
30C1
0001
Data word 0
3001
www.xilinx.com
333
Table 17-17:
Configuration
Data (hex)
Explanation
XXXX
Data word 0
30A1
000D
DESYNC command
2000
2000
2000
2000
2000
Type 1 NOOP
2000
2000
2000
334
www.xilinx.com
Chapter 18
Readback
This chapter provides more extensive details on the readback logic in the Extended
Spartan-3A family, including the Spartan-3A, Spartan-3AN, and Spartan-3A DSP
platforms. The Spartan-3E family is similar, and details on the Spartan-3 family can be
found in XAPP452.
Spartan-3, Spartan-3E, and Extended Spartan-3A devices allow users to read back the
configuration memory through the SelectMAP (slave parallel) or JTAG (IEEE 1149.1
boundary scan) interfaces. There are two styles of readback: Readback Verify and
Readback Capture. During Readback Verify, the user reads all configuration memory cells,
including the current values on all user memory elements (distributed LUT RAM, SRL16
shift registers, and block RAM). Readback Capture is a superset of Readback Verifyin
addition to reading all configuration memory cells, the current state of all internal CLB and
IOB registers is read, and is useful for design debugging.
To read configuration memory, users must send a sequence of commands to the device to
initiate the readback procedure; once initiated the device dumps the contents of its
configuration memory to the SelectMAP or JTAG interface. The configuration memory
read procedure sections for SelectMAP, IEEE 1149.1 JTAG, and IEEE 1532 JTAG describe
the steps for reading configuration memory.
Users can send the readback command sequence from a custom microprocessor, CPLD, or
FPGA-based system, or use iMPACT to perform JTAG-based readback verify. iMPACT,
the device programming software provided with the Xilinx Integrated Software
Environment (ISE software), can perform all readback and comparison functions and
report to the user whether there were any configuration errors. iMPACT cannot perform
capture operations, although Readback Capture is seldom used for design debugging
because the ChipScope Pro tools ILA core, sold separately through the Xilinx website,
provides superior design debugging functionality in a user-friendly interface.
Once configuration memory has been read from the device, the next step is to determine if
there are any errors by comparing the readback bitstream to the configuration bitstream.
The Verifying Readback Data section explains how this is done.
www.xilinx.com
335
Deassert CSI_B.
2.
Toggle RDWR_B.
RDWR_B = 0: Write control
RDWR_B = 1: Read control
3.
Assert CSI_B.
4.
CSI_B
RDWR_B
DOUT (BUSY)
WRITE
DATA[0:7]
Byte 0
READ
Byte n
Byte 0
Byte n
CCLK
UG332_48_030409
Figure 18-1:
336
www.xilinx.com
The Extended Spartan-3A family has a DOUT pin which operates like the BUSY pin in
earlier families during readback. The BUSY signal goes Low to indicate when the DATA
bus contains valid readback data. However, it is not necessary to monitor BUSY since the
readback data is always valid three CCLK cycles after CSI_B is asserted.
Table 18-1:
Step
SelectMAP Port
Direction
Configuration
Data
Write
AA99
Sync Word
Write
2901
2000
3
Write
NOOP
2000
NOOP
SSSS
30A1
000D
Desync command
2000
NOOP
2000
NOOP
Read
Write
Write
Explanation
The user must change the SelectMAP interface from write to read control between steps 3
and 4, and back to write control after step 4, as illustrated in Figure 18-2.
www.xilinx.com
337
CSI_B
RDWR_B
DOUT (BUSY)
WRITE
DATA[0:7]
AA
READ
99
SS
SS
SS
SS
CCLK
UG332_49_030409
Figure 18-2:
To read registers other than STAT, the address specified in the Type 1 packet header in Step
2 of Table 18-1 should be modified and the word count changed if necessary. Reading from
the FDRO register is a special case that is described in the next section.
2.
3.
4.
5.
6.
Write four NOOP instructions to ensure the shutdown sequence has completed.
DONE goes Low during the shutdown sequence.
7.
8.
9.
Write the read FDRO register packet header to the device. The FDRO read length is
given by:
FDRO Read Length = (words per frame) x (frames to read + 1) + 1
One extra frame is read to account for the frame buffer. The frame buffer produces one
dummy frame at the beginning of the read and one at the end. Also, one extra word is
read in SelectMAP mode.
10. Write two dummy words to the device to flush the packet buffer.
11. Read the FDRO register from the SelectMAP interface. The FDRO read length is the
same as in step 9 above.
12. Write one NOOP instruction.
13. Write the START command.
14. Write the RCRC command.
15. Write the DESYNC command.
338
www.xilinx.com
16. Write at least 32 bits of NOOP commands to flush the packet buffer. Continue sending
CCLK pulses until DONE goes High.
Table 18-2 shows the readback command sequence.
Table 18-2:
Step
Configuration Data
Write
AA99
Sync word
Write
2000
30A1
3
Write
0007
RCRC command
2000
2000
30A1
000B
SHUTDOWN command
2000
2000
2000
2000
30A1
0004
RCFG command
3022
0000
0000
2880
XXXX
2000
2000
0000
10
11
Write
Write
Write
Write
Write
Write
Write
Read
12
Write
13
Write
14
...
0000
2000
30A1
0005
START command
30A1
0007
RCRC command
Write
Explanation
www.xilinx.com
339
Table 18-2:
Step
15
Write
16
Configuration Data
Explanation
30A1
000D
DESYNC command
2000
2000
Write
Step
TMS
340
TDI
# of
Clocks
(TCK)
Description
00101
(CFG_IN)
00100
(CFG_OUT)
10
11
www.xilinx.com
2.
Shift the CFG_IN instruction into the JTAG Instruction Register through the Shift-IR
state. The LSB of the CFG_IN instruction is shifted first; the MSB is shifted while
moving the TAP controller out of the SHIFT-IR state.
3.
Shift packet write commands into the CFG_IN register through the Shift-DR state:
a.
b.
c.
d.
The MSB of all configuration packets sent through the CFG_IN register must be sent
first. The LSB is shifted while moving the TAP controller out of the SHIFT-DR state.
4.
Shift the CFG_OUT instruction into the JTAG Instruction Register through the Shift-IR
state. The LSB of the CFG_OUT instruction is shifted first; the MSB is shifted while
moving the TAP controller out of the SHIFT-IR state.
5.
Shift 16 bits out of the Status register through the Shift-DR state.
6.
Table 18-4:
TMS
# of
Clocks
(TCK)
00101
(CFG_IN)
Step
Description
www.xilinx.com
341
Table 18-4:
Step
TDI
0xAA99
0x2000
0x2901
0x2000
0x2000
79
00100
(CFG_OUT)
0xSSSS
31
Shift the last bit of the STAT register out of the CFG_OUT
data register while exiting SHIFT-DR.
a:
b:
c:
d:
TMS
# of
Clocks
(TCK)
Description
The packets shifted in to the JTAG CFG_IN register are identical to the packets shifted in
through the SelectMAP interface when reading the STAT register through SelectMAP.
2.
Shift the CFG_IN instruction into the JTAG Instruction Register. The LSB of the
CFG_IN instruction is shifted first; the MSB is shifted while moving the TAP controller
out of the SHIFT-IR state.
3.
Shift packet write commands into the CFG_IN register through the Shift-DR state:
a.
b.
c.
342
www.xilinx.com
5.
Move into the RTI state; remain there for 12 TCK cycles to complete the Shutdown
sequence. The DONE pin goes Low during the Shutdown sequence.
6.
7.
Move to the Shift-DR state and shift packet write commands into the CFG_IN register:
a.
b.
c.
d.
e.
f.
g.
h.
i.
j.
The MSB of all configuration packets sent through the CFG_IN register must be sent
first. The LSB is shifted while moving the TAP controller out of the SHIFT-DR state.
8.
Shift the CFG_OUT instruction into the JTAG Instruction Register through the
Shift-DR state. The LSB of the CFG_OUT instruction is shifted first; the MSB is shifted
while moving the TAP controller out of the SHIFT-IR state.
9.
Shift frame data from the FDRO register through the Shift-DR state.
TMS
# of Clocks
(TCK)
00101
Step
Description
www.xilinx.com
343
Table 18-5:
Step
TDI
a:
b:
c:
d:
0xFFFF
0xAA99
0x2000
0x30A1
0x0007
e: 0x2000
0x2000
111
01101
Move to RTI.
12
00101
191
344
# of Clocks
(TCK)
TMS
Description
a:
b:
c:
d:
e:
f:
g:
0xFFFF
0xAA99
0x2000
0x30A1
0x0004
0x3022
0x0000
0x0000
h: 0x2880
i: 0xXXXX
j: 0x2000
0x2000
www.xilinx.com
Table 18-5:
TMS
# of Clocks
(TCK)
00100
(CFG_OUT)
number of
readback
bits 1
Step
Description
Shift the first 5 bits of the CFG_OUT
instruction, LSB first.
10
www.xilinx.com
345
START
Load ISC_ENABLE
Load ISC_READ
Load 5'b00000
RTI minimum
12 TCK cycles
RTI
1 TCK cycle
Shift 37 bits of
readback data +
status
Load ISC_PROGRAM
N
Load 32 bits of
bitstream data
RTI
1 TCK cycle
N
EO
bitstream
Y
A
EO
Data
Y
Load ISC_PROGRAM
Load Reset CRC
command
Load ISC_DISABLE
RTI minimum
12 TCK cycles
Go to Test Logic Reset
STOP
UG071_50_081404
Figure 18-3:
Readback Files
File
Extension
File
Type
BitGen
Setting
Description
.rba
ASCII
-b and -g
Readback
.rbb
Binary
-g
Readback
.rbd
ASCII
-g
Readback
-m
.msk
346
Binary
www.xilinx.com
Table 18-6:
File
Extension
File
Type
.msd
.ll
ASCII
ASCII
BitGen
Setting
Description
-g
readback
An ASCII file that contains only mask bits. The first bit in
the .msd file corresponds to the first bit in the .rbd file. Pad
data in the actual readback stream are accounted for in
the .msd and .rbd files. If a mask bit is 0, that bit should be
verified against the bit stream data. If a mask bit is 1, that bit
should not be verified.
-l
The design.rba and design.rbb files combine readback commands with expected
readback data and the .rbd file contains only expected readback data. Systems that use
an .rbd file for readback must store readback commands elsewhere. The actual readback
data must be masked against an .msk or .msd mask file, as certain bits in the expected
readback stream in the .rba, .rbb, and .rbd files should be ignored.
The readback command set files do not indicate when users must change the SelectMAP or
JTAG interface from write to read control; the user must handle this based on the Readback
Command Sequences described above.
The readback data stream contains configuration frame data that are preceded by one
frame of pad data, as described in Configuration Memory Read Procedure (SelectMAP).
The readback stream does not contain any of the commands or packet information found
in the configuration bitstream and no CRC calculation is performed during readback. The
readback data stream is shown in Figure 18-4.
Readback Data
1 frame
Pad Frame
Total
number
device
frames
Frame Data
UG071_51_092807
Figure 18-4:
The readback data stream is verified by comparing it to the original configuration frame
data that were programmed into the device. Certain bits within the readback data stream
must not be compared, because these can correspond to user memory or null memory
locations. The location of don't care bits in the readback data stream is given by the mask
files, the .msk and .msd files. These files have different formats although both convey
essentially the same information. Once readback data have been obtained from the device,
either of the following comparison procedures can be used:
1.
Compare readback data to the .rbd golden readback file. Mask by using the .msd file.
www.xilinx.com
347
The simplest way to verify the readback data stream is to compare it to the .rbd golden
readback file, masking readback bits with the .msd file. This approach is simple
because there is a 1:1 correspondence between the start of the readback data stream
and the start of the .rbd and .msd files, making the task of aligning readback, mask,
and expected data easier. See Figure 18-5.
The .rbd and .msd files contain an ASCII representation of the readback and mask
data along with a file header that lists the file name, etc. This header information
should be ignored or deleted. The ASCII 1s and 0s in the .rbd and .msd files
correspond to the binary readback data from the device. Take care to interpret these
files as text, not binary sources. Users can convert the .rbd and .msd files to a binary
format using a script or text editor, to simplify the verify procedure for some systems
and to reduce the size of the files by a factor of eight.
.msd
File
.rbd
File
Readback
Data Stream
File Header
File Header
1 frame
Pad Frame
Pad Frame
Pad Frame
Total
number
device
frames
Frame Data
Frame Data
Mask
Frame Data
UG071_52_073007
Figure 18-5:
The drawback to this approach is that in addition to storing the initial configuration
bitstream and the .msd file, the golden .rbd file must be stored somewhere, increasing
the overall storage requirement.
2.
Compare readback data to the configuration .bit file, mask using the .msk file.
Another approach for verifying readback data is to compare the readback data stream
to the frame data within the FDRI write in the original configuration bitstream,
masking readback bits with the .msk file.
After sending readback commands to the device, comparison begins by aligning the
beginning of the readback frame data to the beginning of the FDRI write in the .bit
and .msk files. The comparison ends when the end of the FDRI write is reached. See
Figure 18-6.
This approach requires the least in-system storage space, because only the .bit, .msk,
and readback commands must be stored.
348
www.xilinx.com
Readback
Data Stream
1 frame
Total
number
device
frames
.msk
File
.bit
File
File Header
File Header
Commands
Commands
Frame Data
Mask
Frame Data
Pad Frame
Pad Frame
Commands
Commands
Pad Frame
Frame Data
UG071 53 073007
Figure 18-6:
The .rba and .rbb files contain expected readback data along with readback
command sets. They are intended for use with the .msk file.
www.xilinx.com
349
Readback Capture
The configuration memory readback command sequence is identical for both Readback
Verify and Readback Capture. However, the Capture sequence requires an additional step
to sample internal register values.
Users can sample CLB and IOB registers by instantiating the CAPTURE_SPARTAN3A
primitive in their design (Figure 18-7) and asserting the CAP input on that primitive while
the design is operating. On the next rising clock edge on the CAPTURE_SPARTAN3A CLK
input, the internal GRDBK signal is asserted, storing all CLB and IOB register values into
configuration memory cells. These values can then be read out of the device along with the
IOB and CLB configuration columns by reading configuration memory through the
readback process. Register values are stored in the same memory cell that programs the
register's initial state configuration. Therefore, sending the GRESTORE command to the
configuration logic after the Capture sequence can cause registers to return to an
unintended state.
Alternatively, the GRDBK signal can be asserted by writing the GCAPTURE command to
the CMD register. This command asserts the GRDBK signal for two CCLK or TCK cycles,
depending on the Startup clock setting.
Trigger with
external or
internal signal
CAPTURE_SPARTAN3A
CAP
CLK
Synchronize
to external or
internal clock
Figure 18-7:
Table 18-7:
UG332_54_xxxxx
Capture Signals
Signal
Description
Access
GCAPTURE
GRESTORE
If the CAP signal is left asserted over multiple clock cycles, the Capture cell is updated
with the new register value on each rising clock edge. To limit the capture operation to the
first rising clock edge, the user can add the ONESHOT attribute to the
CAPTURE_SPARTAN3A primitive. More information on the ONESHOT attribute can be
found in the Constraints Guide.
Once the configuration memory frames have been read out of the device, the user can pick
the captured register values out of the readback data stream. The capture bit locations are
given in the logic allocation file (design.ll) as described in Figure 18-8.
350
www.xilinx.com
Readback Capture
UG071_55_081404
Figure 18-8:
Figure 18-8 shows a snippet from a logic allocation file for an example design. The line
from the header comments explaining the line format has been moved to the start of the bit
offset data for clarity. The <offset> field gives the absolute bit offset from the beginning of
the readback frame data. The <frame address> field gives the frame address that the
capture bit is located in, and the <frame offset> field gives the bit offset from the start of the
frame. The <information> field gives the mapping between the bit and the user design
for example, the DIR register (Figure 18-8) that is located in Slice X8Y15 is located at bit
offset 100790.
Note that captured flip-flop values, along with distributed RAM and SRL16 values, are
stored in their inverted sense.
www.xilinx.com
351
352
www.xilinx.com