Static Branch Prediction Flashcards

1
Q

Control Hazards

A

Can also be called branch hazards. When the pipeline makes a wrong decisions when predicting branch taken or not taken and has the wrong instructions in the pipeleine.

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

Structural Hazard

A

Two instructions in the pipeline access the same resource. Resolve by executing in series, done by stalling.

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

Every instruction has a unique PC. True or False?

A

True. That is why we can use the PC to index in the predictor table

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

1 and 2 bit saturating counter

A

You update the prediction after every outcome. When it hits 0 and 1 OR 00 and 11, it cannot go higher. So it stays the same.

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

Branch prediction buffer

A

indexed by some sort of address

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

Branch target buffer

A

has a tag and partial data of target location for instructions. Use tag to find matching PC address with same tag bits.

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

Aliasing

A

When two or more branches with different PC mapped/access the same row in the predictor table

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

Return Address Stack

A

A FIFO stack. Before a branch instruction branches/jumps, the PC+4 address is saved to the RAS stack. When an instruction returns, the top value of the stack is taken

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

Interrupts and Exceptions can occur at any stage of the pipeline. True or false?

A

True. The program can trigger an interrupt at any instruction and the program might get set an interrupt by the computer anytime.

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

Precise State/Precise Interrupts

A

When the OS saves the current processor state including the architecture register values and current PC in order to return to the right state. The instructions following the i that caused the interrupt are turned to NOPs.

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

History bits

A

history bits means it can predict the outcome based on previous sets of outcomes

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

1 bit state machine with 1 history bit

A

able to learn the outcome if the previous outcome was 0 or 1. Learns the outcome when the history is 1 or 0.

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

2 level predictor with 2 history bits

A

able to learn the outcome based on two previous outcomes.

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

Size of pattern history table

A

if size of pattern history table&raquo_space; no. of instructions in program, there will be no aliasing. Every 2^n instructions will index to the same entry.

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

Gap

A

global history register (so it includes history for all branches) + private predictor tables (the state of every branch is seperate)

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

Pag

A

private pattern history table (patterns from every branch) + global predictor table

17
Q

Pap

A

private pattern history table + private predictor tables.
For each branch we track the behaviour of that branch and control the behaviour on its own.