Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

FPGA

MSc. Jorge L. López Córdova


lntroduction to FPGAs

MSc. Jorge L. López Córdova


lntroduction
► An FPGA is a device that contains a matrix of reconfigurable
gate array logic circuitry.
► When a FPGA is configured, the intemal circuitry is connected
in a way that creates a hardware implementation of the
software application.
► Unlike hard-wired printed circuit board (PCB) designs which
have fixed hardware resources, FPGA-based systems can
rewire their intemal circuitry to allow reconfiguration after the
control system is deployed to the field.
► FPGA devices deliver the performance and reliability of
dedicated hardware circuitry.
lntroduction
► Unlike processors, FPGAs use dedicated hardware for
processing logic and do not have an operating system.
► FPGAs are truly parallel in nature so different processing
operations do not have to compete for the same resources. As a
result, the performance of one part of the application is not
affected when additional processing is added.
► Also, multiple control loops can run on a single FPGA device
at different rates.
► A single FPGA can replace thousands of discrete components
by incorporating millions of logic gates in a single integrated
circuit (IC) chip.
FPGA

Just about all FPGAs include a regular,


programmable, and flexible architecture of logic
blocks surrounded by input/output blocks on the
perimeter. These functional blocks are linked
together by a hierarchy of highly versatile
programmable interconnects.
Architecture of FPGA

► "Aprogrammable
Field programmable gate array (FPGA) is a
logic device that supports
implementation of relatively large logic circuits."

► As the name suggests ,Field Programmable


Gate Arrays the standard logic elements are
available for the designer and he has only to
interconnect these elements to achieve the
Architecture of FPGA

► The architecture of FPGA is very simple than


other programmable devices

Elements of FPGA
► The basic elements of an Field Programmable
Gate Array are:
Configurable logic blocks(CLBs)
e inputs and outputs
Architecture of FPGA
The following figure represents the
architecture of a single CLB.

The configurable logic block which is RAM based


or PLD based is the basic logic cell. lt consists of
registers (memory), muxes and combinatorial
functional unit.

An array of CLBS are embedded a set of


vertical and horizantal channels that contain
Routing witch can be personalized to
internconnect CLB.
The following figure represents the
architecture of a single CLB.
The following figure represents the
architecture of a single LTU.
Programmable interconnects

These are unprogrammed interconnection


resources on the chip which have channeled
routing with fuse links.

Programmable highly interconnect matrix is


available. In this case the design is that of the
interconnections and communications only.
Why FPGA?
Digital Logic
Digital Logic Function
() o o ()
O
I
O 1
O I O
1
U Product ANO(&)
3 lnputs o , 1 1 Y= l 1l'&"5ó c J 1111e.t i & c ) 1( .s ,:,, & ~ J 1 ( .AtlcP G.' )
Sum OR (1)
:g~ : 5u,.,...,f- Fl-MJctc. &p1Mdct 1
1 1 O O
1 1 1 O

Black Box Truth Table SUM of PRODUCTS

Boolean Logic Minimisation


8

CMOS NAND gate

Connect Standard Logic Chips 7


X1 x:, 'T1 Tl n T ◄r
Very Simple Glue Logic O O On C:n Off on 1
O 1 OnOltOIIOf1 1
FIXED Logic 1 o orro.io.on1
1 l Ort Off OII Of1 O

Transistor Switches
Why FPGA?
Digital Logic Meant:

► Fixed hardware = Fixed usability


► Limited flexibility only possible by adding software support,
for example p rocessors
► Upgrade or alteration in hardware logic was not guaranteed
► An upgrade meant a completely new system
Why FPGA?
Programmable Logic
a b e -!E- Predefine:l lilk
+ Proura'll matlle link Un-programmed State
1

lnputs Planes of
ANDs, ORs

Predefin ea MD array IN ~ y
w= a&:b&e'
x= abe+ abe'+ ab'e'
y= abe'+ ab'e'
Logic Function

Sums
Sum of Products

"' ;¡ t, ¡; e ¡
'- - - - ' ~
r r ,.lfnlil1,y
,- ..
1-N0~n;,¡ Programmed PLD
w J

Product Terms Y=f.i ll. 1-t.c¡


.o<-(.~& ~&c)I ~&°Z¡

W: [A r.r.) 1<6t.Z1
Why FPGA?
► PROM
► The first type of user-programmable chip that could implement
logic circuits was the Programmable Read-Only Memory
(PROM), in which address lines can be used as logic circuit
inputs and data lines as outputs.

Drawbacks:
► Logic functions require more than a few product terms
► A PROM requires a full decoder for its address inputs.
► PROMS are thus an inefficient architecture for realizing logic
circuits -> Hence, they are rarely used in practice for that
purpose.
Why FPGA?
PLAs
► Carne as Replacement to PROMs
► Logically, a PLA is a circuit that allows
implementing Boolean functions in sum-of• Sums
product form.
► The typical implementation consists of input
buffers for all inputs, the programmable AND• ~
l "t ~ rt l ' rul l ; i e
1-.NOA1r1,

matrix followed by the programmable OR• Product Terms


., )( :,

►.)'=f.Al.l>&c)
matrix, and output buffers. ,-(.,11 h\~)I $6.CI

► The input buffers provide both the original and


•'=[;id. O) l(ii&~I

the inverted values of each PLA input. The


input lines run horizontally into the AND
matrix, while the so-called product-term lines
run vertically.
PLA Drawbacks:

► Expensive to manufacture
► offer poor speed-performance.
► Both disadvantages are due to the two levels of configurable
logic, because programmable logic planes are difficult to
manufacture and introduce significant propagation delays.
Why FPGA?
► PALs
► To overcome the weaknesses of PAL, Programmable Array
Logic (PAL) devices were developed.
► PALs provide only a single level of programmability,
consisting of a programmable "wired" AND plane that feeds
fixed OR-gates.
+
* Preaafim,d
IFrn!llalTllmab'le llllilK Un-programmed State
1
WA.
link:

Planes of
AINDs, ORs

prgoof,in ecl AP<ID.urray

:1=(61&b&o)

x =( a & l:>& c ) 1 (b &e } Logiic Functlcn


w= (,i;i &e;:) 1 (y& c:)
Why FPGA?
How FPGA is different over PLA and PALs?

► FPGA provides its user a way to configure:

► 1. The intersection between the logic blocks and


► 2. The function of each logic block.
Architecture

□ ~ "IC.'.-.::8 3813:
ooooo~
□ i()----11188:
PROGR.41"\(MABLE
! 5 () 00 0 0 0 0 0
JNTERCONNECT
¡oo ooooo 1/0BLOCKS

...
o¡ 11na2:
~000000...

I.OGIC BI.O CKS

Internal Structnre of FPGA


Architecture
FPGA

Programmable Connections

fnltulti

Note: Figure lntended Only far Understanding of the Concept


Architecture
► The internal resources of an FPGA chip consist of a matrix of
configurable logic blocks (CLBs) surrounded by a periphery of
I/O blocks
► Signals are routed within the FPGA matrix by programmable
interconnect switches and wire routes.
Architecture: Logic Blocks
► Logic block of an FPGA can be configured in such a way
that it can provide functionality as simple as that of
transistor or as complex as that of a microprocessor.
► It can used to implement different combinations of
combinational and sequential logic functions.
► Logic blocks of an FPGA can be implemented by any of
the following:
l. n-input Lookup tables
2. Multiplexers
3. Flip-Flops
4. Buffers
Architecture: Interconnects
► Routing in FPGAs consists of wire segments of varying lengths
which can be interconnected via electrically programmable
switches.
► Density of logic block used in an FPGA depends on length and
number of wire segments used for routing.
► Number of segments used for interconnection typically is a
trade-off between density of logic blocks used and amount of
area used up for routing.
Simplified Architecture
-
□□ □□ □□ □□ -- 7,- Logic
--

block
-a

1 1

110 block

□ □ □ □ □

□ □ 1
□ 1
□ □ □


□ □ 1
□ 1
□ □ □

□ □ □ □ □
□ □ 1 1

□□ □□ □□ □□
Simplifled Internal S tructure of FPGA

---------------------------------------------------------------------------------------------------------------------------------
FPGA Structural Classification
► Basic structure of an FPGA includes Logic elements,
Programmable interconnects and Memory.
► Arrangement of these blocks is specific to particular
manufacturer.
► On the basis of intemal arrangement of blocks FPGAs can be
divided into three classes:
► Symmetrical arrays
► Row based architecture
► Hierarchical PLDs
Symmetrical arrays

-
□□ □□ □□ □□.. - 7- Logíc


block
·-
1 1 1

□ □ □
1/0 b l o c k -0 1

□ 1 1


□ □ □ 1
□ □ 1 1



□ □ □ 1
□ □ 1 1


□ □ □ □ □ □
□ 1 1 1

□□ □□ □□ □□
---------------------------------------------------------------------------------------------------------------------------------
Symmetrical arrays
► This architecture consists of logic elements (called CLBs)
arranged in rows and columns of a matrix and interconnect laid
out between.
► This symmetrical matrix is surrounded by I/O blocks which
connect it to outside world. I/O blocks also control functions
such as tri-state control, output transition speed.
► Each CLB consists of n-input Lookup table and a pair of
programmable flip flops.
► Interconnects provide routing path. Direct interconnects
between adjacent logic elements result smaller delay compared
to general purpose interconnect.
Row based Architecture

