lecture 11: sequential circuits

54
Introduction to CMOS VLSI Design Lecture 11: Sequential Circuits David Harris, Harvey Mudd College Kartik Mohanram and Steven Levitan University of Pittsburgh

Upload: others

Post on 17-Oct-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 11: Sequential Circuits

Introduction to

CMOS VLSI

Design

Lecture 11:

Sequential CircuitsDavid Harris, Harvey Mudd College

Kartik Mohanram and Steven Levitan

University of Pittsburgh

Page 2: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 2

Outline

Floorplanning

Sequencing

Sequencing Element Design

Max and Min-Delay

Clock Skew

Time Borrowing

Two-Phase Clocking

Page 3: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 3

Project Strategy

Proposal

– Specifies inputs, outputs, relation between them

Floorplan

– Begins with block diagram

– Annotate dimensions and location of each block

– Requires detailed paper design

Schematic

– Make paper design simulate correctly

Layout

– Physical design, DRC, NCC, ERC

Page 4: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 4

Floorplan

How do you estimate block areas?

– Begin with block diagram

– Each block has

• Inputs

• Outputs

• Function (draw schematic)

• Type: array, datapath, random logic

Estimation depends on type of logic

Page 5: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 5

MIPS Floorplan

datapath

2700 x 1050

(2.8 M2)

alucontrol

200 x 100

(20 k2)

zipper 2700 x 250

2700

1690

wiring channel: 30 tracks = 240

mips

(4.6 M2)

bitslice 2700 x 100

control

1500 x 400

(0.6 M2)

3500

3500

5000

5000

10 I/O pads

10 I/O pads

10 I/O

pads

10 I/O

pads

Page 6: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 6

Area Estimation

Arrays:

– Layout basic cell

– Calculate core area from # of cells

– Allow area for decoders, column circuitry

Datapaths

– Sketch slice plan

– Count area of cells from cell library

– Ensure wiring is possible

Random logic

– Compare complexity do a design you have done

Page 7: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 7

MIPS Slice Plan

mu

x2

inv

flop

flop

flop

flop

mu

x2

inv

write

driv

er

duals

ram

duals

ram

duals

ram

duals

ram

bit0

sra

mp

ullu

p

readm

ux

flop

mu

x4

flop

mu

x2

inv

flop

mu

x4

and2

flop

and2

inv

mu

x2

and2

or2

fulla

dder

mu

x4

register file

ramslice

ALU

adrm

ux

flop

MD

R

IR3...0

write

mu

x

srcB srcA

alu

out

zero

dete

ct

PC

memdatawritedata

adr

pcimmediate

aluout

aluresult

srcBsrcAbitlines

44 24 93 93 93 93 93 44 24 52 48 48 48 48 16 86 93 93 93 9344 24 4424131 131 13139 39 39 39 160

Page 8: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 8

Typical Layout Densities

Typical numbers of high-quality layout

Derate by 2 for class projects to allow routing and

some sloppy layout.

Allocate space for big wiring channels

Element Area

Random logic (2 metal layers) 1000-1500 2 / transistor

Datapath 250 – 750 2 / transistor

Or 6 WL + 360 2 / transistor

SRAM 1000 2 / bit

DRAM 100 2 / bit

ROM 100 2 / bit

Page 9: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 9

Sequencing

Combinational logic

– output depends on current inputs

Sequential logic

– output depends on current and previous inputs

– Requires separating previous, current, future

– Called state or tokens

– Ex: FSM, pipeline

CL

clk

in out

clk clk clk

CL CL

PipelineFinite State Machine

Page 10: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 10

Sequencing Cont.

If tokens moved through pipeline at constant speed,

no sequencing elements would be necessary

Ex: fiber-optic cable

– Light pulses (tokens) are sent down cable

– Next pulse sent before first reaches end of cable

– No need for hardware to separate pulses

– But dispersion sets min time between pulses

This is called wave pipelining in circuits

In most circuits, dispersion is high

– Delay fast tokens so they don’t catch slow ones.

Page 11: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 11

Sequencing Overhead

