Xapp 126
Xapp 126
XAPP 126 June 14, 1999 (Version 1.1) Application Note by Ashok Chotai
Summary
This application note describes various methods to configure Spartan series FPGAs. Each configuration method is
described in detail. Information on necessary software programs to run with input files required, output files produced,
download cables used, and other hardware necessary to accomplish the task is discussed. This application note targets
users who are new to Xilinx devices and Alliance/Foundation series software tools, and is intended to make the configuration
and debugging flows easy to understand.
Xilinx Families
Spartan and SpartanXL
Introduction Figure 1). The program can also produce an LL file which is
used for debugging the device. The program is a part of the
A design is entered as a schematic or high level HDL implementation process. Additionally, the BitGen program
description and then implemented (translated, partitioned,
has the following options:
placed and routed) into a Spartan series FPGA using Xilinx
software tools. As a result, a bitstream is produced which is Configuration Options: configuration clock rate, RBT and
used to configure the FPGA. Xilinx FPGAs are built with LL file generation and Cyclic Redundancy Check (CRC)
static RAM and hence they need a data source such as a error check.
PROM or other intelligent interface to load the configuration I/O Programmability: TTL or CMOS thresholds for the
data upon power-up. inputs and outputs (Spartan family only), pull-up and
Configuration is the process of loading the bitstream into pull-down control for the dedicated configuration pins
one or more FPGAs to define the functional operation of (TDO, DONE, M0 and M1), Power Down Control (Spartan
the internal blocks (function look-up table, flip-flop, multi- XL family only) and 5V Tolerant I/Os (SpartanXL family
plexer, buffers, pull up/down, slew rate etc.) and their inter- only).
connections (pass transistors). Each configuration bit for Start-up Timing Options: User clock or configuration clock
the FPGA defines the state of a static memory cell that con- selection, control of the sequence of output events (DONE
trols either an internal block or its interconnections. The going High, user I/Os going active, and release of global
device can be configured through standard configuration Set/Reset).
pins or through the boundary scan (JTAG) interface.
Readback Options: User clock or configuration clock selec-
Xilinx Alliance/Foundation series software programs, the tion, bitstream verification and in-circuit debugging control.
files required by these programs, the download cables
used, and other hardware necessary to accomplish the Boundary Scan Options: Control of boundary scan based
configuration and debugging task are discussed in the fol- configuration and bitstream readback.
lowing section. Other Options: Tie unused internal nodes.
Software Programs The program can be run as a stand-alone tool from the
UNIX/DOS command prompt or by running the Configure
There are five different software programs that may be
step in the Flow Engine of the Xilinx Design Manager
required to run the configuration flow. They are: BitGen,
Graphical User Interface. For information on the
PROMGen, JTAG Programmer, Hardware Debugger and
command-line mode usage and options, refer to the
the HW-130 Programmer software. The first four programs
BitGen chapter of the Development System Reference
are part of the Alliance/Foundation series software and the
Guide. For instructions on graphical mode usage and
last program is a part of the HW-130 Programmer. The user
options, refer to the Implementation Options chapter of
may not need to run all of these programs. These programs
the Design Manager/Flow Engine Reference/User Guide.
are described briefly in this section.
PROMGen (PROM File Formatter)
BitGen (Configure - Flow Engine)
PROMGen formats single or multiple BIT files into a PROM
BitGen is a program that takes a mapped, placed and fully file or a straight HEX file (see Figure 1). The PROM file is
routed NCD design file as its input and produces a configu- used to program the PROM. The HEX file or the PROM file
ration bitstream - a BIT file with a .bit extension (see
Flow Name Designer Goal Program Equipment1 Software Required2 Files Needed
Debug Prototype for a single device • XChecker Cable • Flow Engine BIT and LL
• Hardware Debugger
Any_File Prototype for a single device • XChecker/Parallel • Flow Engine BIT/RBT/PROM file
Cable • Hardware Debugger
JTAG Production/Prototype for • XChecker/Parallel • Flow Engine BIT and BSDL for
single device OR multiple Cable • JTAG Programmer each device
devices in daisy chain using
Boundary Scan interface3
PROM Prototype/Production stage • PROM • Flow Engine PROM file
for single device OR multiple • HW-130/3rd Party • PROM File Formatter
devices in daisy chain PROM Programmer • HW-130/3rd Party
Programmer software
Processor Prototype/Production stage • Microprocessor with • Flow Engine HEX/PROM file
for single device OR multiple memory • PROM File Formatter
devices in daisy chain using • Microprocessor firmware4
Micro-processor
1. The target board which includes the Spartan/XL device(s) must be already present.
2. All the software programs are part of Xilinx Alliance/Foundation series software tools, unless otherwise stated.
3. Boundary-scan (BSCAN) symbol must be instantiated in the design and you must have a separate BIT file for each FPGA
in the chain.
4. Not supplied by Xilinx.
Debug Flow data that was sent to the device and comparing it against
the original bitstream data to ensure that the device is
Debugging involves Readback Verify and Readback Cap-
loaded with the correct data. Readback Capture refers to
ture. Readback Verify consists of reading the programming
BitGen
Configure (Flow Engine)
LL BIT RBT
PROMGen
PROM File Formatter
BSD2
Xilinx HW-130 or 3rd Party
PROM Programmer
reading the internal states (flip flop outputs, CLB outputs, for this task. This method neither requires external storage
IOB outputs and the RAM/ROM bits) of the device to make for configuration data nor an external clock to synchronize
sure the design performs correctly. Note that debug pro- the configuration process. The XChecker cable itself con-
cess does not interfere with the normal operation of the tains static RAM and an internal oscillator circuit for clock
device. To get familiar with the configuration and debugging generation. The FPGA is configured in Slave Serial mode.
flow, use the Watch tutorial on the Xilinx web site. For more information on this mode, refer to the Slave
Serial Mode description under the Configuration and
The Debug Flow is useful when the designer wants to con-
figure and debug the prototype of the design. The Hard- Test section in the Spartan/XL data sheet. The following
ware Debugger software and the XChecker cable are used steps are required to perform the task:
VCC VCC RT RT
READ_DATA GND
CLK DATA GND RD RD
READ_TRIGGER TRIG TRIG
READBACK OBUF OPAD
TRIG RIP CCLK CCLK
Spartan/XL
D/P DONE N.C.
IPAD TDI
IBUF DIN DIN N.C.
TCK
PROG PROGRAM N.C.
TMS
Figure 2: Example of Readback Schematic INIT1 INIT CLKI
N.C.
RST CLKO
Target System
For more information on the READBACK symbol and its
System Clock
description, refer to the Configuration and Test section
Cable Connector 1 Cable Connector 2
in the Spartan/XL data sheet.
Figure 3: XChecker Cable Connections
2. Create EDIF netlist for your design.
NOTE: 1. The INIT pin on the connector is marked as INIT by mistake
3. Implement the design to get the LL and BIT files.
5. Configuration and Debugging using Hardware Debugger
Set the Readback Clock to CCLK and check the field for
“Enable Bitstream Verification and In-Circuit Hardware Configure the device using the Hardware Debugger soft-
Debugging” in the Configuration Options window to use ware. Set the synchronous debug mode, clock options,
the internal clock in the FPGA to synchronize the read- trigger type settings and the signals to display and then
back data and create an LL file for readback. The Hard- perform the device readback and verify operations using
ware Debugger uses this file for the readback operation. the software. For more information on these operations,
Implement the design using Xilinx Foundation/Alliance refer to the Programming a Device or a Daisy Chain
implementation tools to create the bitstream. For more and Debugging a Device chapters in the Hardware
information on implementing the design, refer to Imple- Debugger Reference/User Guide or the online help
mentation Options chapter in the Design Man- which is available in the Hardware Debugger software.
ager/Flow Engine Reference/User Guide. Any_File Flow
4. XChecker Cable Connections
Here, any of the two cables - XChecker or Parallel cable
Make sure the mode pin(s) are set for slave serial mode. can be used to configure the device. The XChecker cable
Although these pins have weak pull-up resistor during must be connected to the serial port of the PC or worksta-
configuration, it is recommended to attach an external tion and the Parallel cable to the parallel port of the PC.
pull-up of 4.7 KΩ to make sure these pins are not float- Also, you can use any of these files: BIT, RBT or any
ing. Connect the cable connectors 1 and 2 to the target PROM file (MCS, TEK, EXO). The flows for these three
system as shown in Figure 3. This setup is used to per- files are described in the next section.
form synchronous debugging where the cable is used to
control the external system clock and the logic states of Using the BIT file
the design. The XChecker cable needs 5V DC power 1. Implement the design to get the BIT file.
which is drawn from the target system. The power supply
For more information, refer to Using the Design Man-
required is 5V DC for the system with Spartan device(s)
ager chapter in the Design Manager/Flow Engine Refer-
and 3.3V DC for the system that contains SpartanXL
ence/User Guide.
device(s). Since the XChecker cable must be powered
only with a 5V supply, a separate 5V supply may be used 2. XChecker/Parallel Cable Connections
for the SpartanXL system or an 3.3V XChecker adapter Make sure the mode pin(s) are set for slave serial mode.
(Order Number: HW-XCH3V) may be used that accepts Although these pins have weak pull-up resistor during
2.9-5.25V DC as input and provides the output stepped configuration, it is recommended to attach an external
up to 5V needed by the cable. pull-up of 4.7 KΩ to make sure these pins are not float-
Power up the board using the DC power supply. Invoke ing. Connect the XChecker cable connector 1 to the tar-
Hardware Debugger from the Design Manager window. get system as shown in Figure 4. The Parallel cable pin
For description of XChecker pin connections, refer to connections are the same as that of the XChecker cable
Tables 4_3 and 4_4 in the Connecting your Cable except that there is no connection to the INIT pin as the
cable does not have it. Power up the board using a 5V
DC supply if it has Spartan device(s) and 3.3V supply if it
has SpartanXL device(s).
Manager window. The program looks for the MCS file by Figure 6: Parallel Cable Connections
default. Optionally, the PROM format files TEK and EXO 3. Configuration
may also be used. Configure the device. For more infor-
mation, refer to the Programming a Device or a Daisy Invoke the JTAG Programmer program in the Design
Chain and Debugging a Device chapters in the Hard- Manager and configure the devices in the chain. For
Here, the PROM is used to store the configuration data for Power up the board using a 5V DC supply if it has Spar-
an FPGA or a daisy chain of FPGAs. tan device(s) and 3.3V DC supply if it has SpartanXL
device(s). Configure the device.
1. Implement the design to get the BIT file.
2. Create the PROM file using PROM File Formatter in the References
Design Manager Data Sheets
For more information, refer to the PROM File Formatter • Spartan/XL data sheet
Reference/User Guide. (http://www.xilinx.com/partinfo/spartan.pdf)
3. Loading the PROM file into a PROM • Spartan/XL series Serial PROMs data sheet
To load the PROM file into a Xilinx serial PROM, use the (http://www.xilinx.com/partinfo/
HW-130 programmer or any third-party PROM program-
• HW-130 Programmer Data Sheet
mer. The byte-wide PROM can be used only for the
Express mode configuration. It can be from any third (http://www.xilinx.com/partinfo/program.pdf)
party PROM manufacturer. For information on program-
mers, refer to the HW-130 Programmer Users Manual or Application Notes
• XAPP017: Boundary Scan in XC4000 and XC5200
3rd party supplied documentation, if you are using a
Series Devices
non-Xilinx programmer.
(http://www.xilinx.com/xapp/xapp017.pdf)
3. Connecting PROM to an FPGA
Select the appropriate configuration mode according to • XAPP098: The Low-Cost Efficient Serial Configuration
the requirements. Connect the PROM to the FPGA by of Spartan FPGAs
(http ://www.xilinx.com/xapp/xapp098.pdf)
looking at corresponding circuit diagram under the Con-
figuration and Test section in Spartan/XL data sheet. • XAPP122: The Express Configuration of SpartanXL
FPGAs
4. Configuration
Power up the board using a 5V DC supply if it has Spar- (http://www.xilinx.com/xapp/xapp122.pdf)
tan device(s) and 3.3V DC power supply if it has Spar- • FPGA Configuration Application Notes
tanXL device(s). Configure the device. (http://support.xilinx.com/apps/config.htm)
Processor Flow Technical Support
Note that this section covers the topic in a very high level • The Configuration Problem Solver
without going into specific technical details. The user is (http://support.xilinx.com/support/techsup/journals/con-
advised to learn more based on the type of processor that fig/cps.htm)
is being used. This method is also described in the applica- • Hardware Debugger Watch Tutorial
tion note XAPP098: The Low-Cost Efficient Serial Configu-
ration of Spartan FPGAs. (http://support.xilinx.com/support/techsup/tutorials)
1. Implement the design to get the BIT file. • Programmer Solutions Technical Tips
2. Create the PROM file using PROM File Formatter in the (http://support.xilinx.com/support/programr/ps.htm)
Design Manager
Online Software Documents
Make sure that you create the file format that is accept- (http://support.xilinx.com/support/sw_manuals/)
able by the intelligent interface. For more information, • Design Manager/Flow Engine Reference/User Guide
refer to the PROM File Formatter Reference/User Guide. • Development System Reference Guide
3. Loading the PROM file • PROM File Formatter Reference/User Guide
• JTAG Programmer User Guide
Load the PROM file into RAM of the processor or any • Hardware Debugger Reference/User Guide
other configuration data storage device you are using. • Hardware User Guide