Professional Documents
Culture Documents
William Stallings
Computer Organization
and Architecture
10th Edition
© 2016 Pearson Education, Inc., Hoboken,
NJ. All rights reserved.
+ Chapter 15
Reduced Instruction Set Computers (RISC)
Characteristics
important in the programmer’s expression of
algorithms
•Often support naturally the use of structured
programming and/or object-oriented design
Execution sequencing
Semantic gap
•Determines the control and
pipeline organization •The difference between the
operations provided in HLLs
and those provided in computer
architecture
Operands used
•The types of operands and the
Operations performed
frequency of their use determine •Determine the functions to be
the memory organization for performed by the processor and
storing them and the addressing its interaction with memory
modes for accessing them
Pascal C Average
Integer Constant 16% 23% 20%
Scalar Variable 58% 53% 55%
Array/Structure 26% 24% 25%
Requires sophisticated
program analysis
Call/Return
A.param B.temp =
C.param
Saved
window w0 w1
pointer
w5 w2 C.loc
(F)
w4 w3
C.temp =
D.param
(E) D.loc
Current
window
pointer
Call
Return
Data
W# Decoder
Instruction
A
Tags Data
Compare Select
Data
(b) Cache
D
E
D F
C E
R1 R2 R3
Actual Registers
(a) Time sequence of active use of registers (b) Register interference graph
Simple addressing • Simplifies the instruction set and the control unit
modes
(a) A ¬ B + C
8 16 16 16 8 4 4 4
Add B C A Add RA RB RC
Add A C B Add RB RA RC
Sub B D D Sub RD RD RB
Memory to memory Register to register
I = 168, D= 288, M = 456 I = 60, D = 0, M = 60
(b) A ¬ B + C; B ¬ A + C; D ¬ D – B
Delayed branch
Does not take effect until after execution of following instruction
This following instruction is the delay slot
Delayed Load
Register to be target is locked by processor
Continue execution of instruction stream until register required
Idle until load is complete
Re-arranging instructions can allow useful work while loading
Loop Unrolling
Replicate body of loop a number of times
Iterate loop fewer times
Reduces loop overhead
Increases instruction parallelism
Improved register, data cache, or TLB locality
1 2 3 4 5 6 7 8
100 LOAD X, rA I E D
101 ADD 1, rA I E
102 JUMP 105 I E
103 ADD rA, rB I E
105 STORE rA, Z I E D
1 2 3 4 5 6 7 8
100 LOAD X, rA I E D
101 ADD 1, rA I E
102 JUMP 106 I E
103 NOOP I E
106 STORE rA, Z I E D
1 2 3 4 5 6
100 LOAD X, Ar I E D
101 JUMP 105 I E
102 ADD 1, rA I E
105 STORE rA, Z I E D
do i=2, n-2, 2
a[i] = a[i] + a[i-1] * a[i+i]
a[i+l] = a[i+l] + a[i] * a[i+2]
end do
i f (mod(n-2,2) = i) t hen
a[n-1] = a[n-1] + a[n-2] * a[n]
end i f
6 26
J-type Operation Target
(jump)
6 5 5 5 5 6
R-type Operation rs rt rd Shift Function
(register)
f1 f2 f1 f2 f1 f2 f1 f2 f1 f2
IF RD ALU MEM WB
IA
IF = Instruction fetch
Cycle Cycle Cycle Cycle Cycle Cycle RD = Read
MEM = Memory access
ITLB I-Cache RF ALU DTLB D-Cache WB WB = Write back to register file
I-Cache = Instruction cache access
RF = Fetch operand from register
(b) Modified R3000 pipeline with reduced latencies D-Cache = Data cache access
ITLB = Instruction address translation
IDEC = Instruction decode
IA = Compute instruction address
DA = Calculate data virtual address
Cycle Cycle Cycle Cycle Cycle DTLB = Data address translation
TC = Data cache tag check
ITLB RF ALU D-Cache TC WB
(c) Optimized R3000 pipeline with parallel TLB and cache accesses
f2
Clock Cycle
f1 f2 f1 f2 f1 f2 f1 f2
IF IS RF EX DF DS TC WB
IF IS RF EX DF DS TC WB
7 R7 R7 R7
•
Globals Globals • Globals Globals
•
0 R0 R0 R0
WIM
w1
ins w1
w7
outs locals
w0 w0 w1
w7 w0 locals outs outs
locals ins
w2
ins
w7
ins w6 w2
outs locals
w6 w2
locals outs w3
ins
w6
ins
w4 w3
w5 w4 w4 ins locals
outs outs locals
w5
w3
locals
w5 outs
ins
2 1 4 3 22
Branch Op a Cond Op2 PC-relative displacement
Format
2 5 3 22
SETHI
Op Dest Op2 Immediate Constant
Format
2 5 6 5 9 5
Floating-
Point Op Dest Op3 Src-1 FP-op Src-2
Format
2 5 6 5 1 8 5
Op Dest Op3 Src-1 0 ignored Src-2
General
Formats
Op Dest Op3 Src-1 1 Immediate Constant
Qualitative
Examine issues of high level language support and use of VLSI
real estate