Skip to content

Repository files navigation

Branch Prediction Simulator

System to simulate branch prediction algorithms

Developed Using

  • C++

Getting Started

Prerequisites

  • C++ Compiler (Clang, G++, etc.)

Installation

  1. Clone the repo:
    git clone https://github.com/Str-Josh/Financial-Derivatives-Strategy-Backtester.git
  2. Change git remote url to avoid accidental pushes to main project
    git remote set-url origin github_username/repo_name
    git remote -v
  3. Compile the following scripts:
    g++ -c BranchPredictionSimulator.cpp g++ -c TestPredictor.cpp g++ -c main.cpp
  4. Link the object files using the following:
    g++ main.o BranchPredictionSimulator.o TestPredictor.o -o BranchPrediction
  5. Execute the program. For example:
    BranchPrediction --bpalg 1-bit --trace instruction_traces/trace1.txt

Lessons Learned:

  • Implementation of 1-bit branch prediction algorithm
  • CPU Instruction Execution Cycles
  • File Management in C++
  • Implementing command line arguments in C++
  • Usage of smart pointers

Future Additions/Improvements:

  • Modify the code to be able to operate on a microcontroller and to take actual instruction traces from the CPU

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages