kv_nptel_pld_pres_1.ppt [compatibility mode]

37
7/18/2014 1 1 Digital System Design with PLDs and FPGAs Programmable Logic Devices Kuruvilla Varghese DESE Indian Institute of Science Kuruvilla Varghese 2 Kuruvilla Varghese Introduction Idea: Memory as Programmable Logic 00 0 01 1 10 1 11 0 A1 A0 D0 X Y X XOR Y Address lines as inputs Data line as output Truth table is the content

Upload: ngonguyet

Post on 12-Feb-2017

228 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

1

1

Digital System Design with PLDs and FPGAs

Programmable Logic Devices

Kuruvilla Varghese

DESE

Indian Institute of Science

Kuruvilla Varghese

2

Kuruvilla Varghese

Introduction

• Idea: Memory as Programmable Logic

00 0

01 1

10 1

11 0

A1

A0

D0

X

Y

X XOR Y

Address lines as inputs

Data line as output

Truth table is the content

Page 2: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

2

3

Kuruvilla Varghese

PROM

A1 A0

A1/ A0/

A1/ A0

A1 A0/

A1 A0

D1

D0

4 , 2 bits

4

Kuruvilla Varghese

PROM: Programmable Read Only Memory

• Combinational Circuit: Program Truth Table

• Fixed AND, Programmable OR

• 2n Minterms (n-input AND gates)

• Sharing of Minterms by outputs

• Large Area because of 2n AND gates

• Can we reduce AND gates ?

– Yes, But should be programmable

– Then Minterms Product Terms (PLA)

Page 3: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

3

5

Kuruvilla Varghese

PLA: Programmable Logic Array

D1

D0

A1 A0

6

Kuruvilla Varghese

PLA: Programmable Logic Array

• Programmable AND

• Programmable OR

• < 2n Product Terms (2n-input AND gates)

• Sharing of Product Terms by outputs

• Programming Overhead

• For a single output, programmable OR is not required, if one

can disable product terms

Page 4: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

4

7

Kuruvilla Varghese

PAL: Programmable Array Logic

A1 A0

O1

O2

8

Kuruvilla Varghese

PAL: Programmable Array Logic

• Programmable AND

• Fixed OR

• < 2n Product Terms (2n-input AND gates)

• Dedicated Product Terms for outputs

Page 5: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

5

9

Kuruvilla Varghese

Evolution

– PROM: Programmable Read Only Memory

Fixed AND, Programmable OR

– PLA: Programmable Logic Array

Programmable AND, Programmable OR

– PAL: Programmable Array Logic

Programmable AND, Fixed OR

Kuruvilla Varghese

PAL16L8

Source: Texas Instruments Data sheets

Page 6: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

6

11PAL16L8

Kuruvilla Varghese Source: Texas Instruments Data sheets

12Input/Output structure

• Output

– Enable Tri-state

– Blow all input connections

of the control AND gate,

wired AND with pull up

• Input

– Disable Tri-state Gate

– Retain all connections of

control AND gate

• Input/Output

– Program Control AND gate

with control product term

• Disable any AND gate

– Retain all input connections

• Cascade

– More than 7 Product Terms

• Feedback

– Latch

Kuruvilla Varghese

Page 7: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

7

13Cascading

• 17 Product terms

Kuruvilla Varghese

14Cascading / 17 PT

Kuruvilla Varghese

7

6

4

Source: Texas Instruments Data sheets

Page 8: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

8

15Cascading / 17 PT

Kuruvilla Varghese

7

7

3

Source: Texas Instruments Data sheets

16Cascading

• 7 + 6 + 4

– 3 passes

– 3 section delays

– 8 Sections (7 + 6x7 = 49

PTs), 8 passes

• (7 + 7) + 3

– 2 passes

– 2 section delays

– 8 sections (7 x 7 = 49 PT), 2

passes

• Cascading

– Reduce the number of

passes avoiding chain

Kuruvilla Varghese

Page 9: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

9

17Simple PLD’s

• Devices

– PAL16L8 x

– PAL16R4 x

– PAL16R8 x

– PAL22V10

• Manufacturers

– Atmel

• Feature

– Wide Decoding

– e.g. AND Gate with 16 inputs, and 16 complements

– Earlier used for Chip select decoding of memory and peripherals

– Higher order address bits were decoded

Kuruvilla Varghese

18Present Day Scenario

• Present Day SoC’s have

• Built in RAM, Peripherals

• Built in Configurable Chip

Select decoding

• Less use of SPLD’s like

PAL16L8

Kuruvilla Varghese

Micro

Processor

Peripher

als

Address

Control

CS

Deco

der

Data

Page 10: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

10

19Present Day Scenario

• Serial Interface for external

peripherals

• Clock, data

• Multiple Slaves

• Address part of Data Frames

• Read / write

• Multiple Masters, Arbitration

• SPI, I2C

Kuruvilla Varghese

Micro

ProcessorPeripheral

Serial Clock

Data

Kuruvilla Varghese

PAL16R4

Source: Texas Instruments Data sheets

Page 11: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

11

21PAL16R4

Kuruvilla Varghese Source: Texas Instruments Data sheets

22Datapath

Kuruvilla Varghese

D Q

CLK

D Q

CLK

Comb

clk

Page 12: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

12

23Datapath => PAL

Kuruvilla Varghese

FF/Reg

Comb

FF/Reg

Ouput

Input

Input

Input

Source: Texas Instruments Data sheets

24FSM

Kuruvilla Varghese

Next

State

Logic

D

CK Q

AR

Output

Logic

NS

PS

OutputsInputs

Clock

Reset

Page 13: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

13

25FSM => PAL

Kuruvilla Varghese

NSL

FF/Reg

Output

Input

Input

Input

OL

Source: Texas Instruments Data sheets

26FSM

Kuruvilla Varghese

LogicD

CK Q

AR

NSPS

Outputs

Inputs

Clock

Reset

Page 14: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

14

27FSM => PAL

Kuruvilla Varghese

Logic

FF/Reg

Output

Input

Input

Input

Logic

Source: Texas Instruments Data sheets

28Substitution

• Substitution

– x = ab/ + cd

2 PT’s 1 pass delay

– y = x + ef + ghi/

3 PT’ s 2 pass delay

• Substitute x in y

– y = ab/ + cd + ef + ghi/

4 PTs 1 Pass delay

• Virtual Substitution

– Uses unused PTs

– Reduces delay

Kuruvilla Varghese

Page 15: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

15

29Substitution

Kuruvilla Varghese Source: Texas Instruments Data sheets

30Substitution

• Pathological case: xor

a xor b = ab/ + a/b 2 PTs

a xor b xor c 4 PTs

a xor b …xor n 2n-1

PTs

• Priority Encoders

• Adders/Subtractors

• Attribute to turn of virtual

substitution

Kuruvilla Varghese

Page 16: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

16

Kuruvilla Varghese

PAL22V10

Source: Texas Instruments Data sheets

32PAL22V10 - Macrocell

Kuruvilla Varghese Source: Texas Instruments Data sheets

Page 17: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

17

33PAL22V10

• Variable Product Terms

• Asynchronous Reset

Product Term

• Synchronous Preset

Product term

• Combinational / Registered

output

• Product Term Optimization

by Inversion

• PT Optimization

– Y = A/C + AB + BC + AC/

– Y/ = AB/C + A/C/

• Timing

– tpd

– ten, tdis

– tcq, ts, th, tres

– With / without feedback

Kuruvilla Varghese

34PLD 22V10 Fitting

• Is it possible to implement an 8 bit odd parity generator in a PLD

22V10 ? i.e. parity generator has 8 data inputs and one parity

output

• One has to check the following I/O requirements and product term

requirements.

• No: of inputs = 8 < 12 dedicated inputs of 22V10

• No: of outputs = 1 < 10 I/Os of 22V10

• Ex-or of n variables results in 2n-1product terms.

• We assume tool expands the EXOR’s to complete product terms

than implementing with Internal nodes.

Kuruvilla Varghese

Page 18: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

18

35PLD 22V10 Fitting

• For 8 data inputs odd parity generator, Number of product terms