Use flip-flops to delay fast tokens so they move

through exactly one stage each cycle.

Inevitably adds some delay to the slow tokens

Makes circuit slower than just the logic delay

– Called sequencing overhead

Some people call this clocking overhead

– But it applies to asynchronous circuits too

– Inevitable side effect of maintaining sequence

Page 12: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 12

Sequencing Elements

Latch: Level sensitive

– a.k.a. transparent latch, D latch

Flip-flop: edge triggered

– A.k.a. master-slave flip-flop, D flip-flop, D register

Timing Diagrams

– Transparent

– Opaque

– Edge-trigger

D

Flo

p

Latc

h

Q

clk clk

D Q

clk

D

Q (latch)

Q (flop)

Page 13: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 13

Sequencing Elements

Latch: Level sensitive

– a.k.a. transparent latch, D latch

Flip-flop: edge triggered

– A.k.a. master-slave flip-flop, D flip-flop, D register

Timing Diagrams

– Transparent

– Opaque

– Edge-trigger

D

Flo

p

Latc

h

Q

clk clk

D Q

clk

D

Q (latch)

Q (flop)

Page 14: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 14

Latch Design

Pass Transistor Latch

Pros

+

+

Cons

D Q

Page 15: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 15

Latch Design

Pass Transistor Latch

Pros

+ Tiny

+ Low clock load

Cons

– Vt drop

– nonrestoring

– backdriving

– output noise sensitivity

– dynamic

– diffusion input

D Q

Used in 1970’s

Page 16: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 16

Latch Design

Transmission gate

+

- D Q

Page 17: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 17

Latch Design

Transmission gate

+ No Vt drop

- Requires inverted clock D Q

Page 18: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 18

Latch Design

Inverting buffer

+

+

+ Fixes either

D

XQ

D Q

Page 19: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 19

Latch Design

Inverting buffer

+ Restoring

+ No backdriving

+ Fixes either

• Output noise sensitivity

• Or diffusion input

– Inverted output

D

XQ

D Q

Page 20: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 20

Latch Design

Tristate feedback

+

QDX

Page 21: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 21

Latch Design

Tristate feedback

+ Static

– Backdriving risk

Static latches are now essential

QDX

Page 22: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 22

Latch Design

Buffered input

+

+

QDX

Page 23: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 23

Latch Design

Buffered input

+ Fixes diffusion input

+ Noninverting

QDX

Page 24: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 24

Latch Design

Buffered output

+

Q

DX

Page 25: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 25

Latch Design

Buffered output

+ No backdriving

Widely used in standard cells

+ Very robust (most important)

- Rather large

- Rather slow (1.5 – 2 FO4 delays)

- High clock loading

Q

DX

Page 26: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 26

Latch Design

Datapath latch

+

-

Q

DX

Page 27: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 27

Latch Design

Datapath latch

+ Smaller, faster

- unbuffered input

Q

DX

Page 28: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 28

Flip-Flop Design

Flip-flop is built as pair of back-to-back latches

D Q

X

D

X

Q

Q

Page 29: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 29

Enable

Enable: ignore clock when en = 0

– Mux: increase latch D-Q delay

– Clock Gating: increase en setup time, skew

D Q

Latc

h

D Q

en

en

Latc

hDQ

0

1

en

Latc

h

D Q

en

DQ

0

1

enD Q

en

Flo

p

Flo

p

Flo

p

Symbol Multiplexer Design Clock Gating Design

Page 30: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 30

Reset

Force output low when reset asserted

Synchronous vs. asynchronous

D

Q

Q

reset

D

Q

D

reset

Q

D

reset

reset

reset

Synchro

nous R

eset

Asynchro

nous R

eset

Sym

bol F

lop

D Q

Latc

h

D Q

reset reset

Q

reset

Page 31: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 31

Set / Reset

Set forces output high when enabled

Flip-flop with asynchronous set and reset

D

Q

reset

setreset

set

Page 32: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 32

Sequencing Methods

Flip-flops

2-Phase Latches

Pulsed Latches

Flip

-Flo

ps

Flo

pLatc

h

Flo

