[SOLVED] ECE GY 6193 Lab 2: Branch Prediction

$25

File Name: ECE_GY_6193_Lab_2:_Branch_Prediction.zip
File Size: 339.12 KB

5/5 - (1 vote)

ECE GY 6193 Lab 2: Branch Prediction

In this lab, you will simulate a correlating branch predictor that makes use of 2-bit saturating counters. You are provided with a text file containing a trace of branch instructions consisting of the PC at which each branch occurs, and whether the branch is Taken or Not Taken.
Your goal is write code to evaluate the performance of a correlating branch predictor on this trace. Your output file indicates, for each branch in the trace, whether it was predicted as Taken or Not Taken.
Branch Predictor Architecture
Your design must consist of 2m+k 2-bit saturating counters indexed using m LSBs of each branch instruction and a k bit Branch History Register (BHR) that records the outcomes of the previous k branches. Each 2-bit saturating predictor starts in the 11 (Predict Taken with High Confidence) state and is updated as per the finite state machine discussed in Lecture 12. Further, you can assume that the BHR is initialized assuming the previous k branches were Taken.
The values of m and k are specified in a config file config.txt.
The maximum values of m = 20 and k = 8.
Config File
The config file config.txt contains a single line with the value of m and k. A sample file for m=12 and k=2 is provided.
Trace File
The trace file, trace.txt, contains one branch per line. Each line has the PC for the corresponding branch (in hex format) followed by a single bit indicating Taken (1) or Not Taken (0). A sample trace file is provided.A sample trace file is provided.
Output Format
The output from your simulator should be a file trace.out that has one line per branch. Each line has a single bit which indicates whether that branch was predicted as Taken (1) or Not Taken (0).
What to Submit
Code
Your source code. On compilation (we will use your readme file to compile your code), we should be able to execute your simulator with the following command
./branchsimulator.out config.txt trace.txt
Your simulator should output a file trace.out in the same directory.
A readme.txt with instructions on how to compile your code

Note: we are not providing you with skeleton code for this assignment, since all the code you might need can be extracted from the code for Lab 1.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] ECE GY 6193 Lab 2: Branch Prediction
$25