Beruflich Dokumente
Kultur Dokumente
72
Fwd from
EX/MEM
pipeline reg
Fwd from
MEM/WB
pipeline reg
73
74
Forwarding Paths
75
79
Need to stall
for one cycle
80
82
Stall inserted
here
83
85
Branch Hazards
Flush these
instructions
(Set control
values to 0)
PC
CS/ECE 3330 Fall 2010
86
87
IF
ID
EX
MEM
WB
IF
ID
EX
MEM
WB
IF
ID
EX
MEM
WB
IF
ID
EX
MEM
WB
90
lw
$1, addr
IF
, $5,
$ , $6
$
add $
$4,
beq stalled
ID
EX
MEM
WB
IF
ID
EX
MEM
WB
IF
ID
ID
EX
91
MEM
WB
lw
$1, addr
IF
q stalled
beq
ID
EX
IF
ID
MEM
WB
ID
beq stalled
ID
EX
MEM
WB
92
93
inner:
beq , , inner
beq , , outer
94
2-Bit Predictor
95
96
4.9 Exceptions
Exception
Arises within the CPU
e.g., undefined opcode, overflow, syscall,
97
Interrupt
From an external I/O controller
Dealing
with
them without
D li
ith th
ith t sacrificing
ifi i
performance is hard
10
Sample Exceptions
I/O request
Invoke the operating system from user
program
Arithmetic overflow
Undefined instruction
Hardware malfunction
98
Handling Exceptions
99
11
Exceptions in a Pipeline
102
Exception Example
105
Exception on
40
sub
44
and
48
or
4C
add
50
slt
54
lw
Handler
80000180
80000184
add in
$11, $2, $4
$12, $2, $5
$13 $2,
$2 $6
$13,
$1, $2, $1
$15, $6, $7
$16, 50($7)
sw
sw
$25,
1000($0)
$2
$26, 1004($0)
12
Exception Example
106
Exception Example
107
13
Multiple Exceptions
108
Imprecise Exceptions
109
14