Logic Synthesis and CMOS Technology

35
Logic Synthesis and CMOS Technology Reminders: - Quiz 1 on Thu March 5 th 7:30-9:30pm, covers lectures L1-L7 and labs 1-2. - See piazza / course website for exam rooms - Quiz review: Tue March 3 rd 7:30-9:30pm in 6-120. February 27, 2020 MIT 6.004 Spring 2020 L07-1

Transcript of Logic Synthesis and CMOS Technology

Page 1: Logic Synthesis and CMOS Technology

Logic Synthesis andCMOS Technology

Reminders:- Quiz 1 on Thu March 5th 7:30-9:30pm,

covers lectures L1-L7 and labs 1-2.- See piazza / course website for exam rooms- Quiz review: Tue March 3rd 7:30-9:30pm in

6-120.

February 27, 2020 MIT 6.004 Spring 2020 L07-1

Page 2: Logic Synthesis and CMOS Technology

Recap: Logic Optimization

§ In practice, tools use Boolean simplification and other techniques to synthesize a circuit that meets certain area, delay, and power goals:

Synthesistool

High-level circuit specification(e.g., Boolean algebra, Minispec)

Optimized circuit implementation (using standard

cell library gates)

Standard cell library(set of gates and their

physical characteristics)

Optimization goals (area/delay/power)

February 27, 2020 L07-2MIT 6.004 Spring 2020

Page 3: Logic Synthesis and CMOS Technology

Logic Synthesis (Continued): Other Common Gates§ XOR (Exclusive-OR)

§ Inverting logic

AZ = A ⋅B

B

AZ = A+ B

B

NAND NOR

A B Z0 0 00 1 11 0 11 1 0

Z = A⊕ B

A

B= �̅� $ 𝐵 + 𝐴 $ '𝐵

February 27, 2020 L07-3MIT 6.004 Spring 2020

Page 4: Logic Synthesis and CMOS Technology

Universal Building Blocks

§ NANDs and NORs are universal:

§ Any logic function can be implemented using only NANDs (or, equivalently, NORs)

=

=

=

=

=

=

February 27, 2020 L07-4MIT 6.004 Spring 2020

Page 5: Logic Synthesis and CMOS Technology

Standard Cell Library

§ Library of gates and their physical characteristics§ Example:

Gate Delay (ps)

Area (µ2)

Buffer 40 20Inverter 20 10AND2 50 25NAND2 30 15OR2 55 26NOR2 35 16AND4 90 40NAND4 70 30OR4 100 42NOR4 80 32

Observations: 1. In current technology

(CMOS), inverting gates are faster and smaller

2. Delay and area grow with number of inputs

February 27, 2020 L07-5MIT 6.004 Spring 2020

Page 6: Logic Synthesis and CMOS Technology

Design Tradeoffs: Delay vs Size

AND4:tPD = 90 ps, size = 40µ2

NAND4 + INV:tPD = 90 ps, size = 40µ2

2*NAND2 + NOR2:tPD = 1 NAND2 + NOR2 = 65 ps, size = 2 NAND2 + NOR2 = 46µ2

Demorgan’sLaws:

A ⋅B = A+BA+B = A ⋅B

February 27, 2020 L07-6MIT 6.004 Spring 2020

Page 7: Logic Synthesis and CMOS Technology

Example: Mapping a Circuit to a Standard Cell Library

Find an implementation of a circuit, e.g.,

That optimizes for some goal, e.g., minimum area

Area 2 3 4 5

Using gates from a standard cell library, e.g.,

February 27, 2020 L07-7MIT 6.004 Spring 2020

Page 8: Logic Synthesis and CMOS Technology

Example: Mapping a Circuit to a Standard Cell Library

Possible implementations:

7 NAND2 (3) = 215 INV (2) = 10

Total area cost: 31

2 INV = 4 2 NAND2 = 61 NAND3 = 41 NAND4 = 5

Total area cost: 19

February 27, 2020 L07-8MIT 6.004 Spring 2020

Page 9: Logic Synthesis and CMOS Technology

Logic Optimization Takeaways

§ Synthesizing an optimized circuit is a very complex problem§ Boolean simplification§ Mapping to cell libraries with many gates§ Multidimensional tradeoffs (e.g., minimize area-delay-

power product)

