Introduction to
CMOS VLSI
Design
Lecture 2:
MIPS Processor Example
Credits: David Harris
Harvey Mudd College
(Material taken/adapted from
Harris’ lecture notes)
Outline
 Design Partitioning
 MIPS Processor Example
– Architecture
– Microarchitecture
– Logic Design
– Circuit Design
– Physical Design
 Fabrication, Packaging, Testing
2: MIPS Processor Example
CMOS VLSI Design
Slide 2
Activity 2
 Sketch a stick diagram for a 4-input NOR gate
2: MIPS Processor Example
CMOS VLSI Design
Slide 3
Activity 2
 Sketch a stick diagram for a 4-input NOR gate
VDD
A
B
C
D
Y
GND
2: MIPS Processor Example
CMOS VLSI Design
Slide 4
Coping with Complexity
 How to design System-on-Chip?
– Many millions (soon billions!) of transistors
– Tens to hundreds of engineers
 Structured Design
 Design Partitioning
2: MIPS Processor Example
CMOS VLSI Design
Slide 5
Structured Design
 Hierarchy: Divide and Conquer
– Recursively system into modules
 Regularity
– Reuse modules wherever possible
– Ex: Standard cell library
 Modularity: well-formed interfaces
– Allows modules to be treated as black boxes
 Locality
– Physical and temporal
2: MIPS Processor Example
CMOS VLSI Design
Slide 6
Design Partitioning
 Architecture: User’s perspective, what does it do?
– Instruction set, registers
– MIPS, x86, Alpha, PIC, ARM, …
 Microarchitecture
– Single cycle, multcycle, pipelined, superscalar?
 Logic: how are functional blocks constructed
– Ripple carry, carry lookahead, carry select adders
 Circuit: how are transistors used
– Complementary CMOS, pass transistors, domino
 Physical: chip layout
– Datapaths, memories, random logic
2: MIPS Processor Example
CMOS VLSI Design
Slide 7
Gajski Y-Chart
2: MIPS Processor Example
CMOS VLSI Design
Slide 8
MIPS Architecture
 Example: subset of MIPS processor architecture
– Drawn from Patterson & Hennessy
 MIPS is a 32-bit architecture with 32 registers
– Consider 8-bit subset using 8-bit datapath
– Only implement 8 registers ($0 - $7)
– $0 hardwired to 00000000
– 8-bit program counter
 You’ll build something similar/smaller in the
assignments
– Illustrate the key concepts in VLSI design
2: MIPS Processor Example
CMOS VLSI Design
Slide 9
Instruction Set
2: MIPS Processor Example
CMOS VLSI Design
Slide 10
Instruction Encoding
 32-bit instruction encoding
– Requires four cycles to fetch on 8-bit datapath
form at
R
I
J
e xam ple
add $rd, $ra, $rb
beq $ra, $rb, imm
j dest
2: MIPS Processor Example
e ncoding
6
5
5
5
5
6
0
ra
rb
rd
0
funct
6
5
5
16
op
ra
rb
imm
6
26
op
dest
CMOS VLSI Design
Slide 11
Fibonacci (C)
f0 = 1; f-1 = -1
fn = fn-1 + fn-2
f = 1, 1, 2, 3, 5, 8, 13, …
2: MIPS Processor Example
CMOS VLSI Design
Slide 12
Fibonacci (Assembly)
 1st statement: n = 8
 How do we translate this to assembly?
2: MIPS Processor Example
CMOS VLSI Design
Slide 13
Fibonacci (Assembly)
2: MIPS Processor Example
CMOS VLSI Design
Slide 14
Fibonacci (Binary)
 1st statement: addi $3, $0, 8
 How do we translate this to machine language?
– Hint: use instruction encodings below
form at
R
I
J
e xam ple
add $rd, $ra, $rb
beq $ra, $rb, imm
j dest
2: MIPS Processor Example
e ncoding
6
5
5
5
5
6
0
ra
rb
rd
0
funct
6
5
5
16
op
ra
rb
imm
6
26
op
dest
CMOS VLSI Design
Slide 15
Fibonacci (Binary)
 Machine language program
2: MIPS Processor Example
CMOS VLSI Design
Slide 16
MIPS Microarchitecture
 Multicycle marchitecture from Patterson & Hennessy
