Evaluate effectiveness of simple branch prediction schemes

Assignment Help C/C++ Programming
Reference no: EM13910047

You need to explore the effectiveness of branch direction prediction (taken vs not taken) using an actual program. Your task is to use the given branch prediction simulation infrastructure to evaluate the effectiveness of some simple branch prediction schemes. The simulation infrastructure can be downloaded from the class website ( cbp2-infrastructure-v2. tar).

To do this, you will implement a C++ branch prediction class (see README contained in the zip file) that reads in the trace and simulates a local history based branch predictor. A local history based predictor is a dynamic branch predictor that uses the local history of a branch to predict its future outcome. The predictor uses a history table (local history table) to record the taken/not-taken history of a branch. The local history table holds 10 bits of branch history for up to 4096 branches, indexed by the instruction address. The predictor uses the 10-bit local history to select from one of the 1024 2-bit prediction counters. Each two-bit includes one of four values: strongly taken (T), weakly taken (t), weakly not taken (n), and strongly not taken (N).

175_branch prediction schemes.png

To make a prediction, the predictor selects a counter from the local prediction table using the 10 local history bits as index. The 10 local history bits are retrieved from a local history table using 12 bits of the instruction's address (its program counter value) as index. The direction prediction is made based on the value of the counter.

To finish the homework, open my_predictor.h and implement the three member functions of local_predictor class.

class local_predictor : public branch_predictor { public:

local_update u;

local_predictor (void) {

}

branch_update *predict (branch_info & b) { u.direction_prediction (true); u.target_prediction (0);

return &u;

}

void update (branch_update *u, bool taken, unsigned int target)

{

}

To compile the predictor, type make under /cbp2-infrastructure-v2/src. You will see two binary programs generated, predict and predict_extra_credit. Binary program predict does branch prediction using an instance of local_predictor class. Binary program predict_extra_credit does branch prediction using an instance of extra_predictor class (defined in my_predictor.h). To test your local predictor, type run traces under ./cbp2- infrastructure-v2/.

2.) Branch Predictor Competition

Assuming a total hardware budget of 4KB (32768 bits), implement a branch predictor to maximize predication performance (use my_predictor.h and extra_predictor class). You must justify why your predictor actually fits within the 4KB budget. For example, a table of 4096 2-bit counters would eat up the entire 8192-bit (1KB) budget. Assume "logic" (adders, etc.) is free. Note that using something like a float would actually cost you 32 bits per float (or 64 bits for a double), and so it's likely that you'll want to stick with narrow-width integer counters.

Reference no: EM13910047

Questions Cloud

Inventory management : Inventory Management, What additional cost is the shop incurring by using this current order size rather than the economic order quantity?
Calculate weighted average cost of capital using book value : Promo Pak has compiled the following financial data: Calculate the weighted average cost of capital using book value weights.
Explain why it is important to calculate confidence interval : Explain why it is important to calculate a confidence interval. Explain the meaning of the term "95 percent confidence." Under what conditions is the confidence interval [x + za/2(s/ 1n)] for m valid?
What is her optimal bundle of contingent claims : A risk averse person with a von-Neumann-Morgenstern utility index of: U = ln(Y) has a 20% chance that a disaster will reduce her regular income of $100,000 to zero. She can buy insurance at a rate of $0.40 per dollar of coverage. a) Will she fully, u..
Evaluate effectiveness of simple branch prediction schemes : You need to explore the effectiveness of branch direction prediction (taken vs not taken) using an actual program. Your task is to use the given branch prediction simulation infrastructure to evaluate the effectiveness of some simple branch predic..
What price should the stock sell : Gary Wells Inc. plans to issue perpetual preferred stock with an annual dividend of $6.50 per share. If the required return on this preferred stock is 6.5%, at what price should the stock sell?
Differences between groups and teams : Differences between groups and teams
Metal with a comparable comparison : What is the safest metal to use with a number of cleaning agents; even just H.2 0.; The heavier it is the better the resolve. A substance other then a metal with a comparable comparison would be nice. preferably something non corrosive.
What is weighted average cost of capital : Would the firm's cost of external equity capital be the same as the required rate of return on the firm's outstanding common stock? Why or why not?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd