Git Product home page Git Product logo

cse240-branch-predictor's Introduction

CSE240-Branch-Predictor

Course project of UCSD CSE-240A Computer Architecture

Implementation of TAGE Predictor based on:

A case for (partially)-tagged geometric history length predictors, Andre Seznec, IRISA

with slight modifications.

Configuration:

1. 1x basic bimodal predictor, There are BIMODAL_SIZE = 4099 entries in it.

#define BIMODAL_SIZE 4099
#define LEN_BIMODAL 2
int8_t t_bimodalPredictor[BIMODAL_SIZE];    

Each entry is a 2-bit saturate counter.

Size for bimodal predictor: 2 * (4099) = 8198 bits.

2. 7x TAGE tables

   #define NUM_BANKS 7                      // 7x TAGE tables
   #define LEN_TAG 10                       // 10 bit tag length
   #define LEN_GLOBAL 9                     // index into global table in each bank is 9 bit, thus there are 2^9 = 512 entries in each table.
   #define LEN_COUNTS 3                     // Each entry has a 3 bit saturate counter, 2 bit usefulness counter, 10 bit tag.
   typedef struct CompressedStruct{
            int8_t geometryLength;
            int8_t targetLength;
            uint32_t compressed;        
        } CompressedHistory ;                   // 8 + 8 + 32 = 48 bits.
        
        typedef struct BankEntryStruct{
            int8_t saturateCounter;             // 3 bit saturate counter
            uint16_t tag;                       // 10 bit tag
            int8_t usefulness;                  // 2 bit usefulness counter
        } BankEntry ;                           // 15 bits in total.
        
       typedef struct BankStruct{
            int geometry;                       //This is predefined by GEOMETRICS and never changes, so does not count into total number of bits used.
            BankEntry entry[1 << LEN_GLOBAL];   // (1 << LEN_GLOBAL) = (1 << 9) = 512 items for each table
            CompressedHistory indexCompressed;  // 48 bits.
            CompressedHistory tagCompressed[2]; // 48 2 bits.
        } Bank;

Total space for entries: 512 * 15 = 7680 bits

Each table has 3 CompressedHistory, (8 + 8 + 32) = 48 bit.

Total size: 7 * (48 + 15 + 7680) = 54201 bits

3. 1x Global History Table

   #define MAX_HISTORY_LEN 131
   uint8_t t_globalHistory[MAX_HISTORY_LEN]; 

MAX_HISTORY_LEN = 131 entries, 1 bit per entry

Total space: 131 bits.

4. BankGlobalIndex:

   uint32_t bankGlobalIndex[NUM_BANKS];

Store the entry index to each bank.

Each entry consumes LEN_GLOBAL = 9 bit.

Total space: 9 * 7 = 63 bits.

5. tagResult:

   int tagResult[NUM_BANKS];

Store the 10-bit tag to each bank in last computation.

Total space: 10 * 7 = 70 bits.

Total size:

8198 + 54201 + 131 + 63 + 70 = 62663 bits.

Performance

CUSTOM predictor's missprediction rate on benchmark: fp_1 (0.818/100.0)
CUSTOM predictor's missprediction rate on benchmark: fp_2 (0.294/100.0)
CUSTOM predictor's missprediction rate on benchmark: int_1 (6.898/100.0)
CUSTOM predictor's missprediction rate on benchmark: int_2 (0.274/100.0)
CUSTOM predictor's missprediction rate on benchmark: mm_1 (0.415/100.0)
CUSTOM predictor's missprediction rate on benchmark: mm_2 (5.576/100.0)
CUSTOM predictor's missprediction rate on benchmark: fp_3 (2.177/100.0)
CUSTOM predictor's missprediction rate on benchmark: int_3 (1.119/100.0)
CUSTOM predictor's missprediction rate on benchmark: mm_3 (10.861/100.0)
CUSTOM predictor's missprediction rate on benchmark: serv_1 (3.875/100.0)
CUSTOM predictor's missprediction rate on benchmark: serv_2 (1.819/100.0)
CUSTOM predictor's missprediction rate on benchmark: serv_3 (1.605/100.0)

cse240-branch-predictor's People

Contributors

pwwpche avatar

Watchers

 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.