are 128 (We need to compute the product terms as PLD22V10

doesn’t have XOR gates)

• Now PLD 22V10 has (2 x 16 + 2 x 14 + 2 x 12 + 2 x 10 + 2 x 8) =

120 product terms among 10 outputs.

• For cascading we need a Macro cell/section with at least 9 product

terms, so we need to use a macro cell with 10 sections, this leaves

us with 110 product terms.

• Hence, the product term resources aren’t enough.

Kuruvilla Varghese

36PLD 22V10 Fitting

• This assumes that cascaded terms are substituted. If there is no

product term substitution, it is possible to fit, if any of the

following options are chosen

– cascade of 7 ex-or gates with 6 internal nodes

– log structure of 2 input exor gates 9

– log structure of 3 input exor gates

– log structure of 2, 4 input exor gates with second stage of 1, 2 input exor

gates.

– different cascaded schemes in which fewer than 7 exor gates are

substituted.

Kuruvilla Varghese

Page 19: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

19

37Applications of SPLD

• Glue Logic

• Counter

• FSM

• Wide decoding is not required for many

applications

• Less FFs

Kuruvilla Varghese

38

Kuruvilla Varghese

Programming Technology

• Fuse

• EPROM (UV Erasable)

• EEPROM

• Flash

Page 20: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

20

39

Kuruvilla Varghese

EPROM Transistor

40PAL16L8

Kuruvilla Varghese Source: Texas Instruments Data sheets

Page 21: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

21

41

Kuruvilla Varghese

EPROM Transistor Wired-AND

Wired ORWired NOR, Invert the inputs

I1/ (I1) I2/ (I2) In/ (In)

A

BY

A

BY

42

Kuruvilla Varghese

EPROM Transistor Wired-AND

• Programmable AND

– Wired NOR with inputs using complements

– Transistors are EPROM

– When programmed, No connection

• Fixed OR

– Wired NOR followed by Inverter

– Normal n-type transistors are used

Page 22: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

22

43

Kuruvilla Varghese

Flash / EEPROM Transistor

44

Kuruvilla Varghese

Flash Cell Write

Page 23: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

23

45

Kuruvilla Varghese

Flash Cell Erase

46

Kuruvilla Varghese

EEPROM/Flash Transistor Wired-AND

Wired ORWired NOR, Invert the inputs

I1/ (I1) I2/ (I2) In/ (In)

Vdd Vdd Vdd

Page 24: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

24

47

Kuruvilla Varghese

Programming SPLD’s

• Programming Interface

– JEDEC File, standard, ASCII

– Fuse patterns in 0 & 1

• Programming methodology

– Proprietary, uses the normal pins

– High voltage - switch to programming mode

– Address, data, read/write, program pins

– Blank check, verification, security

– UV/Electrically Erasable, Programmer

48

Kuruvilla Varghese

Complex PLD (CPLD)

• Not a big SPLD, as the SPLD already has wide product terms.

• What is sensible is multiple SPLD’s interconnected, such that blocks of a medium sized design can fit in to these SPLD blocks.

• Interconnection requirements.

– Output of any block should be able to go to one or more inputs of any other blocks.

– Any input signal should be able to go to one or more inputs of any blocks.

Page 25: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

25

49

Kuruvilla Varghese

Complex PLD (CPLD)

• Hierarchical PLD

• Product term array

• Product term Allocator / Distributor

• Macrocells

• I/O cells

• Programmable Interconnect

Kuruvilla Varghese

PAL22V10

Source: Texas Instruments Data sheets

Page 26: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

26

51

Kuruvilla Varghese

CPLD Manufacturers

• Xilinx– XC9500XL, CoolRunner-II

• Altera

– Max 3000A, Max 7000S, Max II, Max V

• Atmel

– ATF15xx

• Lattice Semiconductor

– ispMACH 4000ZE

52

Kuruvilla Varghese

MAX7000 CPLD

Source: Altera Data sheets

Page 27: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

27

53

Kuruvilla Varghese

PIA: Programmable Interconnect Array

• Cross bar switch satisfying the connectivity requirements

discussed before.

• N x N cross bar can be implemented using, N, N-to-1

