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

  Write a function fromhosttonetwork in c

Write a function fromHosttoNetwork in C that will accept an integer variable and covert it from host byte order to network byte order and write a function fromNetworktoHost in C that will accept an integer in network byte order and return an integ..

  A company that market is publishing both book and audio cass

A company that market is publishing both book and audiocassette versions

  Method celsius return celsius equivalent of fahrenheit

Method Celsius return the Celsius equivalent of a Fahrenheit temperature,using the calculation Celsius = 5.0/9.0*(Fahrenheit -32); method Fahrenheit returns the Fahrenheit equivalent of a Celsius temperature, using the calculation  Fahrenheit = 9.0/5..

  Perimeter of a trapezoid

Write a function in c that will return the perimeter of a trapezoid

  Struct definition to represent the data of a person''s bank

Define a struct definition to represent the data of a person's bank account. There will be one string for the name, and two doubles for balance and interest rate. Declare two variables of this new type in the main function. Modify the values of each ..

  Modify the payroll program

Modify the Payroll Program so that it uses a class to store and retrieve the employee's name, the hourly rate, and the number of hours worked.

  Write an application that can hold five integers in an array

Write an application that can hold five integers in an array. Display the integers fromfirst to last, and then display the integers from last to first.

  Create a class called bank account

Create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance. The BankAccount class should have two constructors, as follows

  A class is derived from another one

In C++, when a class is derived from another one, you can specify the inheritance relationship as public, private or even protected. What are the main differences a between these types of inheritance in C++? How does a public inheritance differ from ..

  Wave steepness is the ratio of wave height

Wave steepness is the ratio of wave height (WH) to wave length(WL) and is an indicator of wave stability. When wave steepness exceeds a 1/7 ratio; the wave becomes unstable and begins to break. Assume a data file exits with the following header

  Implement the tronomino tiling algorithm

Implement the tronomino tiling algorithm,  our program should take an arbitrary input positive integer  k  in the Linux command line and generate a 2 k  * 2 k  board.

  Basics of code development on linux and cryptography

Prepare a C program that gives simple mono-alphabetic substitution between plaintext, and Enhance your code to use "-e" to encrypt a string argument and "-d" to decrypt it using argv and argc

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