



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




In this project you will construct a branch predictor simulator and use it to design branch predictors.
m = the number of low-order PC bits used to index into the local branch- history table. n = number of bits in the local branch-history register.
Refer to the diagram of the local branch predictor at the top of the next page.
History regs. Counters
Actual branch outcomes Prediction
Program Counter
m +1:
Result from predictors
Both incorrect or both correct
Local correct, global incorrect
Global correct, local incorrect Choice counter update policy
No change Decrement Increment
(a) The counter saturates at 0 and 3 (the counter will never go below zero or above three). (b) All counters are initialized to 1 at the beginning of the simulation (c) The index for the chooser table is bit k +1 to bit 2 of the address of the branch (the value of the PC when the branch is encountered). (d) Only the predictor that was selected (local or global) is updated with the branch behavior. (e) The global history register will be updated even if the local branch predictor is selected.
You should be abe to select any of the predictors (local, global, or hybrid) based on a command-line parameter. The parameters of the simulation are:
{ m , n 1 } for local branch predictor. { n 2 } for global branch predictor. { k ,{ m , n 1 }, { n 2 }} for the hybrid predictor.
The simulator reads a trace file in the following format:
0x〈hex branch PC〉 t/n 0x〈hex branch PC〉 t/n …
where 〈hex branch PC〉 holds the hexadecimal form of address of the branch instruction in memory. “t” indicates that the branch is actually taken. “n” indicates that the branch is not taken.
Example 1100023b t 0a050201 n
The simulation output should include:
eos%
For example, For local branch predictor, eos% local gcc_trace.txt 12 8 First parameter is number of low-order PC bits ( m = 12). Second parameter is number of bits in history register ( n = 8).
For the traces given in the course locker (directory /afs/eos/courses/ece/ece521/common/www/homework/projects/2/traces), use your simulator as follows:
(1) ( All students ) Do a preliminary design-space search using the following configurations. Local Branch Predictor : (5 ≤ m ≤ 15, 2 ≤ n ≤ m ), where n is even.
(2) ( All students ) Do a preliminary design-space search using the following configurations:
Global Branch Predictor: (5 ≤ n ≤ 15)
(3) ( All students ) Do an intelligent search of the design space to minimize misprediction rate and minimize predictor cost in bits given a maximum budget of