Giter VIP home page Giter VIP logo

branch-predictor's Introduction

Dylan Ferrara

Program Description: The main file takes in 2 text files, input and output, opens them and reads in from the input file the traces. It keeps reading until it can’t put anything into addr anymore. It then passes addr and behavior to the guess functions from each predictor file. Before that it initializes objects for BimodalSingleBit, BimodalDoubleBit, Gshare, and TournamentPredict. Inside BimodalSingleBit, it initializes a table to all true values, checks the value at the partial addr and updates if its correct or not. Then it sets the value at the table to true or false based on the behavior. Inside BimodalDoubleBit, creates a struct of 2 bool values, makes a table of said structs, and sets those values to false. In this predictor, I flipped the bits for the FSM (00 - Strongly Taken, 01 - Weak Taken, 10 - Weak NT, 11 - Strongly NT). It then checks if the topBit is 0 or 1 and updates the correct counter if the behavior corresponds. It then changes the state based on the previous state (initialized to 00 - Strong Taken) and what the behavior is. Inside Gshare, same design to BimodalDoubleBit except it initializes a global register and global size. It takes in the addr, mods it by the size, and sets it to a new value based on its previous value XOR’d with the global register modded with 1 shifted by the global size. It does the same thing as the BimodalDoubleBit, but updates the global register by shifting it by 1 and bit-wise or-ing it with 1 or 0 depending on the behavior. Inside TournamenPredict, similar initialization to the previous predictors but creates 2 tables for its own Gshare and BimodalDoubleBit with 2048 values and 11 bits for Gsahre. It then makes guesses for the addr from BimodalDoubleBit and Gshare with new functions that are identical to the other guess functions but return a string with their guess in it. It then checks which has the correct guess and updates it state accordingly with the same logic as the other update state blocks. Back to the main file, it then outputs the correct guesses from each predictor into the output file. It then closes both files.

branch-predictor's People

Contributors

dylan-fe avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.