Multiplexers.

• Interconnection between blocks using just one switch.

• Simple timing, fast.

• Cross bar don’t scale well

54

Kuruvilla Varghese

2 x 2 Crossbar

I0

I1

O0 O1

S0S1

• N x N crossbar requires N, N to 1 Multiplexers

Page 28: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

28

55

Kuruvilla Varghese

MAX7000 Features

Source: Altera Data sheets

56

Kuruvilla Varghese

Xilinx XC9500 Crossbar (Fast CONNECT)

Source: Altera Data sheets

Page 29: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

29

57

Kuruvilla Varghese

MAX7000 Macrocell

Source: Altera Data sheets

58Clock Enable

Kuruvilla Varghese

D Q

CK

0

1

D Q

CK

CE

Page 30: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

30

59

Kuruvilla Varghese

Logic Block Features

• 5 PT’s per Macrocell

• D/T Flip-flop. Flip flop can be bypassed for combinational

output.

• XOR Gate: Polarity control, PT optimization, Comparator,

Arithmetic circuits, Parity

• PT set, PT Reset,

• Global Clock, PT Clock

• PT Clock enable

60

Kuruvilla Varghese

MAX7000S Macrocell Fast Input

Source: Altera Data sheets

Page 31: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

31

61

Kuruvilla Varghese

MAX7000 CPLD

Source: Altera Data sheets

62

Kuruvilla Varghese

Fast Input

• Fast input architecture allows direct connection of

input to the Macrocell flip-flop through 2 to 1 Mux

at the input of flip-flop

Page 32: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

32

63

Kuruvilla Varghese

MAX7000S Macrocell Fast Input

Source: Altera Data sheets

64

Kuruvilla Varghese

Fitting: VHDL Code

process (clk, rst)

begin

if (rst = ‘1’) then q <= ‘0’;

elsif (clk’event and clk = ‘1’) then

if (en = ‘1’) then

q <= a xor b;

end if;

end if;

end process;

Page 33: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

33

65

Kuruvilla Varghese

Fitting: Synthesized Circuit

d

clk

q q

q

rstclk

rst

1 0

en

ab

66

Kuruvilla Varghese

Fitting in CPLD

rst clk

q

en

a

b

Source: Altera Data sheets

Page 34: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

34

67

Kuruvilla Varghese

Xilinx XC9500 Product Term Allocator

Source: Xilinx Data Sheet

68Product Term Allocator

• Demultiplexers let the PT’s to be allocated for various

functions like XOR input, PT clock, PT clock enable, PT

Set, PT Reset and PT Steering.

• 5 input OR gate with associated steering circuit allows the

unused PT’s in one section (combined with ones from

section above/below) to be steered to OR gate of the section

above or below.

Kuruvilla Varghese

Page 35: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

35

69MAX7000S I/O Control Block

Kuruvilla Varghese Source: Altera Data sheets

70MAX7000 Timing Model

Kuruvilla Varghese Source: Altera Data sheets

Page 36: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

36

71CPLD vs FPGA

Kuruvilla Varghese

Features PLD FPGA

Logic AND-OR Mux / LUT / Gates

Register to Logic

ratio

Small Large

Timing Simple Complex

Architecture

Variation

Small Large

Programming

Technology

Flash Anti-Fuse, SRAM

Capacity 10 K Few Million Logic

Cells + Few MB RAM

72

Kuruvilla Varghese

CPLD Applications

• Small design comprising of counters, FSM, Small logic

• Examples

– Memory controllers (DRAM controller)

– Bus protocol translation (CPU Bus -> PCI Bus)

– Optical encoders.

– Small control circuit in Instrumentation, Power Electronics for

Data Acquisition control, Small digital control circuits.

Page 37: KV_NPTEL_pld_pres_1.ppt [Compatibility Mode]

7/18/2014

37

73

Kuruvilla Varghese

CPLD Applications

• Design which requires lot of registers and memory and

complex designs cannot be implemented.

– Signal processing architectures (Filters)

– Complex arithmetic circuits

– Communication circuits (Packet processing, Modems)

– CODEC’s

– Cryptographic circuits