§ Infeasible to do by hand for all but the smallest circuits!

§ Instead, hardware designers write circuits in a hardware description language, and use a synthesis tool to derive optimized implementations

February 27, 2020 L07-9MIT 6.004 Spring 2020

Page 10: Logic Synthesis and CMOS Technology

CMOS Technology

February 27, 2020 MIT 6.004 Spring 2020 L07-10

Page 11: Logic Synthesis and CMOS Technology

A Deep Dive Into a Chip

Packaged chip Silicon die (100-400mm2)

Diecross-section

6-15 metallayers (wires)

Transistor (FET)

32 nm Source: Intel

February 27, 2020 L07-11MIT 6.004 Spring 2020

Page 12: Logic Synthesis and CMOS Technology

Field-Effect Transistors (FETs)

§ Nearly all digital systems are built using field-effect transistors, which are voltage-controlled switches

§ FETs come in two varieties: nFET and pFET

G

S

D

G

D

SnFET pFET

(source)

(drain)

(gate)

(source)

(drain)(gate)

A high voltage at gate (G=1) creates conducting path

between source and drain

A low voltage at gate (G=0)creates conducting path

between source and drainFebruary 27, 2020 L07-12MIT 6.004 Spring 2020

Page 13: Logic Synthesis and CMOS Technology

Labeling Source and Drain

§ There is no physical difference between source and drain, called the diffusion terminals

§ By convention, we label diffusion terminals as source or drain depending on their voltages:§ On nFETs, source = diffusion terminal at lower voltage§ On pFETs, source = diffusion terminal at higher voltage

§ This convention lets us define the behavior of FETs using the voltage between gate and source

D (higher voltage)

G

S (lower voltage)

S (higher voltage)

G

D (lower voltage)

February 27, 2020 L07-13MIT 6.004 Spring 2020

Page 14: Logic Synthesis and CMOS Technology

FET Switching Model

§ FETs have a threshold voltage VTH§ nFET is ON if the voltage between gate and source VGS

exceeds VTH, OFF otherwise§ pFET is ON if the voltage between source and gate VSG

exceeds VTH, OFF otherwise

§ This is a very simplified model, but it is sufficient to build logic gates

D

G

SVGS

VGS<VTHOFFD

S

D

S

VGS>VTHON

VSG<VTHOFFS

D

S

D

VSG>VTHON

S

G

D

VSG

February 27, 2020 L07-14MIT 6.004 Spring 2020

Page 15: Logic Synthesis and CMOS Technology

What Does This Circuit Compute?

CMOS inverter

VDD

VIN VOUT

S

D

G

S

DG

VDD

VOUT

VIN < VTH VIN > VDD – VTHVDD

VOUT

IN OUT01

1

0OUTIN

Assume VTH < VDD/2

February 27, 2020 L07-15MIT 6.004 Spring 2020

Page 16: Logic Synthesis and CMOS Technology

Note on Terminology

§ MOSFETs (metal-oxide-semiconductor field-effect transistors) are the most common type of FET

§ nFET and pFET are sometimes abbreviated as nMOS and pMOS

§ CMOS stands for complementary MOS

February 27, 2020 L07-16MIT 6.004 Spring 2020

Page 17: Logic Synthesis and CMOS Technology

What Does This Circuit Compute?

CMOS NAND gate

A B Z0 00 11 01 1

11 10

VDD

Z

A B

A

B

ZAB

February 27, 2020 L07-17MIT 6.004 Spring 2020

Page 18: Logic Synthesis and CMOS Technology

CMOS Logic

§ CMOS gates have complementary pullup and pulldown networks, i.e., the pullup is on when the pulldown is off and vice versa

§ CMOS uses pFETs to implement the pullup network and nFETs to implement the pulldown network

pullup pulldown F(inputs)on off driven “1”off on driven “0”on on driven “X”off off no connection

Pullupcircuit

Pulldowncircuit

Power supply

Ground

outputinputs

February 27, 2020 L07-18MIT 6.004 Spring 2020

Page 19: Logic Synthesis and CMOS Technology

Some Questionable Gates

§ What can go wrong with the following gates?

§ CMOS Rule #1: Complementary pullup and pulldown networks§ CMOS Rule #2: pFETs in pullup, nFETs in pulldown

VDD

