Question: Your task in this project is hardware implementation of a tournament predictor ( which utilizes several dynamic branch predictors ) in VHDL or Verilog and

Your task in this project is hardware implementation of a tournament predictor (which utilizes several dynamic branch predictors) in VHDL or Verilog and compare their performance.
Tournament predictors use multiple predictors: a global predictor and a local predictor and choosing between them with a selector as shown in figure. A global predictor uses the most
recent branch history (2-bit) to index the predictor, while a local predictor uses the address of the branch as the index. In this project, a tournament predictor combines a global (2,2)
r.orrelating hranch nredictor and )-level local
Figure 1. Tournament Predictor with Initial Values
State diagrams for 2-bit predictors and for the Selector are given in Figure 2 below. These are to be implemented as saturating
counters.
2-bit predictor state diagram
In this project, you will build a (2,2) correlating predictor for the Global Predictor, a (1,2) correlating predictor for the Local Predictors and the 2-bit Selector
In the case of (2,2) global predictor, 2 previous branch outcomes need to be monitored. A 2-bit shift register is required for GBH. There will be 22=4 predictions (4 columns). Prediction
value is based on the 2-bit saturating counter which is initialized according to Figure 1.(1,2) local predictor requires only the last branch information and there will be 2
possible predictions (2 columns). Again, the prediction values are based on the 2-bit saturating counter initialized according to Figure 1 The Selector is initialized to
state G2 for Branch 1 and state G2 for Branch 2.(see Figure 1).
You are only responsible for branch predictor implementation. Dynamic predictor block will be built with counters, shift registers and multiplexors. You don't need to implement
any CPU datapath, Therefore, the input to the system will be a sequence of branch number (id #) and the correct corresponding outcome for a given program. You can generate
this seauence in anv wav. (C code. Matlab code. ovthon script etc...).
Branch sequence:
dots(B2,T),(B1,T),(B1,NT)dots
Predictor
Update the predictors,
Report # of misses
An example is given in the following table. This can be used as input to your dynamic branch predictors
2.4 Test Program:
Consider the following code which has 2 unique branches and 5,000 branch decisions in total.
int c??;
int main (){
int ,i,i?
for
for (j=0;j5;j++){c+++
}
}
You have four main tasks for the test program:
Convert it to the assembly code in MIPS/RISC-V language.
Generate all branch decisions using an external program/script.
Use this generated sequence as input to your HDL architecture. HDL
components should include:
Selector (a 2-bit saturating counter)
(2,2) Correlating predictor (Global predictor)- needs a 2-bit shift register and a 2-bit counter
(1,2) local predictors for 2 branches - each one needs a 2-bit counter
Generate the output of each component (global predictor, local predictor and the selector) and find out number of
mispredictions for the tournament predictor. Analyze the performance
DELIVERABLES
i. MIPS/RISC-V assembly code for the test program
ii. Script for generating the branch outcome sequence
iii. HDL source code for each branch predictor implementation
iv. HDL simulation results and waveforms for the tournament predictor implementation
v. Table comparing # of mispredictions.
please try to answer the deliverable. main thing is i need verilog code(script).
Your task in this project is hardware

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!