Heuring Chap-4
Heuring Chap-4
Chapter 4 Topics
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-2 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-3 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-4 Chapter 4 - Processor Design
Figure 4.11
Control Unit
ADD
Wait
PCin
Gra
Control signals out Control unit inputs
31 0 〈31..0〉
R0
32 32-bit 32 31 0
general PC
purpose
registers Main Input/
Data Path
memory output
R31
IR
MA
A B
To memory subsystem
ALU
C MD Memory bus
C
Figures 4.2, 4.3
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-5 Chapter 4 - Processor Design
R31
IR
MA
A B
To memory subsystem
ALU
C MD
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-6 Chapter 4 - Processor Design
Step RTN
T0. MA ← PC: C ← PC + 4; R31
T1. MD ← M[MA]: PC ← C; IR
T2. IR ← MD; IF
A
T3. A ← R[rb];
IEx. A B
MA
T5. R[ra] ← C; C MD
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-9 Chapter 4 - Processor Design
Step RTN
T0. MA ← PC: C ← PC + 4; R31
T1. MD ← M[MA]; PC ← C; IR
T5. R[ra] ← C; C MD
Tbl 4.3
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-12 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-13 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-14 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-15 Chapter 4 - Processor Design
Tbl 4.5
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-17 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-18 Chapter 4 - Processor Design
D
D Q
C
C
Q
C
C
Q
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-19 Chapter 4 - Processor Design
Fig. 4.4 The SRC Register File and Its Control Signals
BA = Base Address
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-20 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-21 Chapter 4 - Processor Design
• MD can drive
CPU bus or
mem. bus
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-22 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-23 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-24 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-25 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-27 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-28 Chapter 4 - Processor Design
• The concrete RTN for shr relies upon a 5 bit register to hold
the shift count
• It must load, decrement, and have an = 0 test
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-29 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-30 Chapter 4 - Processor Design
Branching
cond := ( c3〈〈2..0〉〉=0 → 0:
c3〈〈2..0〉〉=1 → 1:
c3〈〈2..0〉〉=2 → R[rc]=0:
c3〈〈2..0〉〉=3 → R[rc]≠≠0:
c3〈〈2..0〉〉=4 → R[rc]〈〈31〉〉=0:
c3〈〈2..0〉〉=5 → R[rc]〈〈31〉〉=1 ):
• This is equivalent to the logic expression
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-31 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-33 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-34 Chapter 4 - Processor Design
Data Enable
Rout
Clock Enable
Rin
Clock
Tsu Th
• tR2valid (total delay) = tco + tg + tbp + tcomb + tsu
• As long as th<tdelay we don’t have to worry about it!
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-35 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-36 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-37 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-38 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-39 Chapter 4 - Processor Design
FETCH
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
.
Rout
ADD
PCin
Gra
Wait
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-41 Chapter 4 - Processor Design
T2. MD
out
, IR
in
T4. Grc, R
out
, ADD, C
in T4. c2
out
, ADD, C
in T4. c2
out
, ADD, C
in T4. n=0 → (Grc, R
out
, Ld)
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-42 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-43 Chapter 4 - Processor Design
T1 add T5
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-44 Chapter 4 - Processor Design
Control
Countln step • Reset will
decoder synchronously
4 reset counter to
step T0
0110 Load
Reset
Goto6
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-45 Chapter 4 - Processor Design
4
Enable (G)
Wait (C)
3 K Q To memory system
Legend
Write (C) J Q W (G) E – External
G – Generated
C – Control signal
K Q I – Internal
Fetch
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-47 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-48 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-49 Chapter 4 - Processor Design
A B
ALU
C
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-50 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-51 Chapter 4 - Processor Design
T 1 − bus − T 2 − bus
%Speedup = × 100
T 2 − bus
Where
T = Exec' n.Time = IC × CPI × τ
IC ≡ Instruction Count
CPI ≡ Clocks Per Instruction
τ ≡ Clock period
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-52 Chapter 4 - Processor Design
T 1 − bus − T 2 − bus
% Speedup = × 100
T 2 − bus
IC × 8 × τ − IC × 7 × τ 8−7
= × 100 = × 100 = 14 %
IC × 7 × τ 7
Class Problem:
How will this speedup change if clock period of 2-bus machine is increased by 10%?
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-53 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-54 Chapter 4 - Processor Design
A B
ALU
C
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-55 Chapter 4 - Processor Design
IC × 8 × τ − IC × 4 × 1.1τ 8− 4.4
%Speedup= × 100 = × 100 = 82%
IC × 4 × 1.1τ 4.4
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-57 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-58 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-59 Chapter 4 - Processor Design
Processor State
Strt: Start signal
Rst: External reset signal
instruction_interpretation := (
¬Run∧ ∧Strt → (Run ← 1: PC, R[0..31] ← 0);
∧¬Rst
∧¬
Run∧¬ → (IR ← M[PC]: PC ← PC + 4;
instruction_execution):
Run∧∧Rst → ( Rst ← 0: PC ← 0); instruction_interpretation):
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-60 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-61 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-62 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-63 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-64 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-65 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-66 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-67 Chapter 4 - Processor Design
Kinds of Exceptions
• System reset
• Exceptions associated with memory access
• Machine check exceptions
• Data access exceptions
• Instruction access exceptions
• Alignment exceptions
• Program exceptions
• Miscellaneous hardware exceptions
• Trace and debugging exceptions
• Non-maskable exceptions
• External exceptions—interrupts
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-68 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-69 Chapter 4 - Processor Design
instruction_interpretation :=
¬Run∧
(¬ ∧Strt → Run ← 1:
∧¬(ireq∧
∧¬
Run∧¬ ∧IE) → (I ← M[PC]: PC ← PC + 4; instruction_execution):
Run∧∧(ireq∧
∧IE) → (IPC ← PC〈〈31..0〉〉:
II〈〈15..0〉〉 ← Isrc_info〈〈15..0〉〉: iack ← 1:
IE ← 0: PC ← Ivect〈〈31..0〉〉; iack ← 0);
instruction_interpretation);
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-71 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-72 Chapter 4 - Processor Design
Step ¬(ireq∧
∧IE) Concrete RTN ∧IE)
(ireq∧
¬(ireq∧
T0. (¬ ∧IE) → ( (ireq∧∧IE) → (IPC ← PC: II ← Isrc_info:
MA ← PC: C ← PC+4): IE ← 0: PC←← 22@0#Isrc_vect〈〈7..0〉〉#00:
Iack←←1; Iack ← 0: End);
T1. MD ← M[MA] : PC ← C;
T2. IR ← MD;
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-73 Chapter 4 - Processor Design
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001
4-74 Chapter 4 - Processor Design
SRC
Informal description
Chapter 2
formal RTN description
block diagram architecture
Chapter 4 Summary
Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan, Updated by David M. Zar, 2/2001