p

clk

1

2

p

clk clk

Latc

h

Latc

h

p

p

1

1

2

2-P

hase T

ranspare

nt L

atc

hes

Puls

ed L

atc

hes

Combinational Logic

Combinational

Logic

Combinational

Logic

Combinational Logic

Latc

h

Latc

h

Tc

Tc/2

tnonoverlap

tnonoverlap

tpw

Half-Cycle 1 Half-Cycle 1

Page 33: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 33

Timing Diagrams

Flo

p

A

Y

tpd

Combinational

LogicA Y

D Q

clk clk

D

Q

Latc

h

D Q

clkclk

D

Q

tcd

tsetup t

hold

tccq

tpcq

tccq

tsetup

thold

tpcq

tpdq

tcdq

tpdLogic Prop. Delay

tcdLogic Cont. Delay

tpcqLatch/Flop Clk-Q Prop Delay

tccqLatch/Flop Clk-Q Cont. Delay

tpdqLatch D-Q Prop Delay

tpcqLatch D-Q Cont. Delay

tsetupLatch/Flop Setup Time

tholdLatch/Flop Hold Time

Contamination and

Propagation Delays

Page 34: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 34

Max-Delay: Flip-Flops

F1

F2

clk

clk clk

Combinational Logic

Tc

Q1 D2

Q1

D2

tpd

tsetup

tpcq

sequencing overhead

pd ct T

Page 35: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 35

Max-Delay: Flip-Flops

F1

F2

clk

clk clk

Combinational Logic

Tc

Q1 D2

Q1

D2

tpd

tsetup

tpcq

setup

sequencing overhead

pd c pcqt T t t

Page 36: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 36

Max Delay: 2-Phase Latches

Tc

Q1

L1

1

2

L2

L3

1

1

2

Combinational

Logic 1

Combinational

Logic 2

Q2 Q3D1 D2 D3

Q1

D2

Q2

D3

D1

tpd1

tpdq1

tpd2

tpdq2

1 2

sequencing overhead

pd pd pd ct t t T

Page 37: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 37

Max Delay: 2-Phase Latches

Tc

Q1

L1

1

2

L2

L3

1

1

2

Combinational

Logic 1

Combinational

Logic 2

Q2 Q3D1 D2 D3

Q1

D2

Q2

D3

D1

tpd1

tpdq1

tpd2

tpdq2

1 2

sequencing overhead

2pd pd pd c pdqt t t T t

Page 38: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 38

Max Delay: Pulsed Latches

Tc

Q1 Q2D1 D2

Q1

D2

D1

p

p

p

Combinational LogicL1

L2

tpw

(a) tpw

> tsetup

Q1

D2

(b) tpw

< tsetup

Tc

tpd

tpdq

tpcq

tpd

tsetup

sequencing overhead

max pd ct T

Page 39: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 39

Max Delay: Pulsed Latches

Tc

Q1 Q2D1 D2

Q1

D2

D1

p

p

p

Combinational LogicL1

L2

tpw

(a) tpw

> tsetup

Q1

D2

(b) tpw

< tsetup

Tc

tpd

tpdq

tpcq

tpd

tsetup

setup

sequencing overhead

max ,pd c pdq pcq pwt T t t t t

Page 40: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 40

Min-Delay: Flip-Flops

cdt CL

clk

Q1

D2

F1

clk

Q1

F2

clk

D2

tcd

thold

tccq

Page 41: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 41

Min-Delay: Flip-Flops

holdcd ccqt t t CL

clk

Q1

D2

F1

clk

Q1

F2

clk

D2

tcd

thold

tccq

Page 42: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 42

Min-Delay: 2-Phase Latches

1, 2 cd cdt t CL

Q1

D2

D2

Q1

1

L1

2

L2

1

2

tnonoverlap

tcd

thold

tccq

Hold time reduced by

nonoverlap

Paradox: hold applies

twice each cycle, vs.

only once for flops.

But a flop is made of

two latches!

Page 43: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 43

Min-Delay: 2-Phase Latches

1, 2 hold nonoverlapcd cd ccqt t t t t CL