P C W rit eC on d
P C S our ce
PCEn
P C W rit e
Ior D
O utp u ts
A LU O p
AL U S rcB
M em R e ad
M em W r ite
C o ntr ol
IR W rite[3:0]
A LU S rcA
R e gW rite
M e m to R eg
Op
[5 : 0]
R egD s t
0
M
6
Ins truc tio n [5 : 0 ]
8
S hift
left 2
Jum p
ad dre ss
1 u
x
2
Ins truc tio n
[3 1: 26 ]
PC
0
M
u
x
1
Ad d re s s
M e m or y
In stru ction
[25 : 21 ]
Read
r eg ister 1
In stru ction
[20 : 16 ]
Read
Read
r eg ister 2 da ta 1
R e giste rs
W rite
Read
r eg ister
da ta 2
M em D ata
In stru ction
[1 5 : 0 ]
W rite
d a ta
Ins tru ctio n
re g is te r
Ins truc tio n
[7 : 0]
M e m o ry
d a ta
re g is te r
0
M
In stru ctio n u
x
[1 5 : 11 ]
1
0
M
u
x
1
A
B
W rite
d a ta
0
M
u
x
1
Z er o
ALU
ALU
r es ult
ALU O ut
0
1
1 M
u
2 x
3
ALU
c on tro l ALUControl
Ins tru ctio n [5 : 0]
2: MIPS Processor Example
CMOS VLSI Design
Slide 17
Multicycle Controller
In s tru c tion fe tc h
3
=
(Op
5
p
r (O
') o
'L B
B
= 'S
')
9
11
A L U S rc A = 1
A L U S rc B = 00
A L U O p = 10
')
e)
A L U S rc A = 1
A L U S rc B = 0 0
ALUOp = 01
P C W rite C o n d
P C S o u rc e = 0 1
Q
typ
E
Rp =
A L U S rc A = 0
A L U S rc B = 1 1
A L U O p = 00
B ra n c h
co m p le tio n
E xe c u tio n
A L U S rc A = 1
A L U S rc B = 1 0
ALU Op = 00
Jump
c o m p le tio n
12
P C W rite
P C S o u rc e = 1 0
(O
p
=
'S
B
')
( O p = 'L B ')
(O
4
'B
Reset
M e m o ry a d d r es s
c o m p u ta tio n
In stru c tio n d e c o d e/
re g is te r fe tch
M em R e ad
A L U S rc A = 0
Io rD = 0
IR W rite 0
A L U S rc B = 0 1
ALUOp = 00
P C W rite
P C S o u rc e = 0 0
=
M em R e ad
A L U S rc A = 0
Io rD = 0
IR W rite 1
A L U S rc B = 0 1
ALUOp = 00
P C W rite
P C S o u rc e = 0 0
(O p = 'J')
2
M em R e ad
A L U S rc A = 0
Io rD = 0
IR W rite 2
A L U S rc B = 0 1
ALUOp = 00
P C W rite
P C S o u rc e = 0 0
p
1
M em R e ad
A L U S rc A = 0
Io rD = 0
IR W rite 3
A L U S rc B = 0 1
ALUOp = 00
P C W rite
P C S o u rc e = 0 0
(O
0
M e m o ry
a c ce ss
6
M e m o ry
a c c es s
8
M e m R ea d
Io rD = 1
R -ty pe c o m p le tio n
10
M e m W r ite
Io rD = 1
R e gD st = 1
R e g W rite
M e m to R e g = 0
W rite -b a c k s te p
7
R eg D st = 0
R eg W rite
M e m to R e g = 1
2: MIPS Processor Example
CMOS VLSI Design
Slide 18
Logic Design
 Start at top level
– Hierarchically decompose MIPS into units
 Top-level interface
crystal
oscillator
2-phase
clock
generator
memread
memw rite
ph1
ph2
reset
MIPS
processor
adr
w ritedata
memdata
2: MIPS Processor Example
CMOS VLSI Design
8
8
8
external
memory
Slide 19
Block Diagram
P C W rit eC on d
P C S our ce
PCEn
P C W rit e
Ior D
O utp u ts
A LU O p
AL U S rcB
M em R e ad
M em W r ite
C o ntr ol
A LU S rcA
R e gW rite
M e m to R eg
IR W rite[3:0]
Op
[5 : 0]
R egD s t
0
M
6
Ins truc tio n [5 : 0 ]
8
S hift
left 2
Jum p
ad dre ss
memwrite
0
M
u
x
1
In stru ction
[25 : 21 ]
Ad d re s s
M e m or y
In stru ction
[20 : 16 ]
M em D ata
In stru ction
[1 5 : 0 ]
W rite
d a ta
Ins tru ctio n
re g is te r
Ins truc tio n
[7 : 0]
M e m o ry
d a ta
re g is te r
memread
0
M
u
x
1
Read
r eg ister 1
0
M
In stru ctio n u
x
[1 5 : 11 ]
1
Read
Read
r eg ister 2 da ta 1
R e giste rs
W rite
Read
r eg ister
da ta 2
A
B
ALU
r es ult
ALU O ut
0
1
W rite
d a ta
0
M
u
x
1
Z er o
ALU
1 M
u
2 x
3
ALU
c on tro l ALUControl
Ins tru ctio n [5 : 0]
controller
aluop[1:0]
alucontrol
alucontrol[2:0]
funct[5:0]
irwrite[3:0]
regwrite
iord
regdst
memtoreg
pcsource[1:0]
pcen
alusrcb[1:0]
alusrca
zero
op[5:0]
ph1
ph2
reset
adr[7:0]
datapath
writedata[7:0]
memdata[7:0]
2: MIPS Processor Example
CMOS VLSI Design
1 u
x
2
Ins truc tio n
[3 1: 26 ]
PC
Slide 20
Hierarchical Design
mips
controller
alucontrol
datapath
standard
cell library
bitslice
inv4x flop ramslice
alu
fulladder or2
zipper
and2 mux4
nor2 inv nand2
mux2
tri
2: MIPS Processor Example
CMOS VLSI Design
Slide 21
HDLs
 Hardware Description Languages
– Widely used in logic design
– Verilog and VHDL
 Describe hardware using code
– Document logic functions
– Simulate logic before building
– Synthesize code into gates and layout
• Requires a library of standard cells
2: MIPS Processor Example
CMOS VLSI Design
Slide 22
Verilog Example
module fulladder(input a, b, c,
output s, cout);
a b c
a
b
sum
cout
sum
carry
endmodule
s1(a, b, c, s);
c1(a, b, c, cout);
c
carry
s
fulladder
cout
s
module carry(input a, b, c,
output cout)
assign cout = (a&b) | (a&c) | (b&c);
endmodule
2: MIPS Processor Example
CMOS VLSI Design
Slide 23
Circuit Design
 How should logic be implemented?
– NANDs and NORs vs. ANDs and ORs?
– Fan-in and fan-out?
– How wide should transistors be?
 These choices affect speed, area, power
 Logic synthesis makes these choices for you
– Good enough for many applications
– Hand-crafted circuits are still better
2: MIPS Processor Example
CMOS VLSI Design
Slide 24
Example: Carry Logic
 assign cout = (a&b) | (a&c) | (b&c);
Transistors? Gate Delays?
2: MIPS Processor Example
CMOS VLSI Design
Slide 25
Example: Carry Logic
 assign cout = (a&b) | (a&c) | (b&c);
g1
a
b
x
g2
a
c
g4
y
cout
g3
b
c
z
Transistors? Gate Delays?
2: MIPS Processor Example
CMOS VLSI Design
Slide 26
Example: Carry Logic
 assign cout = (a&b) | (a&c) | (b&c);
a
p1
c
c
a
n1
b
p2
p3 i3
n3 i1
b n2
b
a
a
b
p4
i4
p5
cn
n5
i2
n4
p6
cout
n6
Transistors? Gate Delays?
2: MIPS Processor Example
CMOS VLSI Design
Slide 27
Gate-level Netlist
module carry(input a, b, c,
output cout)
g1
wire
x, y, z;
x
g2
and g1(x, a,
and g2(y, a,
and g3(z, b,
or g4(cout,
endmodule
2: MIPS Processor Example
a
b
b);
c);
c);
x, y, z);
CMOS VLSI Design
a
c
g4
y
cout
g3
b
c
z
Slide 28
Transistor-Level Netlist
module carry(input a, b, c,
output cout)
wire
tranif1
tranif1
tranif1
tranif1
tranif1
tranif0
tranif0
tranif0
tranif0
tranif0
tranif1
tranif0
endmodule
i1, i2, i3, i4, cn;
n1(i1, 0, a);
n2(i1, 0, b);
n3(cn, i1, c);
n4(i2, 0, b);
n5(cn, i2, a);
p1(i3, 1, a);
p2(i3, 1, b);
p3(cn, i3, c);
p4(i4, 1, b);
p5(cn, i4, a);
n6(cout, 0, cn);
p6(cout, 1, cn);
2: MIPS Processor Example
a
p1
c
c
a
n1
CMOS VLSI Design
b
p2
p3 i3
n3 i1
b n2
b
a
a
b
p4
i4
p5
n5
i2
n4
cn
p6
cout
n6
Slide 29
SPICE Netlist
.SUBCKT CARRY A B C COUT VDD GND
MN1 I1 A GND GND NMOS W=1U L=0.18U AD=0.3P AS=0.5P
MN2 I1 B GND GND NMOS W=1U L=0.18U AD=0.3P AS=0.5P
MN3 CN C I1 GND NMOS W=1U L=0.18U AD=0.5P AS=0.5P
MN4 I2 B GND GND NMOS W=1U L=0.18U AD=0.15P AS=0.5P
MN5 CN A I2 GND NMOS W=1U L=0.18U AD=0.5P AS=0.15P
MP1 I3 A VDD VDD PMOS W=2U L=0.18U AD=0.6P AS=1 P
MP2 I3 B VDD VDD PMOS W=2U L=0.18U AD=0.6P AS=1P
MP3 CN C I3 VDD PMOS W=2U L=0.18U AD=1P AS=1P
MP4 I4 B VDD VDD PMOS W=2U L=0.18U AD=0.3P AS=1P
MP5 CN A I4 VDD PMOS W=2U L=0.18U AD=1P AS=0.3P
MN6 COUT CN GND GND NMOS W=2U L=0.18U AD=1P AS=1P
MP6 COUT CN VDD VDD PMOS W=4U L=0.18U AD=2P AS=2P
CI1 I1 GND 2FF
CI3 I3 GND 3FF
CA A GND 4FF
CB B GND 4FF
CC C GND 2FF
CCN CN GND 4FF
CCOUT COUT GND 2FF
.ENDS
2: MIPS Processor Example
CMOS VLSI Design
Slide 30
Physical Design
 Floorplan
 Standard cells
– Place & route
 Datapaths
– Slice planning
 Area estimation
2: MIPS Processor Example
CMOS VLSI Design
Slide 31
MIPS Floorplan
10 I/O pads
mips
(4.6 M2)
control
1500  x 400 
(0.6 M2)
zipper 2700  x 250 
datapath
2700  x 1050 
(2.8 M2)
10 I/O pads
1690
3500
5000 
10 I/O pads
wiring channel: 30 tracks = 240 
alucontrol
200  x 100 
(20 k2)
bitslice 2700  x 100 
2700 
3500 
10 I/O pads
5000
2: MIPS Processor Example
CMOS VLSI Design
Slide 32
MIPS Layout
2: MIPS Processor Example
CMOS VLSI Design
Slide 33
Standard Cells






Uniform cell height
Uniform well height
M1 VDD and GND rails
M2 Access to I/Os
Well / substrate taps
Exploits regularity
2: MIPS Processor Example
CMOS VLSI Design
Slide 34
Synthesized Controller
 Synthesize HDL into gate-level netlist
 Place & Route using standard cell library
2: MIPS Processor Example
CMOS VLSI Design
Slide 35
Pitch Matching
 Synthesized controller area is mostly wires
– Design is smaller if wires run through/over cells
– Smaller = faster, lower power as well!
 Design snap-together cells for datapaths and arrays
– Plan wires into cells
A
A
A
A
B
– Connect by abutment
A
A
A
A
B
• Exploits locality
A
A
A
A
B
A
A
A
A
B
• Takes lots of effort
C
2: MIPS Processor Example
CMOS VLSI Design
C
D
Slide 36
MIPS Datapath
 8-bit datapath built from 8 bitslices (regularity)
 Zipper at top drives control signals to datapath
2: MIPS Processor Example
CMOS VLSI Design
Slide 37
Slice Plans
 Slice plan for bitslice
– Cell ordering, dimensions, wiring tracks
– Arrange cells for wiring locality
2: MIPS Processor Example
CMOS VLSI Design
Slide 38
MIPS ALU
 Arithmetic / Logic Unit is part of bitslice
2: MIPS Processor Example
CMOS VLSI Design
Slide 39
Area Estimation
 Need area estimates to make floorplan
– Compare to another block you already designed
– Or estimate from transistor counts
– Budget room for large wiring tracks
– Your mileage may vary!
2: MIPS Processor Example
CMOS VLSI Design
Slide 40
Design Verification
 Fabrication is slow & expensive
– MOSIS 0.6mm: $1000, 3 months
– State of art: $1M, 1 month
 Debugging chips is very hard
– Limited visibility into operation
 Prove design is right before building!
– Logic simulation
– Ckt. simulation / formal verification
– Layout vs. schematic comparison
– Design & electrical rule checks
 Verification is > 50% of effort on most chips!
Specification
=
Function
=
Function
=
Function
=
Function
Timing
Power
Architecture
Design
Logic
Design
Circuit
Design
Physical
Design
2: MIPS Processor Example
CMOS VLSI Design
Slide 41
Fabrication & Packaging
 Tapeout final layout
 Fabrication
– 6, 8, 12” wafers
– Optimized for throughput, not latency (10 weeks!)
– Cut into individual dice
 Packaging
– Bond gold wires from die I/O pads to package
2: MIPS Processor Example
CMOS VLSI Design
Slide 42
Testing
 Test that chip operates
– Design errors
– Manufacturing errors
 A single dust particle or wafer defect kills a die
– Yields from 90% to < 10%
– Depends on die size, maturity of process
– Test each part before shipping to customer
2: MIPS Processor Example
CMOS VLSI Design
Slide 43
Descargar

Document