1 1/0 Hlocks
1
1111 1111111 111111111 111 11111111 1111111
Logic
1 Hl.ock
Rounng Rows
Cbanuels 1 1 ■■1 ■■■■■■■■■■■■■1 ■■■■■1 ■■1 ■■■■■■■■1 1

111111 111111 1111 111111 111111 1111 111111


1

111111 111111 1111 111111 111111 1111 111111


1

1 1 ■■1 ■■■■■■■■■■■■■1 ■■■■■1 ■■1 ■■■■■■■■1 1

1 1/iO :Blocks 1
Row based Archítecture
Row based Architecture
► Row based architecture consists of altemating rows of logic
modules and programmable interconnect tracks.
► I/O blocks is located in the periphery of the rows.
► One row may be connected to adjacent rows via vertical
interconnect.
► Logic modules can be implemented in various combinations.
► Combinatoria! modules contain only combinational elements
while Sequential modules contain both combinational elements
along with flip flops. Thus, sequential module can implement
complex combinatorial-sequential functions.
Hierarchical PLDs

1/0 Block

~ ..:;;:
~ tJ!
,_o
1= -= ~

o~ o
1- .....
......

......... .._.. 'Intercennecrs


110, B:lock

Hterarchíeal PLD·
Hierarchical PLDs
► This architecture is designed in hierarchical manner with top
level containing only logic blocks and interconnects.
► Each logic block contains number of logic modules. And each
logic module has combinatoria! as well as sequential functional
elements.
► Communication between logic blocks is achieved by
programmable interconnect arrays.
► Input output blocks surround this scheme of logic blocks and
interconnects.
FPGA Classification on user programmable
switch technologies
So far We have understood that,
► FPGAs are based on an array of logic modules and a supply of
uncommitted wires to route signals.
► In gate arrays these wires are connected by a mask design
during manufacture.
► In FPGAs, however, these wires are connected by the user and
therefore must use an electronic device to connect them.
FPGA Classification on User
__Programmable__ Switch_ technologies _
► Three types of devices based on how interconnects are
configured:

► Pass transistors controlled by an SRAM cell,


► Flash or EEPROM cell to pass the signal,
► Direct connect using anti-fuses.
SRAM Based FPGA
Logíc CeH ■■■ Legíc CeH

, - - - - - .. 1
1 1 1

: ::
1..
1
i 1
---- .
■■■
~ ..

Lo gk Cel l Logíc CeH


SRAM Based FPGA

► SRAM cells find two applications in FPGA:

► for controlling the gate nades of pass-transistor switches


and
► to control the select lines of multiplexers that drive logic
block inputs.
► Whether an FPGA uses pass-transistors or multiplexers or both
depends on the particular product.
SRAM Based FPGA
Advantages:
► The majar advantage of SRAM based FPGA is that they are
infinitely re-programmable.
► The function can be changed quickly by merely changing the
contents of a PROM (Extemal Memory to store program).
► The function can be updated on-field, the field by uploading
new application code, a feature attractive to designers.
Disadvantages:
► It <loes result in large number of interconnects. The
interconnect elements have high impedance and capacitance
and consume more area than other technologies.
► They need to be reprogrammed each time when power is
applied
► They _need_an _extem al_m emory to store p rogram _
EEPROM Based FPGA
► The EEPROM/FLASH cell in FPGAs can be used in two ways,
as a control device as in an SRAM cell or as a directly
programmable switch.

Advantages:
► They are non-volatile so they do not require an extra PROM
for loading.

Disadvantages:
► The EEPROM process is complicated.
FPGA Design Flow

Design Entrv N - - - - - .

Stmulatíon

Desígn
Ceusrratuts Synthesís

Place and Ronte

Download
FPGA Design Flow
► 1. System Design
At this stage designer has to decide what portian of his
functionality has to be implemented on FPGA and how to
integrate that functionality with rest of the system.

►2. Design Entry


► The option of Schematic capture is more or less ruled out,
designs have become more
► Designer describes design functionality by using one of the
various Hardware Description Languages (HDLs) like Gezel,
Verilog or VHDL.
FPGA Design Flow
►3 Simulation
. Functional simulation.
► A simulator is used to execute the design and confirm that
► the correct outputs are produced for a given set of test inputs.
► Although problems with the size or timing of the hardware
may appear later, the designer can at least be sure that his
logic is functionally correet before going on to the next stage
of development.
FPGA Design Flow
► 4. Synthesis
►First, an intermediate representation of the hardware design is
produced. This step is called synthesis and the result is a
representation called a Netlist.
►The Netlist is device independent, so its contents do not
depend on the particulars of the FPGA or CPLD; it is usually
stored in a standard format called the Electronic Design
Interchange Format (EDIF).
FPGA Design Flow
►5. Place and Route
►This step involves mapping the logical structures described
in the netlist onto actual macrocells, interconnections, and
input and output pins. The result of the place & route
process is a bitstream.
►Each CPLD or FPGA (or family) has its own, bitstream
format.
►We can say that the bitstream is the binary data that must be
loaded into the FPGA or CPLD to cause that chip to
execute a particular hardware design.
FPGA Design Flow
►6. Design Verification
► Bit stream file is fed to a simulator which simulates the
design functionality and reports errors in desired behavior of
the design.

Later the design is loading onto the target FPGA device and
testing is done in real environment.
Hardware Design V/ S Software Design
► A description of the hardware's structure and behaviour is
written in a high-level hardware description language (usually
VHDL or Verilog) and that code is then compiled and
downloaded prior to execution.
► In Software Development, the logic is implemented using
coding languages. In Embedded applications, firmware is
written using Embedded C etc
► The most striking difference between hardware and software
design is the way a developer must think about the problem.
Hardware Design V/ S Software Design
► Software developers tend to think sequentially, even when they
are developing a multi-threaded application. The lines of
source code that they write are always executed in that arder, at
least within a given thread
► During design entry, hardware designers must think and
program in parallel. All of the input signals are processed in
parallel, as they travel through a set of execution engines-each
one a series of macrocells and interconnections-toward their
destination output signals. Therefore, the statements of a
hardware description language create structures, all of which
are "executed" at the very same time.
Dualism of Hardware and Software Design

The dualism of hardware and software design


Hardware Software
Design paradigm Decomposition in space Decomposition in time
Resource cost Area (# of gates) Time (# of instructions)
Constrained by Time (clock cycle period) Area (CPU instruction set)
Flexibility Must be designed-in Implicit
Parallel i sin Irnplicit Must be designed-in
Modeling Model =/= Itn plementation Model "' Implementation
Reuse U ncommon Common
Design Paradigm
► In a hardware model, circuit elements operate in parallel. Thus,
by using more circuit elements, more work can be done within
a single clock cycle.
► Software executes instructions sequentially. By using more
instructions, a software program will take more time to
complete.
► Thus, a hardware designer salves problems by dividing
complex design into simpler hardware blocks (called
decomposition in space), while a software designer salves
problems by dividing it to simpler software sub-routines (called
decomposition in time)
Resource Cost
► Decomposition in space, as used by a hardware designer,
means that more gates are required for when a more complex
design needs to be implemented.
► Decomposition in time, as used by a software designer, implies
that a more complex design will take more instructions to
complete.
► Therefore, the resource cost for hardware is circuit area, while
the resource cost for software is execution time.
Design Constraints
► A hardware designer is constrained by the clock cycle period of
a design. A software designer, on the other hand, is limited by
the memory space available with the processor.
► Thus, the design constraints for hardware are in terms of a time
budget, while the design constraints for software are fixed by
the memory space of CPU.
Flexibility
► Flexibility is the ease by which the application can be modified
or adapted after the target architecture for that application is
manufactured.
► In software, flexibility is essentially free. In hardware on the
other hand, flexibility is not freely available. Hardware
flexibility requires circuit elements that can be easily reused for
different activities or functions in a design.
► Software excels over hardware in the support of application
flexibility.
Parallelism
► Parallelism is the most obvious approach to improving
performance.
► For hardware, parallelism comes for free as part of the design
paradigm.
► For software, on the other hand, parallelism is a majar
challenge. A truly parallel software implementation can be
made only if multiple processors are available, but inter•
processor communication and synchronization become a
challenge.
Modelling
► In software, modelling and implementation are very clase.
Indeed, when a designer writes a C program, the compilation of
that program for the appropriate target processor will also
result in the implementation of the program!
► In hardware, the model and the implementation of a design are
distinct concepts.
Reuse
► The idea of reuse is that a component of a larger circuit or a
program can be later reused in the context of a different design.
► In software, re-use is quite popular. When designing a
complex program these days, designers will start from a set of
standard libraries that are well-documented.
► For hardware design, re-use is not yet popular. Sorne IP cores
are available for FPGAs.
TENDENCIA DE LOS MICROCONTROLADORES
Additional Video Resources

► https://www.youtube.com/watch?v=gUsHwi4M4xE

► https://www.youtube.com/watch?v=CLUoWkJUnNO

---------------------------------------------------------------------------------------------------------------------------------
GRACIAS POR SU ATENCIÓN

You might also like