Introduction to
CMOS VLSI
Design
Lecture 10:
Sequential Circuits
David HarrisCMOS VLSI Design
10: Sequential Circuits Slide 2
Outline
q Sequencing
q Sequencing Element Design q Max and Min-Delay
q Clock Skew
q Time Borrowing
Sequencing
q Combinational logic
– output depends on current inputs q 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
CMOS VLSI Design
10: Sequential Circuits Slide 4
Sequencing Cont.
q If tokens moved through pipeline at constant speed, no sequencing elements would be necessary
q 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 q This is called wave pipelining in circuits
q In most circuits, dispersion is high
Sequencing Overhead
q Use flip-flops to delay fast tokens so they move through exactly one stage each cycle.
q Inevitably adds some delay to the slow tokens q Makes circuit slower than just the logic delay
– Called sequencing overhead
q Some people call this clocking overhead
– But it applies to asynchronous circuits too
CMOS VLSI Design
10: Sequential Circuits Slide 6
Sequencing Elements
q Latch: Level sensitive
– a.k.a. transparent latch, D latch q Flip-flop: edge triggered
– A.k.a. master-slave flip-flop, D flip-flop, D register q Timing Diagrams – Transparent – Opaque – Edge-trigger D Flo p Lat ch Q clk clk D Q clk D Q (latch) Q (flop)
Sequencing Elements
q Latch: Level sensitive
– a.k.a. transparent latch, D latch q Flip-flop: edge triggered
– A.k.a. master-slave flip-flop, D flip-flop, D register q Timing Diagrams – Transparent – Opaque – Edge-trigger D Flo p Lat ch Q clk clk D Q clk D Q (latch)
CMOS VLSI Design
10: Sequential Circuits Slide 8
Latch Design
q Pass Transistor Latch q Pros
+ Tiny
+ Low clock load q Cons
– Vt drop
– nonrestoring – backdriving
– output noise sensitivity – dynamic
– diffusion input
D Q
φ
Latch Design
q Transmission gate
+ No Vt drop
- Requires inverted clock D Q
φ
CMOS VLSI Design
10: Sequential Circuits Slide 10
Latch Design
q Inverting buffer + Restoring
+ No backdriving + Fixes either
• Output noise sensitivity • Or diffusion input – Inverted output D φ φ X Q D Q φ φ
Latch Design
q Tristate feedback + Static
– Backdriving risk
q Static latches are now essential
φ
φ φ
φ
Q
CMOS VLSI Design
10: Sequential Circuits Slide 12
Latch Design
q Buffered input
+ Fixes diffusion input + Noninverting φ φ Q D X φ φ
Latch Design
q Buffered output + No backdriving
q Widely used in standard cells + Very robust (most important) - Rather large
- Rather slow (1.5 – 2 FO4 delays) - High clock loading
φ φ Q D X φ φ
CMOS VLSI Design
10: Sequential Circuits Slide 14
Latch Design
q Datapath latch + Smaller, faster - unbuffered input φ φ φ φ Q D XFlip-Flop Design
q Flip-flop is built as pair of back-to-back latches
D Q φ φ φ φ X D φ φ φ φ X Q Q φ φ
CMOS VLSI Design
10: Sequential Circuits Slide 16
Enable
q Enable: ignore clock when en = 0 – Mux: increase latch D-Q delay
– Clock Gating: increase en setup time, skew
D Q Lat ch D Q en en φ φ Lat ch D Q φ 0 1 en Lat ch D Q φ en D Q φ 0 1 en D Q φ en F lo p F lo p F lo p
Reset
q Force output low when reset asserted q Synchronous vs. asynchronous D φ φ φ φ Q Q φ φ φ φ reset D φ φ φ Q φ φ D reset Q φ D reset φ reset Sy nc hr on ou s R es et As yn ch ro no S ymb ol Flo p D Q Lat ch D Q reset reset φ φ φ Q
CMOS VLSI Design
10: Sequential Circuits Slide 18
Set / Reset
q Set forces output high when enabled
q Flip-flop with asynchronous set and reset
D φ φ φ φ φ φ Q φ φ reset set reset set
Sequencing Methods
q Flip-flops q 2-Phase Latches q Pulsed Latches Fl ip-Fl op s Fl op Lat ch Fl op clk φ1 φ2 φp clk clk Lat ch Lat ch φp φp φ1 φ2 φ1 2-P ha se Tra ns pa re nt La tc he s P uls ed L atc he Combinational Logic Combinational Logic Combinational Logic Tc Tc/2 tnonoverlap tnonoverlap tpw Half-Cycle 1 Half-Cycle 1CMOS VLSI Design
10: Sequential Circuits Slide 20
Timing Diagrams
F lo p A Y tpd Combinational Logic A Y D Q clk clk D Q Lat ch D Q clk clk D Q tcd tsetup t hold tccq tpcq tccq tsetup thold tpcq tpdq tcdqtpd Logic Prop. Delay
tcd Logic Cont. Delay
tpcq Latch/Flop Clk-Q Prop Delay
tccq Latch/Flop Clk-Q Cont. Delay
tpdq Latch D-Q Prop Delay
tpcq Latch D-Q Cont. Delay
tsetup Latch/Flop Setup Time
thold Latch/Flop Hold Time
Contamination and Propagation Delays
Max-Delay: Flip-Flops
F1 F2 clk clk clk Combinational Logic Tc Q1 D2 Q1 D2 tpd tsetup tpcq(
)
sequencing overhead pd c t ≤ T − 1 44 2 4 43CMOS VLSI Design
10: Sequential Circuits Slide 22
Max-Delay: Flip-Flops
F1 F2 clk clk clk Combinational Logic Tc Q1 D2 Q1 D2 tpd tsetup tpcq(
setup)
sequencing overhead pd c pcq t ≤ T − t +t 1 4 2 4 3Max Delay: 2-Phase Latches
Tc Q1 L1 φ1 φ2 L2 L3 φ1 φ2 φ1 Combinational Logic 1 Combinational Logic 2 Q2 Q3 D1 D2 D3 Q1 D2 Q2 D1 tpd1 tpdq1 tpd2 tpdq2 ( ) 1 2 sequencing overhead pd pd pd c t =t +t ≤T − 1 44 2 4 43CMOS VLSI Design
10: Sequential Circuits Slide 24
Max Delay: 2-Phase Latches
Tc Q1 L1 φ1 φ2 L2 L3 φ1 φ2 φ1 Combinational Logic 1 Combinational Logic 2 Q2 Q3 D1 D2 D3 Q1 D2 Q2 D3 D1 tpd1 tpdq1 tpd2 tpdq2 ( ) 1 2 sequencing overhead 2 pd pd pd c pdq t =t +t ≤T − t 1 2 3
Max Delay: Pulsed Latches
Tc Q1 Q2 D1 D2 Q1 D2 D1 φp φp φp Combinational Logic L1 L2 tpw (a) tpw > tsetup Q1 D2 (b) tpw < tsetup Tc tpd tpdq tpcq tpd tsetup(
)
sequencing overhead max pd c t ≤ T − 1 4 4 44 2 4 4 4 43CMOS VLSI Design
10: Sequential Circuits Slide 26
Max Delay: Pulsed Latches
Tc Q1 Q2 D1 D2 Q1 D2 D1 φp φp φp Combinational Logic L1 L2 tpw (a) tpw > tsetup Q1 D2 (b) tpw < tsetup Tc tpd tpdq tpcq tpd tsetup
(
setup)
sequencing overhead max , pd c pdq pcq pw t ≤ T − t t +t −t 1 4 4 4 4 2 4 4 4 43Min-Delay: Flip-Flops
cd t ≥ CL clk Q1 D2 F1 clk Q1 F2 clk D2 tcd thold tccqCMOS VLSI Design
10: Sequential Circuits Slide 28
Min-Delay: Flip-Flops
hold cd ccq t ≥ t − t CL clk Q1 D2 F1 clk Q1 F2 clk D2 tcd thold tccqMin-Delay: 2-Phase Latches
1, 2 cd cd t t ≥ CL Q1 D2 D2 Q1 φ1 L1 φ2 L2 φ1 φ2 tnonoverlap tcd thold tccqHold time reduced by nonoverlap
Paradox: hold applies twice each cycle, vs. only once for flops. But a flop is made of two latches!
CMOS VLSI Design
10: Sequential Circuits Slide 30
Min-Delay: 2-Phase Latches
1, 2 hold nonoverlap cd cd ccq t t ≥ t −t − t CL Q1 D2 D2 Q1 φ1 L1 φ2 L2 φ1 φ2 tnonoverlap tcd thold tccq
Hold time reduced by nonoverlap
Min-Delay: Pulsed Latches
cd t ≥ CL Q1 D2 Q1 D2 φp t pw φp L1 φp L2 tcd thold tccqHold time increased by pulse width
CMOS VLSI Design
10: Sequential Circuits Slide 32
Min-Delay: Pulsed Latches
hold cd ccq pw t ≥ t −t + t CL Q1 D2 Q1 D2 φp t pw φp L1 φp L2 tcd thold tccq
Hold time increased by pulse width
Time Borrowing
q 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
q In a latch-based system
– Data can pass through latch while transparent – Long cycle of logic can borrow time into next
CMOS VLSI Design
10: Sequential Circuits Slide 34
Time Borrowing Example
La tc h La tc h La tc h
Combinational Logic CombinationalLogic
Borrowing time across half-cycle boundary
Borrowing time across pipeline stage boundary
(a) (b) Latc h La tc h
Combinational Logic CombinationalLogic
Loops may borrow time internally but must complete within the cycle
φ1 φ2 φ1 φ1 φ1 φ2 φ2
How Much Borrowing?
Q1 L1 φ1 φ2 L2 φ1 φ2 Combinational Logic 1 Q2 D1 D2 D2 Tc Tc/2Nominal Half-Cycle 1 Delay
tborrow
tnonoverlap
tsetup
(
)
borrow setup nonoverlap
2 c T t ≤ − t +t 2-Phase Latches borrow pw setup t ≤ t −t Pulsed Latches
CMOS VLSI Design
10: Sequential Circuits Slide 36
Clock Skew
q We have assumed zero clock skew
q Clocks really have uncertainty in arrival time – Decreases maximum propagation delay – Increases minimum contamination delay – Decreases time borrowing
Skew: Flip-Flops
F1 F2 clk clk clk Combinational Logic Tc Q1 D2 Q1 D2 tskew CL F1 clk Q1 F2 clk D2 clk tskew tsetup tpcq tpdq thold(
setup skew)
sequencing overhead hold skew pd c pcq cd ccq t T t t t t t t t ≤ − + + ≥ − + 1 4 44 2 4 4 43CMOS VLSI Design
10: Sequential Circuits Slide 38
Skew: Latches
Q1 L1 φ1 φ2 L2 L3 φ1 φ2 φ1 CombinationalLogic 1 CombinationalLogic 2
Q2 Q3
D1 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 T t t t t ≤ − ≥ − − + ≤ − + + 1 2 3 2-Phase Latches
(
)
(
)
setup skew sequencing overhead hold skewborrow 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 ≤ − + − + ≥ + − + ≤ − + 1 4 4 4 4 4 2 4 4 4 4 4 3 Pulsed Latches
Two-Phase Clocking
q If setup times are violated, reduce clock speed q If hold times are violated, chip fails at any speed q In this class, working chips are most important
– No tools to analyze clock skew
q An easy way to guarantee hold times is to use 2-phase latches with big nonoverlap times
CMOS VLSI Design
10: Sequential Circuits Slide 40
Safe Flip-Flop
q In class, use flip-flop with nonoverlapping clocks – Very slow – nonoverlap adds to setup time – But no hold times
q In industry, use a better timing analyzer
– Add buffers to slow signals if hold time is at risk
D φ2 X Q Q φ1 φ2 φ1 φ1 φ1 φ2 φ2
Summary
q Flip-Flops:
– Very easy to use, supported by all tools q 2-Phase Transparent Latches:
– Lots of skew tolerance and time borrowing q Pulsed Latches: