02 - Hazards Flashcards

(42 cards)

1
Q

refers to situations that prevent the next instructions in the instruction stream from executing during its designated clock cycle

A

hazards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

reduces performance from the ideal speedup gained by the CPI

A

hazard

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

the [lower/higher] the value of the computed CPI, the better

A

lower

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

classes of hazard (3)

A
  1. structural hazard
  2. data hazard
  3. control hazard
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

arise from resource conflicts when hardware cannot support all possible combinations of instructions simultaneously in overlapped execution

A

structural hazards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

structural hazards are problematic when there is only one __

A

memory port

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

arise when an instruction depends on the results of a previous instruction in a way that is exposed by the overlapping of instructions in the pipeline

A

data hazards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

data hazards can be solved using __ or __ or __

A

forwarding, bypassing, short-circuiting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

types of data hazard (3)

A
  1. WAR - write after read
  2. RAW - read after write
  3. WAW - write after write
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

on types of data hazard: (i and j refers to instructions)

j tries to write a destination before it is read by i, so i incorrectly gets the new value

A

write after read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

on types of data hazard: (i and j refers to instructions)

j tries to write an operand before it is written by i

A

write after write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

on types of data hazard: (i and j refers to instructions)

j tries to read a source before i writes it, so j incorrectly gets the old value

A

read after write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

arise from the pipelining branches and other instructions that change the PC

A

control hazards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

occur when two instructions need the same hardware resource at the same time

A

structural hazards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

approaches to resolving structural hazards (3)

A
  1. schedule
  2. stall
  3. duplicate hardware
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

on approaches to resolving structural hazards:

programmer explicitly avoids scheduling instructions that would create structural hazards

A

schedule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

on approaches to resolving structural hazards:

addition of hardware components that stalls until earlier instructions are no longer using a resource

18
Q

on approaches to resolving structural hazards:

add more hardware so that instructions can independently access the resources at the same time

19
Q

occur when one instruction depends on a data value produced by a preceding instruction still in the pipeline

20
Q

approaches to resolving data hazards (4)

A
  1. schedule
  2. stall
  3. bypass
  4. speculate
21
Q

on approaches to resolving data hazards:

programmer explicitly avoids scheduling instructions that would create data hazards

22
Q

on approaches to resolving data hazards:

puts the instruction that causes the data hazard in the instruction __

A

nop or no operation

23
Q

on approaches to resolving data hazards:

hardware includes control logic that freezes earlier stages until preceding instruction has finished producing data value

24
Q

on approaches to resolving data hazards:

hardware datapath allows values to be sent to an earlier stage before preceding instruction has left the pipeline

25
on approaches to resolving data hazards: perform an operation that may not necessarily be needed and can be killed or reverted once the operation is determined to be not needed
speculate
26
occur when the execution of an instruction depends on a control decision made by an earlier instruction
control hazards
27
what do we need to do to calculate next PC if sequential?
increment PC by 1
28
what do we need to calculate next PC for jumps? (3)
opcode, offset, PC
29
what do we need to calculate next PC for jump register? (2)
opcode, register value
30
what do we need to calculate next PC for conditional branches? (4)
opcode, PC, register, offset
31
what do we need to calculate next PC for all other instructions (aside from control)? (2)
opcode and PC
32
what is the ideal CPI?
1
33
formula for pipeline CPI
ideal pipeline CPI + stalls where stalls can be computed as: structural stalls + data hazard stalls + control stalls
34
measures of performance (3)
1. response time 2. execution time 3. throughput
35
the computer is interested in reducing what measure of performance?
response time
36
time between the start and the completion of an event
response time
37
true or false: response time is also referred to as execution time, but they are different
true, response time refers to the time between when the task was initialized up until it is completed whereas execution time refers to the time the CPU spends on a task
38
refers to the total amount of work done in a given time
throughput
39
in the statement, "X is n times faster than Y", how do you compute for n?
n = Execution time of Y / Execution time of X
40
formula for execution time given the performance
1 / Performance
41
the most straightforward definition of time is called __, __ or __
wall-clock time, response time, elapsed time
42
the latency to complete a task is composed of __, __, __, and __
disk accesses, memory accesses, I/O activities, OS overhead