Question: Branching Prediction In this assignment you will design a branch predictor using the Verilog hardware description language. You will need to use a tournament predictor
Branching Prediction
In this assignment you will design a branch predictor using the Verilog hardware description language. You will need to use a tournament predictor in your design. A tournament predictor ing., Tournament Predictor makes predictions by evaluating the results of multiple branch prediction algorithms. Which predictor's result will be used is stored in a confidence table. The tournament predictor you design should use the GShare predictor and the Perceptron predictor
You will write your design in a verilog file called tournament.v You can imagine that this module will be put into the fetch stage of a pipelined processor. The fetched command and program counter are given to your predictor module in the Fetch phase. Your module
skips or does not skip the branch result. During the execution phase of the pipeline, the branch orders are finalized and the information of these results is passed back to your module. By looking at these results you can understand whether your prediction was right or wrong and improve your future predictions. Your tournament module calls two different predictor modules. Your first predictor uses the GShare algorithm gsharev your second predictor uses the Perceptron algorithm perceptronv Your tournament module uses a confidence table of twopeaked counters to decide which predictor to choose. Accesses to the table are made using some bits of the PS Each entry of the table consists of a twopeaked counter. The state machine of the table is as follows. The counter is updated according to whether the selected predictor predicts correctly or not.The inputoutput signals of the modules you will design should be as follows.
tournament.v
module name: tournament
Parameters
GTBIT: Specifies the number of bits to access the trust table. The GTBIT bit after the most meaningless bits of the program counter is used to address the trust table. The size of the trust table must depend on GTBIT.
GSHAREBIT: Sets the submodule parameter.
PERCPBIT: Sets the submodule parameters.
WEIGHTBIT: Determines the submodule parameter. inputs:
clk bit: Clock input
rst bit: Signal to return the predictor to initial state
fetchps bits: Address of the command to be branch predicted
fetchorder bits: The command to be branch predicted
fetchvalid bit: indicates that the fetch signals in that cycle are valid. You only need to predict in cycles where this input is
yurutps bits: Address of the resulting command
yurutcommand bit: Resulting command
yurutbranch bit: Branching result of the resulting command
yurutdallanps bits: Address to skip if the result is skips
yurutvalid bit: indicates that the yurut signals in that cycle are valid. When this input is only you should use the yurut signals to update your branch predictor.
outputs
resultwave bit: Prediction result does not jump, jumps
resultpredictor bit: Indicates which predictor made the prediction GShare, Perceptron
gshare.v
module name: gshare
Parameters
GSHAREBIT: Specifies the number of bits of the general history register. The GSHAREBIT bit after the least significant bits of the program counter is XORed with the general history register to form the address to access the branch history table. The size of the branch history table must depend on GSHAREBIT.
inputs and outputs:
same as for the tournament module except for resultongorer
perceptron.v
module name: perceptron
Parameters
PERCPBIT: Sets the number of bits of the general history register. The PERCPBIT bit after the most meaningless bits of the program counter is XOR with the general history register to form the address to access the perceptron table. The size of the perceptron table must depend on PERCPBIT. The total number of weights is PERCPBIT
WEIGHTBIT: Determines how many bits each weight has. inputs and outputs:
same as for the tournament module except for resultongoer
You can assume that all orders entering your module are branch orders. You should do the branch prediction combinatorially resultdallan and resultdallanps should be for fetchps and fetchorder in the same cycle
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
