Chat with us, powered by LiveChat Simulate a simple branch predictor with a 2-bit saturating counter.(c++) - EssayAbode

Simulate a simple branch predictor with a 2-bit saturating counter.(c++)

Please do not plagiarize.

Please see the detailed question in the attached.

You will have branchsimulator_skeleton.cpp config.txt makefile.txt trace.txt

In this lab, you will simulate a simple branch predictor with a 2-bit saturating counter. 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 to write code to evaluate the performance of a 2-bit saturating counter based branch predictor on this trace. Your output file indicates, for each branch in the trace, whether it was predicted as Taken or Not Taken.

What to Submit

a) code

1. Your source code. On compilation, 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.txt.out in the same directory.

2. A Makefile that will compile the code. You must use a Makefile, any special instructions must be included in a readme.txt with instructions on how to compile your code (only if necessary, please keep it simple).

b)Analysis

Forr the provided trace.txt, plot a graph of the branch misprediction rate as a function of m with m varying from 10 to 20 in increments of 1.

Submit your plot as a PDF file in the same folder as your source code.

Related Tags

Academic APA Assignment Business Capstone College Conclusion Course Day Discussion Double Spaced Essay English Finance General Graduate History Information Justify Literature Management Market Masters Math Minimum MLA Nursing Organizational Outline Pages Paper Presentation Questions Questionnaire Reference Response Response School Subject Slides Sources Student Support Times New Roman Title Topics Word Write Writing