Design Logic Programable
Design Logic Programable
R
R
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.
© 2008 Xilinx, Inc. All rights reserved.
XILINX, the Xilinx logo, the Brand Window, and other designated brands included herein are trademarks of Xilinx, Inc. All other trademarks
are the property of their respective owners.
Preface
CHAPTER 1: INTRODUCTION
Chapter 1 is an overview of how and where PLDs are used and gives a brief history of
programmable logic devices.
Conventions
Convention Meaning or Use Example
Messages, prompts, and
Courier font program files that the system speed grade: - 100
displays
Literal commands that you enter
Courier bold ngdbuild design_name
in a syntactical statement
Commands that you select from
File → Open
Helvetica bold a menu
Keyboard shortcuts Ctrl+C
Variables in a syntax statement
for which you must supply ngdbuild design_name
values
See the Development System
Italic font References to other manuals Reference Guide for more
information.
If a wire is drawn so that it
Emphasis in text overlaps the pin of a symbol, the
two nets are not connected.
An optional entry or parameter.
However, in bus specifications, ngdbuild [option_name]
Square brackets [ ]
such as bus[7:0], they are design_name
required.
A list of items from which you
Braces { } lowpwr ={on|off}
must choose one or more
Chapter 1
Introduction
The History of Programmable Logic
By the late 1970s, standard logic devices were all the rage, and printed circuit boards were
loaded with them. Then someone asked, “What if we gave designers the ability to
implement different interconnections in a bigger device?” This would allow designers to
integrate many standard logic devices into one part.
To offer the ultimate in design flexibility, Ron Cline from Signetics (which was later
purchased by Philips and then eventually Xilinx) came up with the idea of two
programmable planes. These two planes provided any combination of “AND” and “OR”
gates, as well as sharing of AND terms across multiple ORs.
This architecture was very flexible, but at the time wafer geometries of 10 µm made the
input-to-output delay (or propagation delay) high, which made the devices relatively slow.
The features of the PLA were:
• Two programmable ground planes
• Any combination of ANDs/ORs
• Sharing of AND terms across multiple ORs
• Highest logic density available to user
• High fuse count; slower than PALs
• Programmable logic array
Inputs
A B C
X=A&B#C
Y = A & B # !C
Chapter 1:
MMI (later purchased by AMD) was enlisted as a second source for the PLA array. After
fabrication issues, it was modified to become the programmable array logic (PAL)
architecture by fixing one of the programmable planes.
This new architecture differed from that of the PLA in that one of the programmable planes
was fixed – the OR array. PAL architecture also had the added benefit of faster tPD and less
complex software, but without the flexibility of the PLA structure.
Other architectures followed, such as the PLD. This category of devices is often called
Simple PLD.
• One programmable plane: AND/Fixed OR
• Finite combination of ANDs/ORs
• Medium logic density available to user
• Lower fuse count; faster than PLAs (at the time, fabricated on a 10 μm process)
• Programmable array logic
Inputs
A B C
Outputs have dedicated product terms
X=A&B#C
Y = A & B # !C
Requires 4 pt’s
The architecture had a mesh of horizontal and vertical interconnect tracks. At each junction
was a fuse. With the aid of software tools, designers could select which junctions would
not be connected by “blowing” all unwanted fuses. (This was done by a device
programmer, but more commonly these days is achieved with ISP).
Input pins were connected to the vertical interconnect. The horizontal tracks were
connected to AND-OR gates, also called “product terms”. These in turn connected to
dedicated flip-flops, whose outputs were connected to output pins.
PLDs provided as much as 50 times more gates in a single package than discrete logic
devices! This was a huge improvement, not to mention fewer devices needed in inventory
and a higher reliability over standard logic.
PLD technology has moved on from the early days with companies such as Xilinx
producing ultra-low-power CMOS devices based on flash memory technology. Flash PLDs
provide the ability to program the devices time and time again, electrically programming
and erasing the device. Gone are the days of erasing for more than 20 minutes under an UV
eraser.
CPLD
MC0 MC0
CPLDs are great at handling wide and complex gating at blistering speeds – 5
nanoseconds, for example, which is equivalent to 200 MHz. The timing model for CPLDs
is easy to calculate so before starting your design you can calculate your input-to-output
speeds.
Chapter 1:
design changes into the CPLD development tool, and re-implement and test the
design immediately.
• Lower Development Costs: CPLDs offer very low development costs. Because
CPLDs are re-programmable, you can easily and very inexpensively change
your designs. This allows you to optimize your designs and continue to add new
features to enhance your products. CPLD development tools are relatively
inexpensive (or in the case of Xilinx, free). Traditionally, designers have had to face
large cost penalties such as re-work, scrap, and development time. With CPLDs, you
have flexible solutions, thus avoiding many traditional design pitfalls.
• More Product Revenue: CPLDs offer very short development cycles, which means
your products get to market quicker and begin generating revenue sooner. Because
CPLDs are re-programmable, products can be easily modified using ISP over the
Internet. This in turn allows you to easily introduce additional features and quickly
generate new revenue. (This also results in an expanded time for revenue). Thousands
of designers are already using CPLDs to get to market quicker and stay in the market
longer by continuing to enhance their products even after they have been introduced
into the field. CPLDs decrease TTM and extend TIM.
• Reduced Board Area: CPLDs offer a high level of integration (that is, a large number
of system gates per area) and are available in very small form factor packages. This
provides the perfect solution for designers whose products which must fit into
small enclosures or who have a limited amount of circuit board space to implement
the logic design. Xilinx CoolRunner® CPLDs are available in the latest chip scale
packages. For example, the CP56 CPLD has a pin pitch of 0.5 mm and is a mere 6 x 6
mm in size, making it ideal for small, low-power end products. The CoolRunner-II
CPLDs are also available in the QF (quad flat no-lead) packages, giving them the
smallest form factor available in the industry. The QF32 is just 5 x 5 mm in size.
if your design changes, you simply reprogram. By utilizing one device instead of
many, your board reliability will increase by only picking and placing one device
instead of many.
• Reliability: Reliability can also be increased by using ultra-low-power CoolRunner
CPLDs. Their lower heat dissipation and lower power operation leads to
decreased FIT.
12
Logic Logic Logic Logic Logic Logic
Cell Cell Cell Cell Cell Cell Data Out
Data In
1
10 11
With the introduction of the Spartan® series of FPGAs, Xilinx can now compete with gate
arrays on all aspects – price, gate, and I/O count, as well as performance and cost.
There are two basic types of FPGAs: SRAM-based reprogrammable and OTP (One Time
Programmable). These two types of FPGAs differ in the implementation of the logic cell
and the mechanism used to make connections in the device.
Chapter 1:
The dominant type of FPGA is SRAM-based and can be reprogrammed as often as you
choose. In fact, an SRAM FPGA is reprogrammed every time it’s powered up, because the
FPGA is really a fancy memory chip. That’s why you need a serial PROM or system
memory with every SRAM FPGA.
In the SRAM logic cell, instead of conventional gates, an LUT determines the output based
on the values of the inputs. (In the “SRAM logic cell” diagram above, six different
combinations of the four inputs determine the values of the output.) SRAM bits are also
used to make connections.
OTP FPGAs use anti-fuses (contrary to fuses, connections are made, not “blown,”
during programming) to make permanent connections in the chip. Thus, OTP FPGAs do
not require SPROM or other means to download the program to the FPGA. However,
every time you make a design change, you must throw away the chip! The OTP logic cell
is very similar to PLDs, with dedicated gates and flip-flops.
Logic Consolidation
Logic Consolidation
The consolidation of 74 series standard logic into a low-cost CPLD is a very attractive
proposition. Not only do you save PCB area and board layers – thus reducing your total
system cost – but you only have to purchase and stock one generic part instead of 20 or
more pre-defined logic devices. In production, the pick and place machine only has to
place one part, therefore speeding up production. Less parts means higher quality and
better FIT factor.
By using Xilinx CoolRunner devices, you can benefit from low power consumption and
reduced thermal emissions. This in turn leads to the reduction of the use of heat sinks
(another cost savings) and a higher reliability end product.
Chapter 1:
Chapter 2
Xilinx Devices
The Ultimate System Integration Platform
Virtex-5, 1.0V, 30K to 330K logic cells
Xilinx CPLDs
Currently, Xilinx offers CPLD products in two categories: XC9500 and CoolRunner
devices. This guide will focus on the two most popular families, the XC9500XL and the
CoolRunner-II. To choose a CPLD that's right for you, review the product features below to
identify the product family that fits your application. You should also review the selection
considerations to choose the device that best meets your design criteria.
Product Features
XC9500XL Device – The XC9500XL ISP CPLD family takes complex programmable logic
devices to new heights of performance, features, and flexibility. This family delivers
industry-leading speeds while providing the flexibility of enhanced customer-proven pin-
locking architecture, along with extensive IEEE Std.1149.1 JTAG Boundary Scan support.
This CPLD family is ideal for high-speed, low-cost designs.
CoolRunner-II Device – The CoolRunnerII CPLD family offers extremely low power,
making them the leaders in an all-new market segment: portable electronics. With standby
current in the low micro amps and minimal operational power consumption, these parts
are ideal for any application is that is especially power sensitive, such as battery-powered
or portable applications. The CoolRunner-II CPLD extends usage as it offers system-level
features such as LVTTL and SSTL, clocking modes, and input hysteresis.
Selection Considerations
To decide which device best meets your design criteria, take a minute to jot down your
design specs (using the list below as a criteria reference). Next, go to a specific product
family page to get more detailed information about the device you need.
Density – Each part gives an equivalent “gate count,” or estimate of the logic density of the
part.
Number of Registers – Count up the number of registers you need for your counters, state
machines, registers, and latches. The number of macrocells in the device must be at least
this large.
Number of I/O Pins – How many inputs and outputs does your design need?
Speed Requirements – What is the fastest combinatorial path in your design? This will
determine the Tpd (in nanoseconds) of the device. What is the fastest sequential circuit in
your design? This will tell you what fMax you need.
Package – What electromechanical constraints are you under? Do you need the smallest
ball grid array package possible, or can you use a more ordinary QFP? Or are you
prototyping and need to use a socketed device, such as a PLCC package?
Low Power – Is your end product battery- or solar-powered? Does your design require the
lowest power devices possible? Do you have heat dissipation concerns?
System-Level Functions – Does your board have multi-voltage devices? Do you need to
level shift between these devices? Do you need to square up clock edges? Do you need to
interface to memories and microprocessors?
The CoolRunner-II family of CPLDs is targeted for low-power applications that include
portable, handheld, and power-sensitive applications. Each member of the family includes
RealDigital design technology that combines low power and high speed. With this design
technique, the family offers true pin-to-pin speeds of 5.0 ns, while simultaneously
delivering power that is less than 16 µA (standby) without the need for special "power
down bits" that can negatively affect device performance. By replacing conventional
amplifier methods for implementing product terms (a technique that has been used in
PLDs since the bipolar era) with a cascaded chain of pure CMOS gates, the dynamic power
is also substantially lower than any competing CPLD. CoolRunner-II devices are the only
total CMOS PLDs
TM
CoolRunner -II
High Volume Applications
High Performance, Low Power with
No Cost Penalty
Performance & Density
• Consumer
• Cell Phones
XC9500XL • Cameras
• Set-Top Boxes
Specialty Functions • DVD Players
• Portable GPS
XC9500 • High Speed Clocking
• Delay Lock Loops
• MP3 & Portable Radios
LSI • Digital Delay Lines
• PDAs
• Communication
• Memory Controllers • Servers & PCs
• Bus Interfaces • Graphics Cards
SSI / MSI • UAR/Ts
• Printers
• Counters • Line Cards
• State Machines • Cable Modems
Glue Logic • Industrial
• 7400 Series Replacement • Motor Controllers
Xilinx CoolRunner-II CPLDs deliver the high speed and ease of use associated with the
XC9500/XL/XV CPLD family and the extremely low power versatility of the XPLA3. This
means that the exact same parts can be used for high-speed data communications,
computing systems, and leading-edge portable products, with the added benefit of ISP.
Low power consumption and high-speed operation are combined into a single family that
is easy to use and cost effective. Xilinx-patented Fast Zero Power architecture inherently
delivers extremely low power performance without the need for special design measures.
Clocking techniques and other power-saving features extend your power budget. These
design features are supported from Xilinx ISE 4.1i software onwards. Figure 2-4 shows
some of the advanced CoolRunner-II CPLD package offering with dimensions. All
packages are surface mount, with more than half of them ball-grid technologies. The ultra-
tiny packages permit maximum functional capacity in the smallest possible area.
PC44 306.25m2
16mm
VQ44 144m2
The CMOS technology used in CoolRunner-II CPLDs generates minimal heat, allowing the
use of tiny packages during high-speed operation. At least two densities are present in
each package, with three in the VQ100 (100-pin, 1.0 mm QFP) and TQ144 (144-pin, 1.4 mm
QFP), and in the FT256 (256- ball, 1.0 mm-spacing FLBGA). The FT256 is particularly
suited for slim-dimensioned portable products with mid to high-density logic
requirements.
Table 2-1 also details the distribution of advanced features across the CoolRunner-II CPLD
family. The family has uniform basic features, with advanced features included in densities
where they are most useful. For example, it is unlikely that you would need four I/O banks
on 32- and 64-macrocell parts, but very likely for 384- and 512-macrocell parts.
The I/O banks are groupings of I/O pins using any one of a subset of compatible voltage
standards that share the same V CCIO level. The clock division capability is less efficient
on small parts, but more useful and likely to be used on larger ones. DataGATE™
technology, an ability to block and latch inputs to save power, is valuable in larger parts,
but brings marginal benefit to small parts.
Table 2-1: CoolRunner-II Family Overview
Features XC2C32A XC2C64A XC2C128 XC2C256 XC2C384 XC2C512
FSYSTEM (MHz) 323 263 244 256 217 179
Max User I/O 33 64 100 184 240 270
I/O Banks 2 2 2 2 4 4
LVCMOS, LVTTL (1.5,1.8,2.5,3.3) Yes Yes Yes Yes Yes Yes
HSTL, SSTL - - Yes Yes Yes Yes
DualEDGE Yes Yes Yes Yes Yes Yes
DataGATE, CoolCLOCK - - Yes Yes Yes Yes
Standby Power (μW) 28.8 30.6 34.2 37.8 41.4 45.0
Advanced Security Yes Yes Yes Yes Yes Yes
Packages (size) Maxium User I/O
QFG32 (5x5 mm) 21
VQ44 (12x12 mm) 33 33
PC44 (17.5x17.5 mm) 33 33
QF48 (7x7 mm) 37
CP56 (6x6 mm) 33 45
VQ100 (16x16 mm) 64 80 80
CP132 (8x8 mm) 100 106
TQ144 (22x22 mm) 100 118 118
PQ208 (30.6x30.6 mm) 173 173 173
FT256 (17x17 mm) 184 212 212
FG324 (23x23 mm) 240 270
Function Function
Block 1 Block n
I/O Pin MC1 MC1 I/O Pin
I/O Pin MC2 MC2 I/O Pin
16 FB 16 FB
I/O Blocks
I/O Blocks
16 PLA PLA 16
40
AIM 40
DS090_01_121201
The PLA is different – and better. First, any p-term can be attached to any OR gate inside
the function block macrocell(s). Second, any logic function can have as many p-terms as
needed attached to it within the function block, to an upper limit of 56. Third, you can
reuse product terms at multiple macrocell OR functions so that within a function block,
you need only create a particular logical product once, but you can reuse it as many as 16
times within the function block. Naturally, this works well with the fitting software, which
identifies product terms that can be shared.
The software places as many functions as it can into function blocks. There is no need to
force macrocell functions to be adjacent or have any other restriction except for residing in
the same function block, which is handled by the software. Functions need not share a
common clock, common set/reset, or common output enable to take full advantage of the
PLA. In addition, every p-term arrives with the same time delay incurred. There are no
cascade time adders for putting more product terms in the function block. When the
function block p-term budget is reached, a small interconnect timing penalty routes signals
to another function block to continue creating logic. Xilinx design software handles all this
automatically.
CoolRunner-II Macrocell
The CoolRunner-II CPLD macrocell is extremely efficient and streamlined for logic
creation. You can develop SOP logic expressions comprising as many as 40 inputs and span
56 product terms within a single function block. The macrocell can further combine the
SOP expression into an XOR gate with another single p-term expression. The resulting
logic expression’s polarity is also selectable. The logic function can be pure combinatorial
or registered, with the storage element operating selectively as a D or T flip-flop, or
transparent latch. Available at each macrocell are independent selections of global,
function- block level, or local p-term-derived clocks, sets, resets, and output enables. Each
macrocell flip-flop is configurable for either single edge or DualEDGE clocking, providing
either double data rate capability or the ability to distribute a slower clock (thereby saving
power). For single-edge clocking or latching, either clock polarity may be selected per
macrocell.
CoolRunner-II macrocell details are shown in Figure 2-7. Standard logic symbols are used
in the in figure, except the trapezoidal multiplexers have input selection from statically
programmed configuration select lines (not shown). Xilinx application note XAPP376
gives a detailed explanation of how logic is created in the CoolRunner-II CPLD family.
FB Inputs
from AIM
40
PLA Array
49
P terms Macrocell
4
Control from I/O Block
Terms (Fast Input) Feedback to AIM
PTA
PTA
PTB CTS
VCC GSR
GND
PTC GND
to I/O
S
D/T Q
FIF
Latch
DualEDGE
GCK0 PTC CE
GCK1 CK R
CTC GCK2
PTC PTA
CTR
GSR
GND
When configured as a D-type flip-flop, each macrocell has an optional clock enable signal
permitting state hold while a clock runs freely. Note that control terms are available to be
shared for key functions within the function block, and are generally used whenever the
exact same logic function would be repeatedly created at multiple macrocells. The control
term product terms are available for function block clocking (CTC), function block
asynchronous set (CTS), function block asynchronous reset (CTR), and function block
output enable (CTE).
You can configure any macrocell flip-flop as an input register or latch, which takes in the
signal from the macrocell’s I/O pin and directly drives the AIM. The macrocell
combinatorial functionality is retained for use as a buried logic node if needed.
I/O Blocks
I/O blocks are primarily transceivers. However, each I/O is either automatically
compliant with standard voltage ranges or can be programmed to become compliant. In
addition to voltage levels, each input can selectively arrive through Schmitt-trigger inputs.
This adds a small time delay, but substantially reduces noise on that input pin. Hysteresis
also allows easy generation of external clock circuits. The Schmitt-trigger path is best
illustrated in Figure 2-8. Outputs can be directly driven, tri-stated, or open-drain
configured. A choice of slow or fast slew rate output signal is also available.
VREF for Local Bank
HSTL & SSTL
VCCIO
VREF
to AIM I/O Pin
128 macrocell
Input Hysteresis
to Macrocell and larger devices
(Fast Input)
Enabled
Control Term
PTB
4
GTS[0:3] /
CGND
Open Drain
Disabled
I/O Banking
CPLDs are widely used as voltage interface translators; thus, the I/O pins are grouped in
large banks. The four smaller parts have two output banks. With two banks available, the
outputs will switch to one of two selected output voltage levels, unless both banks are set
to the same voltage. The larger parts (384 and 512 macrocell) support four output banks,
split evenly. They can support groupings of one, two, three, or four separate output voltage
levels. This kind of flexibility permits easy interfacing to 3.3V, 2.5V, 1.8V, and 1.5V in a
single part.
DataGATE
Low power is the hallmark of CMOS technology. Other CPLD families use a sense
amplifier approach to create p-terms, which always has a residual current component. This
residual current can be several hundred milliamps, making these CPLDs unusable in
portable systems. CoolRunner-II CPLDs use standard CMOS methods to create the CPLD
architecture and deliver the corresponding low current consumption, without any special
tricks.
However, sometimes you might want to reduce the system current even more by
selectively disabling unused circuitry. The patented DataGATE technology permits a
straightforward approach to additional power reduction. Each I/O pin has a series switch
that can block the arrival of unused free- running signals that may increase power
consumption. Disabling these switches enables you to complete your design and choose
which sections will participate in the DataGATE function.
DataGATE
Configuration
Assertion Rail
Bit
Data Latch
Input
to AIM
Pin
clock nets. The signal is buffered and driven to multiple traces with minimal loading and
skew.
Global DIV2
Clock
(GCK2) Clock DIV4 to FB 1
Divide
By
2,4,6,…,16 to FB n
CDRST
DIV16
x378_01_041202
DualEDGE
Each macrocell has the ability to double its input clock switching frequency. Figure 2-7
shows the macrocell flip-flop with the DualEDGE option (doubled clock) at each
macrocell. The source to double can be a control term clock, a product term clock, or one of
the available global clocks. The ability to switch on both clock edges is vital for a number
of synchronous memory interface applications as well as certain double data rate I/O
applications.
CoolCLOCK
In addition to the DualEDGE flip-flop, you can gain additional power savings by
combining the clock division circuitry with the DualEDGE circuitry. This capability is
called CoolCLOCK and is designed to reduce clocking power within the CPLD. Because
the clock net can be a significant power drain, you can reduce the clock power by driving
the net at half frequency, and then doubling the clock rate using DualEDGE triggering at
the macrocells. Figure 2-11 illustrates how CoolCLOCK is created by internal clock
cascading, with the divider and DualEDGE flip-flop working together.
Input Device
Divide Routing Macrocell
Clock D/T/L
Q
D
DIV2 T
Latch
x378_03_041202
Design Security
You can secure your designs during programming to prevent either accidental overwriting
or pattern theft via readback. CoolRunner-II CPLDs have four independent levels of
security provided on-chip, eliminating any electrical or visual detection of configuration
patterns. These security bits can be reset only by erasing the entire device. Additional
details are omitted intentionally.
XC9500XL CPLDs also complement the higher-density Xilinx FPGAs to provide a total
logic solution, within a unified development environment. The XC9500XL family is fully
WebPOWERED via its free WebPACK ISE software.
Family Highlights
• Lowest cost per macrocell
• State-of-the-art pin-locking architecture
• Highest programming reliability reduces system risk
• Complements Xilinx 3.3V FPGA families
• Performance
♦ 5 ns pin-to-pin speed
♦ 222 MHz system frequency
• Powerful Architecture
♦ Wide 54-input function blocks
♦ As many as 90 product-terms per macrocell
♦ Fast and routable Fast CONNECT™ II switch matrix
♦ Three global clocks with local inversion
♦ Individual OE per output, with local inversion
• Highest Reliability
♦ Endurance rating of 10,000 cycles
Platform FPGAs
Spartan-3/3E/3A/3AN FPGAs
Xilinx Spartan-3 FPGAs are ideal for low-cost, high-volume applications and are targeted
as replacements for fixed-logic gate arrays and ASSP products such as bus interface chip
sets. The Spartan-3 (1.2V, 90 nm) FPGA is not only available for a very low cost, but it
integrates many architectural features associated with high-end programmable logic. This
combination of low cost and features makes it an ideal replacement for ASICs (gate arrays)
and many ASSP devices. For example, a Spartan-3 FPGA in a car multimedia system could
Platform FPGAs
absorb many system functions, including embedded IP cores, custom system interfaces,
DSP, and logic. Figure 2-14 below shows such a system.
In the car multimedia system shown in the above figure, the PCI bridge takes the form of
a pre-verified drop in IP core, and the device-level and board-level clocking functions are
implemented in the Spartan-3 on-chip DCMs. CAN core IP can connect to the body
electronics modules. These cores are provided by Xilinx AllianceCORE™ partners such as
Bosch, Memec Design, CAST, Inc., Xylon, and Intelliga. On-chip 18 x 18 multipliers can be
used in DSP-type activities such as filtering and formatting. Other custom-designed
interfaces can be implemented to off-chip processors, an IDE interface to the drive unit of
a DVD player, audio, memory, and LCD. Additionally, the Spartan-3 XCITE digitally
controlled impedance technology can reduce EMI and component count by providing on-
chip tunable impedances to provide line matching without the need for external resistors.
The Spartan-3 family is based on advanced 90 nm, eight- layer metal process technology.
Xilinx uses 90 nm technology to drive pricing down to under $20 for a one-million-gate
FPGA (approximately 17,000 logic cells), which represents a cost savings as high as 80
percent compared to competitive offerings. A smaller die size and 300 mm wafers improve
device densities and yields, thereby reducing overall production costs. This in turn leads to
a more highly integrated, less expensive product that takes up less board space when
designed into an end product.
Platform FPGAs
The Spartan-3 FPGA memory architecture provides the optimal granularity and efficient
area utilization.
• Shift Register SRL16 Blocks
♦ Each CLB LUT works as a 16-bit fast, compact shift register
♦ Cascade LUTs to build longer shift registers
♦ Implement pipeline registers and buffers for video or wireless
COUT COUT
SLICEL S3
X1Y1
SLICEL S2
X1Y0
Switch
Matrix
SLICEM S1
X0Y1
SHIFT
SLICEM S0
X0Y0
CIN CIN
Platform FPGAs
Logic Cells 1,728 4,320 8,064 17,280 29,952 46,080 62,208 74,480
Block RAM Bits 72K 216K 288K 432K 576K 720K 1,728K 1,872K
Distributed RAM Bits 12K 30K 56K 120K 208K 320K 432K 520K
DCMs 2 4 4 4 4 4 4 4
I/O Standards 24 24 24 24 24 24 24 24
Max Single Ended I/O 124 173 264 391 487 565 712 784
Digital clock management (DCM) Eliminate on-chip and board level clock delay,
simultaneous multiply and divide, reduction of
board level clock speed and number of board level
clocks, adjustable clock phase for ensuring
coherency
Global routing resources Distribution of clocks and other signals with very
high fanout throughout the device
Programmable output drive Improves signal integrity, achieving right trade off
between Tco and ground bounce
Table 2-6: Spartan-3E FPGA Family Overview
Device XC3S100E XC3S250E XC3S500E XC3S1200E XC3S1600E
System Gates 100K 250K 500K 1200K 1600K
Logic Cells 2,160 5,508 10,476 19,512 33,192
Dedicated Multipliers 4 12 20 28 36
Block RAM Blocks 4 12 20 28 36
Block RAM Bits 72K 216K 360K 504K 648K
Distributed RAM Bits 15K 38K 73K 136K 231K
DCMs 2 4 4 8 8
Max Differential I/O 40 68 92 124 156
Max Single Ended I/O 108 172 232 304 376
VQ100 66 66
CP132 92 92
TQ144 108 108
PQ208 158 158
FT256 172 190 190
FG320 232 250 250
FG400 304 304
FG484 376
Platform FPGAs
$15 $6
$10
$4
$6
$7/$2
Spartan-3E
$30
$7.50
$6
Spartan-3A/3AN
The Spartan-3A and Spartan-3AN families are pin-to-pin compatible low-cost FPGA
families. The Spartan-3AN is non-volatile. Its offering is shown in Table 2-7.
Table 2-7: Spartan-3AN Family
Virtex FPGAs
Virtex-4 FPGAs
With more than 100 innovations, the Virtex-4 family represents a new milestone in the
evolution of FPGA technology. The idea behind the family was to offer higher
performance, higher logic density, lower power, lower cost and more advanced
capabilities over previous families. To offer one or two of these items is relatively easy – the
challenge was to offer all at the same time. We did this through a combination of
innovative process and circuit design, process development, the ASMBL architectural
approach and the use of advanced embedded functions.
ASMBL Architecture
One of the most remarkable developments embodied in the new Virtex-4 FPGA family is
the Advanced Silicon Modular Block (ASMBL) columnar architecture, which represents a
fundamentally new way of constructing the FPGA floor plan and its interconnect to the
package. First of all, ASMBL enables IO pins, clock pins and power and ground pins to be
located anywhere on the silicon chip, not just along the periphery as with previous FPGA
architectures. This in turn allows power and ground pins to be brought directly into the
centre of the silicon die, thereby significantly reducing on-chip IR drops that can occur
with the largest FPGAs running at the highest frequencies
Virtex FPGAs
The columnar approach to building the ASMBL architecture enables Xilinx to cost-
effectively develop multiple FPGA platforms, each with different combinations of feature
sets. Thus, a specific platform can be optimized specifically for a certain domain of
applications – such as logic, connectivity, DSP and embedded processing – to meet
application requirements previously delivered only by ASICs, ASSPs and similar devices
while remaining programmable at heart.
Virtex-4
Traditional FPGA Family Multi-platform FPGA Family
Feature
Device
D
Device Capability & Cost
cost
Feature
C
Feature
B
Feature
B
Feature Feature
A A
Virtex-4 Variants
Virtex-4 is offered in three variants; Virtex-4 LX, optimized for high performance logic
functions; Virtex-4 SX, optimized for high-performance signal processing; Virtex-4 FX,
optimized for embedded processing and high-speed serial connectivity.
LX FX SX
Resource
Logic 14-
14-200K LCs 12-
12-140K LCs 23-
23-55K LCs
Memory 0.9-
0.9-6Mb 0.6-
0.6-10Mb 2.3-
2.3-5.7Mb
SelectIO 240-
240-960 240-
240-896 320-
320-640
Virtex-4 LX
The most general-purpose family would be the Virtex-4 LX or logic optimized platform
family. The LX family is similar in function to early Virtex-II devices without the
embedded PowerPC processor or higher-speed serial I/Os found in the newer Virtex-II
ProTM devices. All types of soft Intellectual Property (IP) cores can be implemented on this
Platform, including various DSP blocks and soft processor cores such as MicroBlaze or
PicoBlaze. The primary benefit is the use of highly integrated general-purpose logic
elements, which makes this the most cost-effective logic platform.
The Virtex-4 LX Platform will have several family members with small–to-large-size
devices, making it a suitable match for many applications. This family will have twice the
logic density of any device shipping today. The cost benefits of using advanced 90nm
silicon fabrication technology on 300mm wafers, together with cost-effective device
packaging insures this platform’s broad-based acceptance. The higher clock frequencies
compared to previous generation platform FPGAs greatly expands the LX Platform’s
suitability for replacing ASICs.
• Highest Logic Capacity Ever (up to 200k LCs)
• Widest Capacity Range (8 LX devices ranging for 14k to 200k LCs)
Virtex-4 FX
Adding a PowerPC and high-speed serial transceivers creates the full-featured Virtex-4 FX
platform. The combination of features, architecture, and fabrication process enables
processor clock speeds of up to 450 MHz. Combining this capability with serial
transceivers supporting any speed from 600 Mbps to 11.1Gbps provides a very capable
high-performance platform FPGA that meets embedded-processing and connectivity-
domain requirements.
Virtex FPGAs
The FX Platform incorporates advanced system features that are particularly useful in a
wide-range of applications in the Telecom, Storage, and Networking space, and other
system applications requiring high-performance processing and high-bandwidth I/O.
These applications can be segmented into two general application domains based on the
system behavior. The embedded-processing domain is dominated by control flow
operations involving complex data types. The connectivity-domain involves message-
based processing and is dominated by asynchronous data flow operations. Both domains
are best implemented on the Virtex-4 FX full-featured platform.
• Additional Advanced System Functions
♦ 10 Gbps RocketIO
♦ PowerPC Cores
♦ 10/100/1000 Ethernet MAC Cores
• Rich Memory Mix BRAM/FIFO
♦ Up to Nearly 10 Mbits
• Six FX Devices Ranging from 12k to 140k LCs
Virtex-4 SX
Increasing the ratio of DSP and memory blocks to the number of logic elements creates the
Virtex-4 SX, or signal-processing/DSP Platform family of devices. The changed ration of
features creates a relatively smaller die size Platform in comparison to other Virtex-4
platforms for high-speed signal processing. This trade-off combined with the new DSP
slice features packs the capability for the highest DSP performance into the most cost-
effective Virtex-4 SX Platform. With significantly higher DSP bandwidth at much reduced
power consumption of previous Virtex-II Pro devices, the Virtex-4 SX Platform delivers the
most DSP performance per dollar compared to any other device. Each DSP Slice
implements an 18-bit x 18-bit MAC that can be clocked at 500MHz. The impact of Virtex-4
DSP specific enhancements to include new modes and capabilities, together with other
parts of the optimized SX Platform architecture, enables more capable higher level DSP IP.
SX55
512 •• 256
256 GMAC/s:
GMAC/s: Highest
Highest DSP
DSP
performance in the industry
performance in the industry
DSP
Slices •• Lowest
Lowest DSP
DSP cost
cost // performance ratio
ratio
SX35 FX140
192
FX100
160
SX25
128 FX60
LX100 LX160 LX200
96 LX80
LX40 LX60
64 LX25
FX40
32 FX20
LX15 Device
FX12
Cost
Virtex-5
The Virtex-5 family of FPGAs represents the 5th generation in the Virtex series of FPGAs.
Built on 65 nm triple-oxide process technology, the proven multi-platform ASMBL
architecture, and the all-new ExpressFabric technology, the Virtex-5 family offers
customers the highest performance, most flexible connectivity, optimized power, lowest
system cost and maximum productivity. The first family available at product launch is
Virtex-5 LX, shown in Table 2-9. The complete Virtex-5 Platform family is as follows:
• Virtex-5 LX Platform - Optimized for high-performance logic
• Virtex-5 LXT Platform - Optimized for high-performance logic with low-power serial
connectivity
• Virtex-5 SXT Platform - Optimized for DSP and memory-intensive applications with
low-power serial connectivity
• Virtex-5 FXT Platform - Optimized for embedded processing and memory-intensive
applications with highest-speed serial connectivity
Logic
On-chip RAM
DSP Capabilities
Parallel I/Os
Serial I/Os
®
PowerPC Processors
Shipping since May ‘06 Oct ‘06 Feb ‘07 Now
For a complete Virtex-5 Platform FPGA product table, see
http://www.xilinx.com/publications/prod_mktg/pn0010938-4.pdf
Design-In Flexibility
With Xilinx XA devices, you can design-in flexibility and get your product to market faster
than ever before. Because many new standards continue to evolve (such as the LIN, MOST,
and FlexRay in-car busing standards), you need the flexibility to quickly modify your
designs at any time. With our unique Internet Reconfigurable Logic (IRL) capability, you
can remotely and automatically modify your designs, in the field, after your product has
left the factory. By combining our latest XA PLDs with our solutions infrastructure of high-
productivity software, IP cores, design services, and customer education, you can develop
advanced, highly flexible products faster than ever before. For more information, visit
www.xilinx.com/automotive.
XA Product Range
Table 2-10: Temperature Grades
Product Group Temperature Grade/Range (ºC)
C I Q
FPGA Tj = 0 to +85 Tj = -40 to +100 Tj = -40 to +125
CPLD Ta = 0 to +70 Ta = -40 to +85 Ta = -40 to +125
Chapter 3
4. Generate a netlist.
EDIF is the industry-wide standard for netlists; many others exist, including vendor-
specific ones such as the Xilinx Netlist Format (XNF). Once you have the design netlist, you
have all you need to determine what the circuit does.
Design Flow
STAT_MAC
Specification
clock CLK AUG amber_light
Libraries Counter
CLOCK COUNT (3.0)
RESET
Schematic
Capture Design Schematic
Netlist
101010101001110101010101
010101011110001110100111
101010101001110101010101
010101011110001110100111
101010101001110101010101
010101011110001110100111
101010101001110101010101
010101011110001110100111
Design Netlist
The example on the previous pages is obviously very simplistic. Let’s describe a more
realistic design of 10,000 equivalent gates. The typical schematic page contains about 200
gates, contained with soft macros. Therefore, it would require 50 schematic pages to create
a 10,000-gate design! Each page needs to go through all the steps mentioned previously:
adding components, interconnecting the gates, adding I/Os, and generating a netlist. This
is rather time-consuming, especially if you want to have a 20,000, 50,000, or even larger
design.
Another inherent problem with using schematic capture is the difficulty in migrating
between vendors and technologies. If you initially create your 10,000 gate design with
FPGA vendor X and then want to migrate to a gate array, you would have to modify every
one of those 50 pages using the gate array vendor’s component library.
would have to be loaded, positioned on the page, and interconnected, with I/O buffers
added. That would be about three days of work.
The HDL implementation, which is also 6,000 gates, requires eight lines of text and can be
done in three minutes. This file contains all the information necessary to define our 16 x 16
multiplier. So, as a designer, which method would you choose? In addition to the
tremendous time savings, the HDL method is completely vendor-independent. This opens
up tremendous design possibilities for engineers.
$ESIGN&LOW
3PECIFICATION
,IBRARIES
3CHEMATIC
#APTURE
.ETLIST
$ESIGN3CHEMATICS
/2
ENTITY-5,4IS
PORT!"INSTD?LOGICDOWNTO
9OUTSTD?LOGICDOWNTO
END-5,4
ARCHITECTURE"%(!6%OF-5,4IS
BEGIN
9!
"
END"%(!6%
$ESIGN7RITTENIN($,
To create a 32 x 32 multiplier, you could simply modify the work you’d already done for
the smaller multiplier. For the schematic approach, this would entail making three copies
of the 30 pages, then figuring out where to edit the 90 pages so that they addressed the
larger bus widths. This would probably require four hours of graphical editing. For the
HDL specification, it would be a matter of changing the bus references from 15 to 31 in line
2, and 31 to 63 in line 3. This would probably require about four seconds.
HDL Synthesis
Once we have specified the design in a behavioral description we can convert it into gates
using the process of synthesis. The synthesis tool does the intensive work of figuring out
what gates to use, based on the high-level description file you provide (using schematic
capture, you would have to do this manually.) Because the resulting netlist is vendor and
device family-specific, you must use the appropriate vendor library. Most synthesis tools
support a large range of gate array, FPGA, and CPLD device vendors.
In addition, you can specify optimization criteria that the synthesis tool will take into
account when making the gate-level selections, also called mapping. Some of these options
include: optimizing the complete design for the least number of gates, optimizing a certain
section of the design for fastest speed, using the best gate configuration to minimize power,
and using the FPGA-friendly, register-rich configuration for state machines.
You can easily experiment with different vendors, device families, and optimization
constraints, thus exploring many different solutions instead of just one with the schematic
approach.
To recap, the advantages of high level design and synthesis are many. It is much simpler
and faster to specify your design using HDL, and much easier to make changes to the
design because of the self-documenting nature of the language. You are relieved from the
tedium of selecting and interconnecting at the gate level. You merely select the library and
optimization criteria (e.g., speed, area) and the synthesis tool will determine the results.
You can also try different design alternatives and select the best one for your application. In
fact, there is no real practical alternative for designs exceeding 10,000 gates.
ISE Software
ISE advanced HDL synthesis engines produce optimized results for PLD synthesis, one of
the most essential steps in your design methodology. It takes your conceptual HDL design
definition and generates a logical or physical representation for the targeted silicon device.
A state-of-the-art synthesis engine is required to produce highly optimized results with a
fast compile and turnaround time. To meet this requirement, the synthesis engine must be
tightly integrated with the physical implementation tool and proactively meet design
timing requirements by driving the placement in the physical device. In addition, cross
probing between the physical design report and the HDL design code further enhances the
turnaround time.
Xilinx ISE software provides seamless integration with leading synthesis engines from
Mentor Graphics, Synopsys and Synplicity. The ISE product also includes Xilinx
proprietary synthesis technology, or XST. With just the push of a button, you can start any
leading synthesis engine within ISE. You can even use multiple synthesis engines to obtain
the most optimized result of your programmable logic design.
Design Verification
Programmable logic designs are verified by using a simulator, which is a software program
that confirms the functionality or timing of a circuit. The industry-standard formats used
ensure that designs can be reused. If a vendors changes its libraries, only a synthesis
recompile is necessary. Even if you decide to move to a different vendor and/or
technology, you are just a compile away after selecting the new library. It is even design-
tool independent, so you can try synthesis tools from different vendors and pick the best
results. IP cores are commonly available in HDL format, since that makes them easier to
modify and use with different device vendors.
After completing the design specification, you’ll need to know if the circuit actually works
as it’s supposed to. That is the purpose of design verification. A simulator simulates the
circuit. You’ll need to provide the design information (via the netlist after schematic
capture or synthesis) and the specific input pattern, or test vectors, that you want checked.
The simulator takes this information and determines the outputs of the circuit.
Specification
Libraries
HDL
Schematic Synthesis
Capture
Netlist
Verification
Simulation
Test
Vectors
Implementation
Translate
Download Device
Program
System Debug
Printed
Circuit Board
Functional Simulation
At this point in the design flow, a functional simulation only checks that the circuits give the
right combinations of ones and zeros. You should conduct a timing simulation a little later in
the design flow. If there are any problems, you can go back to the schematic or HDL file,
make changes, regenerate the netlist, and then rerun the simulation. Designers typically
spend 50% of their development time going through this loop until the design works as
required.
Using HDL offers an additional advantage when verifying the design: You can simulate
directly from the HDL source file. This bypasses the time-consuming synthesis process
that would normally be required for every design change iteration. Once the circuit works
correctly, running the synthesis tool generates the netlist for the next step in the design
flow – device implementation.
Device Implementation
A design netlist completely describes the design using the gates for a specific
vendor/device family. Once your design is fully verified, it is time to place it on a chip, a
process referred to as device implementation.
Translate comprises various programs used to import the design netlist and prepare it for
layout. The programs will vary among vendors. Some of the more common programs
during translate include: optimization, translation to the physical device elements, and
device-specific design rule checking (for example, does the design exceed the number of
clock buffers available in this device?). During this stage of the design flow, you will be
asked to select the target device, package, speed grade, and any other device-specific
options. The translate step usually ends with a comprehensive report of the results of all
the programs executed. In addition to warnings and errors is usually a listing of device and
I/O utilization, which helps you to determine if you have selected the best device.
Fitting
For CPLDs, this design step is called fitting, meaning to “fit” the design to the target device.
In the diagram above, a section of the design is fit to the CPLD. CPLDs are a fixed
architecture, so the software needs to pick the gates and interconnect paths that match the
circuit. This is usually a fast process.
The biggest potential problem is if you had previously assigned the exact locations of the
I/O pins, commonly referred to as pin locking. Most often, this occurs when using a legacy
design iteration that has been committed to the printed circuit board layout. Architectures
that support I/O pin locking (such as the Xilinx XC9500 and CoolRunner CPLDs) have a
very big advantage. They allow you to keep the original I/O pin placements regardless of
the number of design changes, utilization, or required performance. Pin locking is very
important when using ISP. If you layout your PCB to accept a specific pin out, and then
change the design, you can re-program confident that you pin out will stay the same.
can compensate for an ill-conceived architecture, especially if there are not enough routing
tracks. If you were to encounter this problem, the most common solution would be to use
a larger device. And you would likely remember the experience the next time you selected
a vendor.
A related program is called timing-driven place and route (TDPR). This allows you to specify
timing criteria that will be used during device layout. A static timing analyzer is usually part
of the vendor’s implementation software. It provides timing information about paths in
the design. This information is very accurate and can be viewed in many different ways,
such as displaying all paths in the design and ranking them from longest to shortest delay.
In addition, at this point you can use the detailed layout information after reformatting
and go back to your chosen simulator with detailed timing information. This process is
called back-annotation and has the advantage of providing the accurate timing as well as the
zeros and ones operation of your design. In both cases, the timing reflects delays of the
logic blocks as well as the interconnect. The final implementation step is the download or
program.
Downloading or Programming
Download generally refers to volatile devices such as SRAM FPGAs. As the name implies,
you download the device configuration information into the device memory. The
bitstream that is transferred contains all the information to define the logic and
interconnect of the design and is different for every design. Because SRAM devices lose
their configuration when the power is turned off, the bitstream must be stored somewhere
for a production solution. A common such place is a serial PROM. There is an associated
piece of hardware that connects from the computer to a board containing the target device.
Program is used to program all non-volatile programmable logic devices, including serial
PROMs. Programming performs the same function as download, except that the
configuration information is retained after the power is removed from the device. For
antifuse devices, programming can only be done once per device – hence the term one-
time programmable. Programming of Xilinx CPLDs can be done in-system via JTAG or
with a conventional device programmer such as Data IO. JTAG Boundary Scan – formally
known as IEEE/ANSI standard 1149.1_1190 – is a set of design rules that facilitate testing,
device programming, and debugging at the chip, board, and system levels.
In-system programming has an added advantage in that devices can be soldered directly
to the PCB (such as TQFP surface-mount-type devices). If the design changes, the devices
do not need to be removed from the board but simply re-programmed in-system.
Libraries Download
Cable
HDL
Schematic Synthesis
Capture
Netlist
Verification
Conventional Programming
Implementation Target
Device
Translate
Download Device
Program
Programmer
System Debug
The device is now working, but you still need to verify that the device works in the actual
board, a process called system debug. Any major problems here mean that you have made
an assumption on the device specification that is incorrect, or have not considered some
aspect of the signal required to/from the programmable logic device. If so, you can collect
data on the problem and go back to the drawing (or behavioral) board. The “Design Tools
Center” web pages cover both the Xilinx ISE tools suite as well as design tools from our
software partners. It is arranged by the following topics:
Dynamic Verification
You can save time by using dynamic verification to intercept logical or HDL-based errors
early in the design cycle. By exposing a design to realistic and extensive stimuli, you can
find many functional problems at this stage. The following dynamic verification tools are
supported:
• HDL Bencher™
• ISE Simulator
• ModelSim XE
• StateBench
• HDL Simulation Libraries
Debug Verification
Debug verification tools speed up the process of viewing, identifying, and correcting
design problems at different stages of the design cycle. Debug verification includes the
ability to view, “live,” all internal signals and nodes within an FPGA. These tools can also
assist in HDL-based designs by checking coding style for optimum performance. The
following debug verification tools are supported:
• FPGA Editor Probe
• ChipScope ILA
• ChipScope Pro
Board-Level Verification
Using board-level verification tools ensures that your design performs as intended once
integrated with the rest of the system. The Xilinx ISE environment supports the following
board-level verification tools:
• IBIS Models
• Tau
• BLAST
• Stamp Models
• iMPACT
High-Level Languages – As design densities increase, the need for a higher level of
abstraction becomes more important. Xilinx is driving and supporting industry standards
and their respective support tools.
This chapter explains what is available in ISE WebPACK and gives details on how to go
about registering and installing the software.
Table 3-1: WebPACK Operating System and Device Support
Feature ISE WebPACK
Microsoft Windows XP/Vista
Operating Systems
Redhat Enterprise Linux 3 (32-bit)
Virtex: XCV50 - XCV600
Virtex-E: XCV50E - XCV600E
Virtex-II: XC2V40 - XC2V500
Virtex-II Pro: XC2VP2 - XC2VP7
Virtex-4:
LX: XC4VLX15, XC4VLX25
SX: XC4VSX25
Virtex Series FX: XC4VFX12
Virtex-5:
LX: XC5VLX30, XC5VLX50
LXT: XC5VLX30T, XC5VLX50T
FXT: XC5VFX50T
Virtex Q: XQV100 - XVQ600
Virtex QR: XQVR300 - XVQR600
Virtex-EQ: XQV600E
Spartan-II/IIE: All
Spartan-3: XC3S50 - XC3S1500
Spartan-3E: All
Spartan Series
Spartan-3A/AN: All
Spartan-3A DSP: XC3SD1800A
XA (Xilinx Automotive) Spartan-3: All
CoolRunner-II/A
All
CoolRunner XPLA3
XC9500/XL/XV All
This is usually on a sticker on the CD pack and takes the form ABC123456789. Once this
has been entered, the 16 digit registration ID will be displayed on the following web page
as well as emailed to the email address of the user.
To download the software, click the button. This will offer the
option to download the complete ISE WebPACK tool suite, only the tools required for
CPLD designs or only the programming tools. Xilinx recommends that, if the space is
available, the entire tool suite is downloaded. Once the appropriate design tools have been
downloaded, the software can be installed by simply double clicking on the self-extracting
zip file.
Module Descriptions
In general, the design flow for FPGAs and CPLDs is very similar. Design Entry can be done
in Schematic or HDL, such as VHDL, Verilog or, for CPLDs only, ABEL. The design can
also comprise of a mixture of schematic diagrams and embedded HDL symbols. There is
also a facility to create state machines in a diagrammatic form and let the software tools
generate optimized code from a state diagram. All these steps will be seen in Chapter 4, ISE
WebPACK Design Entry.
WebPACK ISE software incorporates the ISE Simulator Lite – Xilinx’ new simulation tool.
This tool will be used in the tutorial section of this book. The full version of the ISE
Simulator is available in the full feature set ISE Foundation software. There is also the
option to download the ModelSim Xilinx Edition (MXE) software. This is a version of
Mentor Graphics’ ModelSim simulator with the Xilinx libraries precompiled. For more
information on the MXE software, refer to:
www.xilinx.com → Products and Services → Design Tools → Verification
The flow diagram below shows the similarities and differences between CPLD and FPGA
software flows.
Synthesis
Xilinx Synthesis Technology (XST)
Translate
NGDBuild
CPLD FPGA
Fit Implement
CPLD Fitter MAP/PAR
Estimate Power
XPower
Program
IMPACT Programmer
Testbench Simulate
HDL Bencher ModelSim XE
When your design is complete and you are happy with the simulation results, you can then
download the design to the required device.
Getting Started
Licenses
The MXE Simulator is the only tool that requires a license. MXE Simulator is licensed via
the FlexLM product from Macrovision. It requires you to situate a starter license file on
your hard drive, pointed to by a set lm_license_file environment setting. The license
is free and you apply for it online after installation, after which you will receive a
license.dat file via email.
From the Start menu, go to Programs → ModelSimXE → Submit License Request
Projects
When starting a project the default location of the project will be:
c:\Xilinx_WebPACK\bin\nt
You can create a unique directory on your hard drive for working on projects, for example:
c:\my_projects.
Should you need to uninstall and reinstall WebPACK ISE software due to problems on
your system, we recommend that you delete the entire WebPACK ISE directory structure.
Updating Software
Between major releases of software, Service Packs are released to keep the software fully
up to date. Service Packs often include new device features, updated characterization data
and minor improvements to the tools. Xilinx recommends that, if a Service Pack is
available for a version of the ISE WebPACK software, you install it at the earliest possible
convenience.
Summary
In this chapter, we demonstrated how to access and install the ISE WebPACK software, and
listed the devices it supports.
The next section will show how to embark upon a PLD design for the first time using the
powerful features of WebPACK ISE software. The example design is a basic up/down
counter and 7-segment display decoder. The design entry process is identical for CPLDs
and FPGAs.
Chapter 4
Design Entry
To start WebPACK ISE software, select:
Start → Programs → Xilinx ISE 10.1 → ISE → Project Navigator
To create a new project:
1. Select in Project Navigator: File → New Project.
2. Call the project “Tutorial” and put it in your Designs directory. For this tutorial, we
will be using an HDL top level.
3. Click the Next> button.
5. Click the Next> button. Click Next> in the New Source wizard.
6. Click Next> in the Add Existing Sources dialog box. Click Finish. This will create a
project.
7. Add a new source to the project by selecting Project → New Source.
8. Add a VHDL module and call it “clock_divide.”
Design Entry
11. Declare two ports: clock_osc and clock_div. The port clock_osc should be of
direction “in”, and clk_div should be direction “out”.
12. Click the Next> button as many times as needed to get to the design summary
window. Review the contents of the final window and click the Finish button.
This has automatically generated the entity in the counter VHDL module. Notice that a file
called “clock_divide.vhd” has been added to the project in the Sources in Project
window of the Project Navigator.
The source code will open automatically, but if you do not see it you can double-click on
this source (highlighted in Figure 4-5) to open it in the WebPACK ISE Editor window.
You can remove the source files from the WebPACK ISE GUI by clicking
Window → Float in the ISE Menu. As the project builds, you will notice how the
WebPACK ISE tool manages hierarchy and associated files in the Sources window.
HDL Editor
Double-clicking on any file name in the Sources window allows that file to be edited in
the main Text Editor.
Design Entry
1. In the HDL Editor place the cursor between begin and end Behavioral.
2. Open the language templates by clicking the button on the Project Navigator tool bar.
You can also access the language template from the Edit → Language Template
menu.
3. Navigate to the Simple Counter in the Language Templates as follows:
VHDL → Device Primitive Instantiation → CPLD → Clock Components → CR-II Clock
Divider → Divide by 16 → Simple Divider (CLK_DIV16)
4. Highlight all the code as indicated in the comments and copy it into the
clock_divide.vhd file at the architecture section, between the begin and end
statements
5. You can close the language templates by clicking the X in the top right corner of the
text window if you wish, but we will be using them again shortly.
6. Notice the color-coding used in the HDL Editor. The green text indicates a comment.
The commented text in this template shows which libraries are required in the VHDL
header. Figure 4-7 shows the CLK_DIV code that has been pasted into the clock_divide
file.
Design Entry
A typical VHDL module consists of library declarations, an entity, and an architecture. The
library declarations are needed to tell the compiler which packages are required. To
summarize our module, the entity declares all ports associated with the design. Count (9
down to 0) means that count is a 10-bit logic vector.
This design has one input (clock_osc) and one output (clock_div). The actual
functional description of the design appears after the begin statement in the architecture.
The function of this design is to divide the incoming clock_osc signal from the oscillator
by 16 using the hard clock divider, and to use the subsequent output to increment a signal
“count” when clock_div_int = 1 and there is an event on clock_div_int. This is
resolved into a positive edge. The area still within the architecture – but before the begin
statement – is where component declarations reside.
1. To add another source go Project → New Source in the Project Navigator menu.
Choose VHDL Module and call it “counter”. This module will need five ports, four
inputs named “clock”, “reset” , “direction, and pause_design” as well as a
4-bit output bus called “count_out”.
2. Place a check mark in the Bus check box for count_out. Set the MSB on count_out
to 3 and the LSB to 0.
3. Click Next> and Finish until the VHDL file opens.
4. We need to go back to the counter section of the Language Templates and find a
counter with direction control. In the Language Templates follow:
VHDL → Synthesis Constructs → Coding Examples → Counters → Binary → Up/Down
Counters → /wCE
5. Copy the code and paste it into the “counter.vhd” file between the begin and End
Behavioral lines.
6. We now need to edit the signal names and insert a reset signal. You may find the
Edit → Replace feature useful to perfom the following tasks:
a. Change the reference to <count_direction> to Direction and remove the <>
brackets around the <clock>and <count> signals.
b. Change <clock_enable> to pause_design
c. Change the polarity for the active condition for the pause_design from:
If pause_design=’1’
to
If pause_design=’0’
d. Add an asynchronous reset into the code by adding the following line directly
after the begin of the process statement:
if reset='0' then count <= "0000";
The reset condition is ‘0’ because the push button on the demonstration board is
active low, making it is a ‘1’ when not pressed, and a ‘0’ when pressed.
7. Change the process statement to process (clock , reset , pause_design)
Design Entry
8. Then we need to create a 4-bit signal called count. Insert the following code between
the architecture and begin lines:
signal count : std_logic_vector (3 downto 0);
9. Finally, we need to connect the Count signal to the count_out port by inserting the
following line after the end process statement and before the end behavioral
statement:
count_out <= count;
10. Change the if clock statement to start with elsif instead of if.
The code sould now look like this.
bit input bus called count_in and a 7-bit output bus called LED, as shown in
Figure 4-11.
Functional Simulation
Functional Simulation
You can now run a functional simulation on the display_drive module. With
display_drive.vhd highlighted in the Source window, the Process window will give
all the available operations for the particular module. A VHDL file can be synthesised and
then implemented through to a bitstream. Normally, a design consists of several lower-
level modules wired together by a top-level file. In this instance, we are going to simulate
only one lower-level module to introduce the functional simulation methodology.
To simulate a VHDL file, you must first create a testbench.
1. From the Project menu, select New Source as before:
2. Select Test Bench Waveform as the source type and give it the name
display_drive_tb.
Functional Simulation
8. To simulate the design, you need to tell the testbench how you want the input signals
to toggle. After the GSR pulse has finished, double-click in the count_in waveform.
In the dialog box that appears, click Pattern Wizard. In the Pattern Type box, select
Count Up. In the Number of Cycles box, select 8. Select Radix to be Binary.
15. Select the Simulation tab to view the results. You may need to expand the signal
names by clicking on the plus (+) signs.
2. Because we are going to use the three previous models as components in our top level
design, we need to first declare them as components, just as we did with the clock
divider module in the first module we created. Between the architecture
behavioral of top is line and the begin line, insert the three component
declarations as follows:
component clock_divide
Port ( clock_osc : in STD_LOGIC;
clock_div : out STD_LOGIC);
end component;
component counter
Port ( clock : in STD_LOGIC;
reset : in STD_LOGIC;
direction : in STD_LOGIC;
pause_design : in STD_LOGIC;
count_out : out STD_LOGIC_VECTOR (3 downto 0)
);
component display_drive
Port ( count_in : in STD_LOGIC_VECTOR (3 downto 0);
LED : out STD_LOGIC_VECTOR (6 downto 0)
);
end component;
Notice that the ports of the components exactly match the ports in the three modules we
created earlier.
3. Now that the components have been declared, we must use instances of them in the
design. Enter the following text into the code after the begin and before the end
Behavioral statements:
U1: clock_divide
Port map (
clock_osc => clock_ext,
clock_div => clock_div_sig
);
U2: counter
Port map (
clock => clock_div_sig,
reset => reset_ext,
direction => direction_ext,
pause_design => pause_design,
count_out => count_in_sig
);
U3: display_drive
Port map (
count_in => count_in_sig,
LED => LED_output
);
Notice that the ports of the components have all been connected to either a port in our
entity declaration (clock_ext, reset_ext, direction_ext or LED_output) or an
intermediate signal (clock_div_sig or count_in_sig).
4. We now need to declare these two signals that we have just used. After your last
component declaration and before begin, enter the following two signal declarations:
signal count_in_sig : std_logic_vector (3 downto 0);
signal clock_div_sig : std_logic;
5. Save the file. You should now see in the Project Navigator Sources window that the
source files are ordered in a hierarchy. Top.vhd is the top level and the other three
modules all sit underneath as shown in Figure 4-19.
traditional method. For designs in the WebPACK ISE tool, the entire project can be
schematic- based.
This section discusses the method of connecting VHDL modules via the ECS schematic
tool. If you worked through the previous section, you will first need to remove the top
level VHDL file top.vhd from the project. To do this, highlight the file in the sources for
Synthesis/Implementation View, right click and select Remove, then click the Yes button
in the dialog box.
This action will take you back to the stage in the flow with only the three lower level
modules in the project. The Sources window module view should look like Figure 4-20
below.
ECS Hints
The ECS schematic capture program is designed around you selecting the action you wish
to perform, followed by the object on which the action will be performed. In general, most
Windows applications currently operate by selecting the object and then the action to be
performed on that object. Understanding this fundamental philosophy of operation makes
learning ECS a much more enjoyable experience.
2. Now we need to make a schematic sheet. From the Project menu, select New Source
→ Schematic and give it the name top_sch as shown in Figure 4-21.
3. Click the Next> button, then the Finish button. The ECS Schematic Editor window
will now appear. There will also be an Options tab below the Processes window.
4. The symbol libraries can be found under the Symbol tab on the right hand tab in the
Sources window You will see that there is a category showing the path to your project
directory. If you click this category, you will see three symbols listed below. These are
the three symbols that you have just created, as shown in Figure 4-22.
5. Click the clock_divide symbol and move your cursor over to the schematic sheet.
Place the clock_divide symbol in the middle of the left hand side of the schematic
sheet.
6. Then click the counter symbol and place it to the right of the previous symbol with
space between them.
7. Finally, click the display_drive symbol and place it in the middle of the right hand
side of the schematic sheet. Your sheet should now look something like this: .
2. Click the clock_div output of the clock_divide module and then click the Clock
input of the Counter module. Draw a wire between the two ports.
3. Repeat the process between the Count_out(3:0) output of the Counter symbol
and the count_in(3:0) input of the display_drive symbol.
4. With the Add Wire icon still selected, we need to draw wires from the input and
output ports in order that we can make them into I/O pins. First click the clock_osc
port of the clock_divide symbol and draw a wire towards the left of the sheet. It
does not have to be too long. Then repeat the process with the reset, direction and
pause_design ports of the counter symbol. Then draw one wire below the other
input wires for the pause_design signal. Finally, draw a wire from the LED(6:0)
output of the display_drive symbol towards the right of the sheet.
Your schematic should now look like this:
2. The net naming options will appear in the process window. In the Name section, type
clock_ext and then click the end of the net you attached to the clock_osc port.
Type reset_ext and click the end of the net attached to the reset port. Then type
direction_ext and click the end of the net attached to the direction port. Then type
pause_design and click the end of the net attached to the pause_design port.
3. Finally, type LED_output(6:0) and click the end of the output of the
display_drive symbol.
I/O Markers
1. To make these named nets into I/O ports, select Add → I/O Marker or click the Add I/O
Marker tool from the Drawing toolbar:
2. Then click and hold the left mouse button and draw a box round each of the five
named nets. The direction of the port (input or output) will be correctly selected
automatically. The finished schematic should look like this:
3. Save the design (File → Save) and exit the Schematic Editor. You will notice that the
ISE software automatically recognizes that the schematic file is the top level file and
reorganzes the design accordingly.
In the Design Entry utilities, you can view the VHDL code that was created from the
schematic when top_sch was selected in the Sources window. The synthesis tool
actually works from this file.
Chapter 5
Synthesis
The XST synthesis tool will only attempt to synthesize the file highlighted in the Sources
window. In our design, “top.vhd” (for VHDL designs) or “top_sch” (for schematic
designs) instantiates three lower level blocks, “clock_divide”, “counter” and
“display_drive.” The synthesis tool recognizes all the lower level blocks used in the
top-level code and synthesizes them together to create a single bitstream.
1. In the Sources window, ensure that top.vhd is highlighted.
Note: If your top level is the schematic file top_sch, you will need to check the syntax of
the lower level VHDL files. You cannot perform a syntax check on a schematic file.
2. In the Process window, expand the Synthesis subsection by clicking on the “+” next
to Synthesize.
3. You can now check your design by double-clicking on Check Syntax. Ensure that any
errors in your code are corrected before you continue. If the syntax check is OK, a
check mark will appear.
The design should be okay because both the HDL Bencher tool and ISE Simulator have
already checked for syntax errors. (It is useful, when writing code, to periodically check
your design for any mistakes using this feature.)
After you have checked all the modules, highlight the top level module, then go down to
the process tree and right-click on Synthesize (under Implement Design) and select
Properties.
A window appears allowing you to influence the way in which your design is
interpreted. The Help feature will explain each of the options in each tab.
4. Highlight the Xilinx Specific Options category.
Constraints Editor
5. In the Xilinx Specific Options tab, ensure that the Add IO Buffers box is ticked. The
I/O buffers will be attached to all the port names in the top-level entity of the design.
Clicking on Help in each tab demonstrates the complex issue of synthesis and how the
final result could change. The synthesis tool will never alter the function of the design,
but it has a huge influence on how the design will perform in the targeted device.
6. Click OK in the Process Properties window and double-click on Synthesize.
7. When the synthesis is complete, a green tick will appear next to Synthesize. Double-
click on View Synthesis Report. The report file (.syr) will appear in ISE.
Constraints Editor
To get the performance you need from a device, you must tell the implementation tools
what and where performance is required. This design is particularly slow and timing
constraints are unnecessary. Constraints can also be physical; pin-locking is a physical
constraint.
In this example, we are going to download the design to the board from the CoolRunner-
II Design Kit so the signals need to be assigned to the correct pins to be able to see the
design running.
1. In the Process window, expand the User Constraints tree and double-click
Floorplan IO. As there is no constraints file present in the design, the software will
create a constraints file and call it “top.ucf.” It will be associated with your top level
source file.
Notice that the Translate step in the Implement Design section runs automatically.
This is because the implementation stage must see the netlist before it can offer you the
chance to constrain sections of the design. When translate has completed, the Xilinx
PACE (Pinout Area and Constraints Editor) tool opens. If there are already constraints
in the UCF file, these will be imported by PACE and displayed. As we have an empty
UCF file, nothing exists for PACE to import. In the Design Object List, you can enter a
variety of constraints on the I/O pins used in the design. PACE recognizes the five pins
in the design and displays them in the list.
2. Click in the Loc area next to each signal and enter the following location constraints:
clock_ext P38
direction_ext P124
LED_output<0> P56
LED_output<1> P53
LED_output<2> P60
LED_output<3> P58
LED_output<4> P57
LED_output<5> P54
LED_output<6> P61
pause_design P39
reset_ext P143
In addition, in the Datagate column for the signal clock_ext, select DATA_GATE. Also,
for the signal pause_design, look under the Globals column and set it to DATA_GATE.
This defines the control signal for all other inputs that have DataGATE selected. DataGATE
is a feature in CoolRunner-II that enables input pins to be electrically isolated from the
internal fabric of the device. The pin that turns this feature on and off is the DataGATE
enable or DGE pin. On this device, the DGE pin is P39, which is mapped to slide switch
Constraints Editor
SW0. Moving SW0 will show DataGATE blocking the clock signal from the device, thereby
pausing the design.
The direction_ext signal is also connected to one of the slide switches (in this case
SW2) which is connected to P124 of the device. Therefore, changing the position of SW2
changes the direction in which the counter counts.
The LED output signals are all located to the pins of the 4 digit seven segment display.
Finally, the reset_ext signal is connected to BTN0 on the main board. This corresponds
to P143.
3. Save the PACE session and exit the PACE tool. It is now possible to see the constraints
in the UCF file.
4. Select the top.ucf or top_sch.ucf file in the Sources window. The name of the
UCF depends on if you are using a schematic or HDL top level file. This will display
the processes available for a UCF file.
5. Now, under the User Constraints tab, double-click Edit Constraints (Text) in the
Process window. The UCF file will open in the main window of the ISE Project
Navigator.
The constraints entered into PACE can be seen in Figure 5-6.
Note: If you do not see the UCF file in the Sources window, add it by using Project → Add
Source.
CoolRunner-II architecture supports the use of non 50:50 duty cycle clocks by
implementing input hysteresis. This can be selected on a pin-by-pin basis. For example, if
the clock used in this design is an RC oscillator, the input hysteresis can be used to clean up
the clock using the following constraint syntax:
NET “clock” schmitt_trigger;
The CoolRunner-II CPLD also supports different I/O standards. If signals had to go to a
downstream device that required the signals to conform to a certain I/O standard, you
could use the following constraint syntax:
NET “net_name” IOSTANDARD=LVTTL;
The permissible standards are LVTTL, LVCMOS15, LVCMOS18, LVCMOS25, LVCMOS33.
On larger devices (128 macrocell and above), HSTL_I, SSTL2_I, and SSTL3_I are also
included. However, you can use only one I/O standard per bank, so take care when
assigning different I/O standards in a design.
The CoolRunner-II family has several features that are aimed at reducing power
consumption in the device. One of these features is known as CoolClock. The clock signal
on Global Clock Input 2 (GCK2) is divided by two as soon as it enters the device. All of the
registers clocked by this clock are then automatically configured as dual-edge triggered
flip-flops. The highest toggling net in the design will now be toggling at half the frequency,
which will reduce the power consumption of that net without compromising the
performance of the design. The CoolClock attribute can be applied by right-clicking on
GCK2 in PACE or by adding the following line in the UCF:
NET “clock” COOL_CLK;
However, we will not use these features in this tutorial. For more information on the use of
CoolRunner-II CPLDs, and their advanced features, visit the documentation section on
www.xilinx.com for a number of application notes, often including free code examples.
You must re-run translate so the new constraints can be read.
6. Select the top-level file in the Sources window to display the implementation
processes for the top-level design. This will be either top.vhd or top_sch.sch,
depending on if you are using a HDL or schematic top-level file.
7. Click on the “+” next to Implement Design in the Process window.
The implementation steps are now visible. An orange question mark indicates that
translate is now out of date and should be re-run.
8. A right-click on Implement Design allows you to edit the properties for each
particular step, as shown in Figure 5-7. Change the I/O Voltage Standard from
CPLD Reports
LVCMOS18 to LVCMOS33, and change the Unused I/O Pad Termination Mode to
Ground.
CPLD Reports
Two reports are available that detail the fitting results and associated timing of the design.
These are:
• The Translation Report shows any errors in the design or the UCF.
• The CPLD Fitter Report can be opened in two ways, either in a standard text window
within the ISE GUI or in a browser window.
1. To select which format to open, go to Edit → Preferences
2. Select ISE General in the Category box, then choose between HTML and Text under
CPLD reports.
CPLD Reports
3. To open the CPLD Fitter Report, expand the Fit branch and double-click on the Fitter
Report process.
The same information is contained in both the HTML and text reports, but the HTML
report has been designed to make the information more readable and easier to find. You
can browse through several sections of the HTML Fitter Report by using the menu on the
left-hand side of the page.
• The Summary section of the report gives a summary of the total resources available in
the device (macrocells, I/O pins, etc.), and how much is used by the design.
• The errors and warnings generated during fitting can be seen in the
Errors/Warnings section.
• The Inputs and Logic sections give information about signals, macrocells, and pins
in the fitted design. The key to the meaning of the abbreviations is available by
pressing the legend button.
• The Function Blocks summary looks into each function block and shows which
macrocell is used to generate the signals on the external pins. By clicking on a specific
function block (e.g., FB1) in the Function Blocks section, all of the macrocells in
that function block will be shown. Clicking on a specific macrocell will bring up a
diagram of how that macrocell is configured.
The XC2C256 device has 16 function blocks, of which only two have been used for
logic functions in this design. The design could be packed into a single function block,
but the chosen I/O pins dictate which macrocells (and hence which function blocks)
are used.
• A great feature of CPLDs is the deterministic timing, as a fixed delay exists per
macrocell. The Timing Report is able to give the exact propagation delays and
setup times and clock-to-out times. These values are displayed in the first section of
the report.
The next section lists the longest setup time, cycle time (logic delay between
synchronous points as constrained by the period constraint), and clock-to-out time.
The setup and clock-to-out times don’t strictly affect the design’s performance. These
parameter limitations are dependent on the upstream and downstream devices on the
board. The cycle time is the maximum period of the internal system clock.
The next section shows all the inputs and outputs of the design and their timing
relationship with the system clock. The clock to setup section details the internal nets
to and from a synchronous point. The maximum delay in this section dictates the
maximum system frequency.
The last section details all the path type definitions, explaining the difference between
the types mentioned previously in the report.
4. To generate a detailed timing report, right-click on Generate Timing in the Process
window (under Optional Implementation Tools) and select Properties → Timing
Report Format. Then, select Detail from the drop down menu.
3. First, you need to generate a configuration file for the device. Click the Generate
Programming File process:
If you are using the CoolRunner-II Starter Kit, and wish to use the USB cable provided,
continue to the next step. If you have a Xilinx programming cable (not provided in the kit)
and wish to use iMPACT for programming, jump to the section labeled “Configuration
Using iMPACT”.
4. Now that you have a programming file, you need to start the CoolRunner-II Utility
Window. If you have not already done so, install this software from the Resource CD
that came with the Starter Kit.
5. Ensure that the USB cable is plugged in to the computer and the board.
7. Click on the browse button ( shown as … next to the program text box ). Navigate to
the location of the JEDEC programming file and select it. The JEDEC file will be in the
directory that you have initially specified as the project directory. In this example it
would be c:\designs\tutorial. Press the Program button to erase the CPLD and
re-program it with the new design file.
The board will now be programmed with the design you created. It will count from 0 to F
in Hex and then start again at 0. You can reset the design by pressing BTN0. You can
change the direction of the count by moving slide switch SW1, and you can isolate the
clock from the device, thereby pausing the design by moving SW1.
6. A dialog box will appear with showing programming options. Select Configure
devices using Boundary-Scan (JTAG) and click Finish. iMPACT will appear.
7. Right-click on the Xilinx XC2C256 icon that appears in the iMPACT window and select
Program.
The board will now be programmed with the design you created. It will count from 0
to F in Hex and then start again at 0. You can reset the design by pressing BTN0. You
can change the direction of the count by moving slide switch SW4 and you can isolate
the clock from the device, thereby pausing the design by moving SW1
Introduction
Chapter 6
then generate the timing information before opening the simulator and giving timing
simulation results.
In this chapter, we’ll demonstrate the steps required to successfully implement our counter
and decoder design into a Spartan-3E FPGA.
Synthesis
Synthesis
The design as it stands from chapter 5 cannot be implemented directly into a Spartan-3E as
it contains the CoolRunner-II hard clock divider which is present only in the CoolRunner-
II family. Therefore, the clock_divide module must be edited to remove that block and
replace its functionality with logic. The oscillator on the Spartan-3E board is 50 MHz so the
clock divider must divide down more than in the CPLD design where the oscillator was
100 kHz.
1. Make the edits to the clock_divide.vhd module by removing the CLK_DIV16
component and using a 23-bit counter. The new code will look like this:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
library UNISIM;
use UNISIM.VComponents.all;
entity clock_divide is
Port ( clock_osc : in STD_LOGIC;
clock_div : out STD_LOGIC);
end clock_divide;
architecture Behavioral of clock_divide is
signal count : std_logic_vector(22 downto
0):="00000000000000000000000";
begin
process (clock_osc)
begin
if clock_osc='1' and clock_osc'event then
count <= count + 1;
end if;
end process;
clock_div <= count(22);
end Behavioral;
2. Save and close the clock_divide.vhd file.
3. In the Sources window, ensure that “top.vhd” (or “top_sch” for schematic flows)
is highlighted.
4. In the Process window, expand the Synthesis subsection by clicking on the plus sign
(+) next to Synthesize. You can now check your design by double-clicking on Check
Syntax.
Note: For schematic designs you will have to Check Syntax on the sub-modules.
Ensure that any errors in your code are corrected before you continue. If the syntax
check is OK, a green check mark will appear (as shown in Figure 6-3).
Note: The design should be okay because both the Bencher and XSim have already checked for
syntax errors. (It is useful, when writing code, to periodically check your design for any mistakes using
this feature.)
The synthesis tool will never alter the function of the design, but it has a huge influence on
how the design will perform in the targeted device.
Double-click Synthesize – XST to run the synthesis of the design. Then expand the
synthesis tree in the process window and double-click View Synthesis Report. The first
section of the report summarizes just the synthesis settings. Each entity in the design is
then compiled and analyzed. The next section in the report gives synthesis details and
documents how the design was interpreted.
Note: The state machine is one hot encoded, as each state name (red, amber, redamb, and green)
has been assigned its own 1-bit register.
When synthesis chooses to use primitive macros it is known as “inference.” As registered
outputs were selected in the state machine, three further registers were inferred.
The Final Report section shows the resources used within the FPGA.
5. Save (File → Save) and exit (File → Exit) the PACE session.
Note: You may encounter a dialog that asks you to define the bus delimiter. Select XST Default: <>
or XST Optional {}.
6. Click on the plus sign “+” next to Implement Design in the Process window.
FPGA Reports
7. Implement the design by double-clicking on Implement Design (you could run each
stage separately).
8. When there is a green tick next to Translate, Map, and Place and Route, your design
has completed the implementation stage.
A green tick means that the design ran through without any warnings. A yellow
exclamation point may mean that there is a warning in one of the reports. If you’ve
followed the design procedure outlined in this example, there should be no errors or
warnings.
FPGA Reports
Each stage has its own report. Clicking on the “+” next to each stage lists the reports
available:
• The Translate Report shows any errors in the design or the UCF.
• The Map Report confirms the resources used within the device and describes
trimmed and merged logic. It will also describe exactly where each portion of the
design is located in the actual device. A detailed Map Report can be chosen in the
properties for map.
• The Post-Map Static Timing Report shows the logic delays only (no routing)
covered by the timing constraints. This design has two timing constraints, the clock
period and the clock-to-out time of the three lights. If the logic-only delays don’t meet
timing constraints, the additional delay added by routing will only add to the
problem. Without a routing delay, these designs would run at 200 MHz!
• The Place and Route Report gives a step-by-step progress report. The place and
route tool must be aware of timing requirements. It will list the given constraints and
report how comfortably the design fell within – or how much it failed – the
constraints.
• The Asynchronous Delay Report is concerned with the worst path delays in the
design – both logic and routing.
• The Pad Report displays the final pin-out of the design, with information regarding
the drive strength and signalling standard.
• The Guide Report shows how well a guide file has been met (if one was specified).
• The Post Place and Route Static Timing Report adds the routing delays.
Notice that the max frequency of the clock has dropped.
WebPACK ISE software has additional tools for complex timing analysis and floor
planning, which are beyond the scope of this introductory book. To find out more about
advanced software tools, visit the software documentation page at our website:
http://www.xilinx.com/support/software_manuals.htm
Programming
Ensure that the Spartan-3E Design Kit board is powered and switch SWP set to the On
position.
A DLC9 Platform USB cable is required to configure the device from the iMPACT
Programmer. Ensure that the cable is plugged in to the computer and that the ribbon
cable/flying leads are connected properly to the board.
To program a Spartan-3E:
1. Right-click on Generate Programming File and click on Properties.
2. Under the Start-Up Options category, ensure that the FPGA Start-Up Clock is set to
JTAG Clock by selecting JTAG Clock from the drop-down menu. Click OK
Summary
The design created is now in the Spartan-3E, and, if you have attached the seven segment
displays to J1 and J2, you will see the counter counting up from 0 to F in Hex. Changing the
position of switch SW0 will reset the counter back down to zero, changing the position of
switch SW1 will change the direction from counting up to counting down.
Summary
This chapter has taken the VHDL or Schematic design through to a working physical
device. The steps discussed were:
• Synthesis and Synthesis Report
• Timing and Physical Constraints using the Constraints Editor
• The Reports Generated throughout the Implementation flow
• Creating and Downloading a bitstream.
Chapter 7
http://www.origin.xilinx.com/products/silicon_solutions/cplds/resources/coolvhdlq.
htm?url=/products/xaw/coolvhdlq.htm
Table 7-1: Current Reference Designs
Memory PDA
XAPP800: SPI Flash XAPP357: LED Test
XAPP394: CoolRunner-II Mobile SDRAM XAPP356: XPATH Handspring Design
Interface Module (VHDL & Pocket C)
XAPP384: CoolRunner-II DDR SDRAM XAPP355: Serial ADC Interface
Interface XAPP149: Oscilloscope
XAPP354: NAND Interface (ABEL) XAPP147: Low Power Design
XAPP354: NAND Interface (VHDL) XAPP146: 8 Channel Digital Volt Meter
XAPP354: NAND Interface (Verilog)
XAPP906: SD Card Multiplexer
XAPP944: Data Stream Switch
Microcontroller Wireless
XAPP432: LIN Controller Implementation XAPP358: Wireless Transceiver Customer
XAPP432: LIN I/O Module Pack
XAPP393: 8051 Microcontroller Interface for XAPP345: IrDA & UART Design (VHDL)
CoolRunner -II XAPP345: IrDA & UART Design (Verilog)
XAPP387: PicoBlaze Microcontroller
XAPP349: 8051 Microcontroller Interface for
CoolRunner XPLA3
CoolRunner-II Datacom
XAPP390: Digital Camera Design XAPP380: N x N Digital Crosspoint Switch
XAPP378: CoolRunner-II Example Designs XAPP383: SECDED
XAPP381: CoolRunner-II Demo Board XAPP372: Smart Card Reader
XAPP444: CPLD Fitting, Tips and Tricks XAPP328: MP3 for XPLA3
XAPP940: Stepper Motor Controller
CPLDs can deliver. For example, Figure 7-1 illustrates some of the applications we have
prepared for portable consumer applications, such as cell phones and PDAs.
For the same market we also supply application notes for using the inherent low power
characteristics and features of the CoolRunner CPLD .
instruction taking as long as three cycles – the actual speed of a 20 MHz microcontroller is
divided by 6. This works out to an operational speed of only 3.33 MHz.
CoolRunner CPLDs are much, much faster than microcontrollers and can easily reach
system speeds in excess of 100 MHz. Today, we are even seeing CoolRunner devices with
input-to-output delays as short as 3.5 ns, which equates to impressive system speeds as
fast as 285 MHz. CoolRunner CPLDs make ideal partners for microcontrollers, because
they not only can perform high-speed tasks, they can perform those tasks with ultra- low
power consumption.
Xilinx offers free software and low-cost hardware design tools to support CPLD
integration with microcontrollers. The Xilinx CPLD design process is quite similar to that
used on microcontrollers, you can quickly learn how to partition your designs across a
CPLD and microcontroller to maximum advantage.
Design Partitioning
As we noted before, microcontrollers are very good at computational tasks, and CPLDs are
excellent in high-speed systems, with their abundance of I/Os. Table 7-2shows how we
can use a microcontroller and a CPLD in a partitioned design to achieve the greatest
control over a stepper motor.
Emergency Stop
Stepper Motor
Speed
Speed and
and
Rx
FIFO
FIFO
Byte Direction
Direction M
Control
Control
Microcontroller
Microcontroller
UART
UART
Tx Byte
FIFO
FIFO
360°
Can be integrated as well
if FPGA is used rather than CPLD
Counter
Counter
Interrupt
Xilinx CPU Register
Register Motor Position
Feedback
Comparator
Comparator
Meanwhile, the UART and FIFO sections of the design can be implemented in the
microcontroller in the form of a microcontroller peripheral, or implemented in a larger,
more granular PLD such as an FPGA – for example, a Xilinx Spartan device. Using a PLD
in this design has the added benefit of gaining the ability to absorb any other discrete logic
elements on the PCB or in the total design into the CPLD. Under this new configuration,
we can consider the CPLD as offering hardware-based subroutines or as a mini co-
processor.
The microcontroller still performs ASCII string manipulation and mathematical functions,
but it now has more time to perform these operations – without interruption. The motor
control is now independently stable and safe.
End Markets
• Predictable performance/functionality.
IP cores are similar to vendor-provided soft macros in that they simplify the design
specification procedure by removing designers from gate-level details of commonly used
functions. IP cores differ from soft macros in that they are generally much larger system-
level functions, such as a PCI bus interface, DSP filter, or PCMCIA interface. They are
extensively tested (and hence rarely free of charge) to prevent designers from having to
verify the IP core functions themselves.
The Xilinx website has a comprehensive database of Xilinx LogiCORE and third-party
AllianceCORE verified and tested cores. To find them, visit the Xilinx IP Center at
www.xilinx.com/ipcenter. The CORE Generator tool from Xilinx delivers highly
optimized cores compatible with standard design methodologies for Xilinx FPGAs. This
easy-to-use tool generates flexible, high-performance cores with a high degree of
predictability. You can also download future core offerings from the Xilinx website. The
CORE Generator tool is provided as part of Xilinx Foundation ISE software.
End Markets
The eSP web portal is located within the “End Markets” section on the Xilinx website. It is
the industry's first web portal dedicated to providing comprehensive solutions that
accelerate product development. To make it as easy as possible, we provide a choice for
locating material:
Aerospace/Defense Industrial/Scientific/Medical
Automotive Test/Measurement
Consumer Wired Communications
Audio/Video/Broadcast Wireless Communications
To get there, visit: http://www.xilinx.com/esp/
You can select a specific market solution or a broad-reaching technology that interests you
and see what Xilinx can offer in that application area. The site was designed to decrease the
time spent in the pre-design phase. This phase, which increasingly has become the
designers’ Achilles’ heel, involves visiting seminars, learning new standards, assimilating
the data, analyzing market trends, and more.
The eSP web portal saves time by proving up-to-date information about emerging
standards and protocols, how and where they are used, impartial information about which
one is best for your application, and pre-tested reference designs that can be purchased
and used.
Design Consultants
The Xilinx XPERTS Program qualifies, develops, and supports design consultants,
ensuring that they have superior design skills and the ability to work successfully with
customers. XPERTS is a worldwide program that allows easy access to certified experts in
Xilinx device architectures, software tools, and cores.
XPERTS partners also offer consulting in the areas of HDL synthesis and verification,
customization and integration, system-level designs, and team- based design techniques.
A listing of partners in the Xilinx XPERTS program is located at
www.xilinx.com/ipecenter.
Technical Support
Xilinx provides 24-hour access to a set of sophisticated tools for resolving technical issues
via the Web. The Xilinx search utility scans through thousands of answer records to return
solutions for the given issue. Several problem-solver tools are also available for assistance
in specific areas, like configuration or install. A complete suite of one-hour modules is also
available at the desktop via live or recorded e-learning.
Lastly, if you have a valid service contract, you can access Xilinx engineers over the Web by
opening a case against a specific issue. For technical support, visit
www.support.xilinx.com.
Glossary
Glossary of Terms
ABEL – Advanced Boolean Expression Language, low-level language for design entry,
from Data I/O.
AIM – Advanced Interconnect Matrix in the CoolRunner-II CPLD that provides the flexible
interconnection between the PLA function blocks.
Antifuse – A small circuit element that can be irreversibly changed from being non-
conducting to being conducting with ~100 Ohm. Anti-fuse-based FPGAs are thus non-
volatile and can be programmed only once (see OTP).
AQL – Acceptable Quality Level. The relative number of devices, expressed in parts-per-
million (ppm), that might not meet specification or be defective. Typical values are around
10 ppm.
ASIC – Application Specific Integrated Circuit, also called a gate array. Asynchronous logic
that is not synchronized by a clock. Asynchronous designs can be faster than synchronous
ones, but are more sensitive to parametric changes and are thus less robust.
ASSP – Application-Specific Standard Product. Type of high-integration chip or chipset
ASIC that is designed for a common yet specific application.
ATM – Asynchronous Transfer Mode. A very high-speed (megahertz to gigahertz)
connection-oriented bit-serial protocol for transmitting data and real-time voice and video in
fixed-length packets (48-byte payload, 5-byte header).
Back Annotation – Automatically attaching timing values to the entered design format
after the design has been placed and routed in an FPGA.
Behavioral Language – Top-down description from an even higher level than VHDL.
Block RAM – A block of 2k to 4k bits of RAM inside an FPGA. Dual-port and synchronous
operation are desirable.
CAD – Computer Aided Design, using computers to design products.
CAE – Computer Aided Engineering, analyses designs created on a computer.
CLB – Configurable Logic Block. Xilinx-specific name for a block of logic surrounded by
routing resources. A CLB contains two or four LUTs (function generators) plus two or four
flip-flops.
CMOS – Complementary Metal-Oxide-Silicon. Dominant technology for logic and memory.
Has replaced the older bipolar TTL technology in most applications (except very fast ones).
CMOS offers lower power consumption and smaller chip sizes compared to bipolar and
now meets or even beats TTL speed.
ACRONYMS
ACRONYMS
ABEL Advanced Boolean Expression Language
ADC Analog-to-Digital Converter
AIM Advanced Interconnect Matrix
ANSI American National Standards Institute
ASIC Application Specific Integrated Circuit
ASSP Application Specific Standard Product
ATE Automatic Test Equipment
BGA Ball Grid Array
BLVDS Backplane Low Voltage Differential Signaling
BUFG Global Clock Buffer
CAD Computer Aided Design
CAN Controller Area Network
CBT Computer Based Training
CDMA Code Division Multiple Access
CE Clock Enable
CLB Configurable Logic Block
CLK Clock Signal
CMOS Complementary Metal Oxide Semiconductor
CPLD Complex Programmable Logic Device
CSP Chip Scale Packaging
DCI Digitally Controlled Impedance
DCM Digital Clock Manager
DCM Digital Control Management
DES Data Encryption Standard
DRAM Dynamic Random Access Memory
DRC Design Rule Checker