VIN VOUT

D

SG

D

SG

pFET doesn’t pull downVOUT below VTH

nFET doesn’t pull upVOUT above VDD – VTH

VDD

Z

A B

A B

A=0 B=1 or A=1 B=0connect supply and ground

VOUT

VINVOL

VOH

VIL VIH

February 27, 2020 L07-19MIT 6.004 Spring 2020

Page 20: Logic Synthesis and CMOS Technology

CMOS Complements

conducts when A is high conducts when A is low: 𝐴

conducts when A is highand B is high: 𝐴 " 𝐵

A

BA B

conducts when A is lowor B is low: 𝐴 + 𝐵 = 𝐴 " 𝐵

conducts when A is highor B is high: 𝐴 + 𝐵

A

BA B

conducts when A is lowand B is low: 𝐴 " 𝐵 = 𝐴 + 𝐵

A A

February 27, 2020 L07-20MIT 6.004 Spring 2020

Page 21: Logic Synthesis and CMOS Technology

General CMOS Gate Recipe

Step 1. Derive the pullup network that does what you want, e.g.,

(Determine what combination of inputs generates a high output)

A

B C

Step 2. Derive complementary pulldown network: replace pFETs with nFETs,series subnets with parallel subnets, and parallel subnets with series subnets

AB

C

Step 3. Combine pFET pullup network from Step 1 with nFET pulldown network from Step 2 to form the CMOS gate.

A B

C

A

B C

F = A+B ⋅C

Can CMOS gates implementarbitrary functions? No

February 27, 2020 L07-21MIT 6.004 Spring 2020

Page 22: Logic Synthesis and CMOS Technology

CMOS Gates are Inverting

§ In a CMOS gate, rising inputs (0à1) lead to falling outputs (1à0) and vice versa

§ On a rising input,§ nFETs go OFFàON, so pulldown may

connect output to ground§ pFETs go ONàOFF, so pullup may

disconnect output from VDD

§ Output either stays the same or falls

§ Corollary: Cannot buildnon-inverting logicusing a single CMOS gate§ Example: AND

A B A∙B0 00 11 01 1

0001

rising input rising outputFebruary 27, 2020 L07-22MIT 6.004 Spring 2020

Page 23: Logic Synthesis and CMOS Technology

Analyzing the Delay, Area, and Power

of CMOS GatesNOTE: Demystification,will not be on the quiz

February 27, 2020 MIT 6.004 Spring 2020 L07-23

Page 24: Logic Synthesis and CMOS Technology

gate

drain

source

MOSFET Physical Structure

WL

Semiconductor

MetalOxide (dielectric)

gatesource drain

n np

source drain

gate

nFET

February 27, 2020 L07-24MIT 6.004 Spring 2020

Page 25: Logic Synthesis and CMOS Technology

MOSFET Electrical View

With VGS < VTH, almost no current flows between

source and drain

As VGS reaches VTH, a channel forms between

source and drain

GSn n

pn

D0V 0V

VGS < VTH

depletion region

GS

n np

nD

0V 0VVGS > VTH

channel

The shape of the channel (and its resistance) also depends on the voltage at the drain. But a low-

resistance channel will exist while VGS > VTH

February 27, 2020 L07-25MIT 6.004 Spring 2020

Page 26: Logic Synthesis and CMOS Technology

FET First-Order Electrical Model

§ Simplest possible model that lets us reason about delay, area, and power. Not very accurate!

D

G

SVGS

D

S

𝑅!"#$$%& = '𝑅'(( 𝑖𝑓 𝑉)* < 𝑉+,

𝑅'- 𝑖𝑓 𝑉)* ≥ 𝑉+,𝐶.#/%

G≈

S

G

D

VSG

D

S

𝑅!"#$$%& = '𝑅'(( 𝑖𝑓 𝑉*) < 𝑉+,

𝑅'- 𝑖𝑓 𝑉*) ≥ 𝑉+,𝐶.#/%

G≈

𝑅!" << 𝑅!##

February 27, 2020 L07-26MIT 6.004 Spring 2020

Page 27: Logic Synthesis and CMOS Technology

CMOS Gate Delay

VDD

VIN

VOUT

VDD

VINVOUT

VOUT(t)

VIN(t)

For t > 0,

t

t

C

VOUT(t)

R

𝑉𝑂𝑈𝑇 𝑡 = 𝑉𝑂𝑈𝑇 0 𝑒 ./012

Consider the following circuit.Given VIN(t), can you derive VOUT(t)?

February 27, 2020 L07-27MIT 6.004 Spring 2020

Page 28: Logic Synthesis and CMOS Technology

Propagation DelayPropagation delay (tPD): Upper bound on the delay from valid inputs to valid outputs.

VOUT ≤ tPD≤ tPD

VIN

VOL

VOH

VIL

VIH

To minimize tPD, must keepresistances and capacitances low

February 27, 2020 L07-28MIT 6.004 Spring 2020

Page 29: Logic Synthesis and CMOS Technology

Contamination Delay

Contamination delay (tCD): Lower bound on the delay from any invalid input to an invalid output

VOUT

VIN

VOL

VOH

VIL

VIH

≥ tCD ≥ tCD

February 27, 2020 L07-29MIT 6.004 Spring 2020

Page 30: Logic Synthesis and CMOS Technology

MOSFET Sizing

§ CMOS gates use MOSFETs with smallest possible L and choose W to set performance§ Wider FETs drive more current (lower R), but their gates

are harder to drive (higher C) and they take more area

gate

drain

source

WL

D

S

𝑅!"#$$%&𝐶.#/%

G≈

𝑅$%&''() ∝𝐶*&+( ∝

How do Cgate and Rchannelchange with L and W?

𝐿 $ 𝑊𝐿/𝑊

February 27, 2020 L07-30MIT 6.004 Spring 2020

Page 31: Logic Synthesis and CMOS Technology

Standard Cell Libraries

§ A standard cell library provides implementations of common gates (NAND, NOR, XOR, etc.) for a specific implementation technology

§ Each gate includes§ Electrical parameters (e.g., Rs and Cs)§ Physical layout

§ Synthesis tools use gates fromthe standard library instead ofsizing and placing individualtransistors

112 nm

574

nm

Example:NAND2

February 27, 2020 L07-31MIT 6.004 Spring 2020

Page 32: Logic Synthesis and CMOS Technology

Wide (High-Fanin) GatesMost standard cell libraries include 2-, 3- and 4-input devices:

But for a large number of inputs, the series connections of too many MOSFETs can lead to very large effective Rpulldownor Rpullup. Instead, use trees of smaller devices…

Example:8-inputNAND

How does tPD grow with the number of inputs N?

If we use a singleCMOS gate, 𝑡𝑃𝐷 ∝ 𝑁

If we use a tree of gates, 𝑡𝑃𝐷 ∝ log(𝑁)

February 27, 2020 L07-32MIT 6.004 Spring 2020

Page 33: Logic Synthesis and CMOS Technology

CMOS Power Dissipation

§ Total power dissipation: 𝑃 = 𝑃!"#$%&' + 𝑃()$)&'§ Dynamic power: Caused by 0↔1 transitions of nodes in the

circuit§ Charging/discharging each capacitor consumes #

$𝐶𝑉%%$ energy

§ If on average 𝐶& capacitance across the chip switches each cycle, and there are 𝑓'() cycles per second

𝑃!"#$%&' =12𝐶*𝑉++

, 𝑓-./§ Static power: Caused by

§ Subthreshold leakage: Even when the FET is off, a very small current flows from source to drain (𝑅*++ < ∞)

§ Tunneling current: Gate and channel are separated by a very thin (<1nm) dielectric, so some electrons tunnel through

𝑃()$)&' = 𝐼()$)&'𝑉𝐷𝐷§ Static power is typically 10-30% of total power

February 27, 2020 L07-33MIT 6.004 Spring 2020

Page 34: Logic Synthesis and CMOS Technology

Summary

§ FETs behave as voltage-controlled switches

§ CMOS gates:§ Use complementary pullup and pulldown networks§ Use pFETs in pullup, nFETs in pulldown network

§ CMOS gates are inverting (rising inputs can only cause falling outputs, and vice versa)

February 27, 2020 L07-34MIT 6.004 Spring 2020

Page 35: Logic Synthesis and CMOS Technology

Thank you!

Next lecture:Combinational devices, introduction to minispec

February 27, 2020 L07-35MIT 6.004 Spring 2020