37
Introduction to FPGA Guan-Lin Wu

Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Embed Size (px)

Citation preview

Page 1: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Introduction to FPGA

Guan-Lin Wu

Page 2: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Outline

Introduction to PLDIntroduction to FPGAFPGA Example – Altera Cyclone IIAltera Quartus II Lab

Page 3: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

World of Integrated Circuits

Full-CustomASICs

Semi-CustomASICs

UserProgrammable

PLD FPGA

Page 4: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Digital Logic

Connect Standard Logic ChipsVery Simple Glue Logic

Black Box SUM of PRODUCTS

FIXED Logic

Truth Table

Boolean Logic Minimisation

Transistor Switches

Digital Logic Function

3 InputsProduct AND (&)Sum OR (|)

Page 5: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Programmable Logic Devices PLDs

Sum of Products

Un-programmed StateDifferent TypesSUM of PRODUCTSPrefabricatedProgrammble LinksReconfigurable Logic Function

Programmed PLDProduct Terms

Sums

Planes ofANDs, ORs

ANDs

OR

Inputs

Page 6: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

How can we make a “programmable logic”?

SRAM-basedReconfigurableTrack latest SRAM technologyVolatileGenerally high power

Anti-fuse techniqueOne-time programmableNon-volatile – security app.

Page 7: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Complex PLDs

CPLDsProgrammable PLD BlocksProgrammable InterconnectsElectrically Erasable links

CPLD Architecture

Feedback Outputs

Page 8: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Field Programmable Gate Arrays FPGAField Programmable Gate Array

New Architecture ‘Simple’ Programmable Logic BlocksMassive Fabric of Programmable Interconnects

Large Number of Logic Block ‘Islands’1,000 … 100,000+in a ‘Sea’ of Interconnects

FPGA Architecture

Page 9: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Logic Blocks

Logic Functions implemented in Lookup Table LUTsMultiplexers (select 1 of N inputs)Flip-Flops. Registers. Clocked Storage elements.

16-bit SR

flip-flop

clock

muxy

qe

abcd

16x1 RAM4-input

LUT

clock enable

set/reset

FPGA Fabric Logic Block

Page 10: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Lookup Tables LUTs

LUT contains Memory Cells to implement small logic functionsEach cell holds ‘0’ or ‘1’ .Programmed with outputs of Truth TableInputs select content of one of the cells as output

16-bit SR

flip-flop

clock

muxy

qe

abcd

16x1 RAM4-input

LUT

clock enable

set/reset

3 Inputs LUT -> 8 Memory Cells

Static Random Access MemorySRAM cells

3 – 6 Inputs

Multiplexer MUX

Page 11: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Logic Blocks

Larger Logic Functions built up by connecting many Logic Blocks together

Page 12: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Clocked LogicFlip Flops on outputs. CLOCKED storage elements.Sequential Logic Functions (cf Combinational Logic LUTs)Pipelines. Synchronous Logic Design FPGA Fabric driven by Global Clock (e.g. BX frequency)

16-bit SR

flip-flop

clock

muxy

qe

abcd

16x1 RAM4-input

LUT

clock enable

set/reset

FPGA Fabric

Clock

Page 13: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Circuit Compilation

LUT

LUT

?

Assign a logical LUT to a physical location.

Select wire segmentsAnd switches forInterconnection.

1. Technology Mapping

2. Placement

3. Routing

Page 14: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Routing Example

Programmable Connections

FPGA

Page 15: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Which Way to Go?

Off-the-shelf

Low development cost

Short time to market

Reconfigurability

High performance

ASICs FPGAs

Low power

Low cost inhigh volumes

Page 16: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Other FPGA Advantages

Manufacturing cycle for ASIC is very costly, lengthy and engages lots of manpower

Mistakes not detected at design time have large impact on development time and costFPGAs are perfect for rapid prototyping of digital circuits

Easy upgrades like in case of softwareUnique applications

reconfigurable computing

Page 17: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Major FPGA Vendors

SRAM-based FPGAsXilinx, Inc.Altera Corp.AtmelLattice Semiconductor

Flash & antifuse FPGAsActel Corp.Quick Logic Corp.

Share over 60% of the market

Page 18: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

FPGA Example –Altera Cyclone II

Page 19: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Cyclone II EP2C20 Block

Logic array – LUTsBlock memory –M4K blocksEmbedded MultipiersInput/output Modules (IOEs)PLLs

Page 20: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Cyclone II EP2C20 Block

Logic ArrayLogic Array

M4K MemoryM4K MemoryBlocksBlocks

EmbeddedEmbeddedMultipliersMultipliers

PhasePhase--LockedLockedLoopsLoops

I/OI/OElementsElements

Page 21: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Cyclone II EP2C20

18,752 LEs52 M4K RAM blocks 240K total RAM bits 52 9x9 embedded multipliers 4 PLLs16 Clock networks315 user I/O pins SRAM Based volatile configuration

Page 22: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Logic Element

16 LEs forms a Logic Array Block (LAB)Normal modeArithmetic mode

Page 23: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Logic Element

Page 24: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Logic Element

Normal Mode – general logic operations

Page 25: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Logic ElementArithmetic Mode – adder, counter, accumulators, comparator

Page 26: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Logic Array Blocks Structure

Page 27: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Cyclone II Logic Array Block (LAB)

16 LEsLocal InterconnectLE carry chainsRegister chains

LE1

LE2

LE3

LE4

LE13

LE14

LE16

LE15

4

4

4

4

4

4

4

4Fast

Loc

al In

terc

onne

ct

Direct link interconnect

to left

Direct link interconnect

to right

Page 28: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Row Interconnect Connections

Direct link, R4, R24 interconnects

Page 29: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Column Interconnect Connections

Register chain, C4, C16

Page 30: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Register Chain Interconnects

LEs can be connected for implementing fast adder, counters, shift register

Page 31: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

M4K RAM

Page 32: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Cyclone II I/O FeaturesIn/Out/Tri-stateDifferent Voltages and I/O Standards

PCI, PCI-X, LVDS I/O standardFlip-flop optionPull-up resistorsDDR interfaceSeries resistorsBus keeperDrive strength controlSlew rate controlSingle ended/differential

Page 33: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Advance Architecture onModern FPGAs

Page 34: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

More Guts

Additional componentsDedicated computation unitsProcessor coresDSP blocks

Page 35: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Dedicate Arithmetic Blocks

AlteraXilinx

QuickLogic

Page 36: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Processor Cores

Page 37: Introduction to FPGA - 國立臺灣大學cc.ee.ntu.edu.tw/~jhjiang/instruction/courses/fall11-cvsd/LN13... · Digital Logic Connect Standard ... Synchronous Logic Design zFPGA Fabric

Altera DE2-70