Q1

D2

D2

Q1

1

L1

2

L2

1

2

tnonoverlap

tcd

thold

tccq

Hold time reduced by

nonoverlap

Paradox: hold applies

twice each cycle, vs.

only once for flops.

But a flop is made of

two latches!

Page 44: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 44

Min-Delay: Pulsed Latches

cdt CL

Q1

D2

Q1

D2

p t

pw

p

L1

p

L2

tcd

thold

tccq

Hold time increased

by pulse width

Page 45: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 45

Min-Delay: Pulsed Latches

holdcd ccq pwt t t t CL

Q1

D2

Q1

D2

p t

pw

p

L1

p

L2

tcd

thold

tccq

Hold time increased

by pulse width

Page 46: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 46

Time Borrowing

In a flop-based system:

– Data launches on one rising edge

– Must setup before next rising edge

– If it arrives late, system fails

– If it arrives early, time is wasted

– Flops have hard edges

In a latch-based system

– Data can pass through latch while transparent

– Long cycle of logic can borrow time into next

– As long as each loop completes in one cycle

Page 47: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 47

Time Borrowing Example

Latc

h

Latc

h

Latc

h

Combinational LogicCombinational

Logic

Borrowing time across

half-cycle boundary

Borrowing time across

pipeline stage boundary

(a)

(b)

Latc

h

Latc

hCombinational Logic

Combinational

Logic

Loops may borrow time internally but must complete within the cycle

1

2

1

1

1

2

2

Page 48: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 48

How Much Borrowing?

Q1

L1

1

2

L2

1

2

Combinational Logic 1Q2D1 D2

D2

Tc

Tc/2

Nominal Half-Cycle 1 Delay

tborrow

tnonoverlap

tsetup

borrow setup nonoverlap2cT

t t t

2-Phase Latches

borrow setuppwt t t

Pulsed Latches

Page 49: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 49

Clock Skew

We have assumed zero clock skew

Clocks really have uncertainty in arrival time

– Decreases maximum propagation delay

– Increases minimum contamination delay

– Decreases time borrowing

Page 50: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 50

Skew: Flip-Flops

F1

F2

clk

clk clk

Combinational Logic

Tc

Q1 D2

Q1

D2

tskew

CL

Q1

D2

F1

clk

Q1

F2

clk

D2

clk

tskew

tsetup

tpcq

tpdq

tcd

thold

tccq

setup skew

sequencing overhead

hold skew

pd c pcq

cd ccq

t T t t t

t t t t

Page 51: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 51

Skew: Latches

Q1

L1

1

2

L2

L3

1

1

2

Combinational

Logic 1

Combinational

Logic 2

Q2 Q3D1 D2 D3

sequencing overhead

1 2 hold nonoverlap skew

borrow setup nonoverlap skew

2

,

2

pd c pdq

cd cd ccq

c

t T t

t t t t t t

Tt t t t

2-Phase Latches

setup skew

sequencing overhead

hold skew

borrow setup skew

max ,pd c pdq pcq pw

cd pw ccq

pw

t T t t t t t

t t t t t

t t t t

Pulsed Latches

Page 52: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 52

Two-Phase Clocking

If setup times are violated, reduce clock speed

If hold times are violated, chip fails at any speed

In this class, working chips are most important

– No tools to analyze clock skew

An easy way to guarantee hold times is to use 2-

phase latches with big nonoverlap times

Call these clocks 1, 2 (ph1, ph2)

Page 53: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 53

Safe Flip-Flop

In class, use flip-flop with nonoverlapping clocks

– Very slow – nonoverlap adds to setup time

– But no hold times

In industry, use a better timing analyzer

– Add buffers to slow signals if hold time is at risk

D

X

Q

Q

Page 54: Lecture 11: Sequential Circuits

CMOS VLSI Design10: Sequential Circuits Slide 54

Summary

Flip-Flops:

– Very easy to use, supported by all tools

2-Phase Transparent Latches:

– Lots of skew tolerance and time borrowing

Pulsed Latches:

– Fast, some skew tol & borrow, hold time risk