ChampSim
tage_sc_l.cc File Reference
#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ooo_cpu.h"
#include <vector>
Include dependency graph for tage_sc_l.cc:

Classes

class  folded_history
 
class  bentry
 
class  gentry
 
class  lentry
 
class  PREDICTOR
 

Macros

#define BORNTICK   1024
 
#define SC
 
#define IMLI
 
#define LOCALH
 
#define LOOPPREDICTOR
 
#define LOCALS
 
#define LOCALT
 
#define PERCWIDTH   6
 
#define LOGBIAS   8
 
#define INDBIAS   (((((PC ^ (PC >> 2)) << 1) ^ (LowConf & (LongestMatchPred != alttaken))) << 1) + pred_inter) & ((1 << LOGBIAS) - 1)
 
#define INDBIASSK   (((((PC ^ (PC >> (LOGBIAS - 2))) << 1) ^ (HighConf)) << 1) + pred_inter) & ((1 << LOGBIAS) - 1)
 
#define INDBIASBANK    (pred_inter + (((HitBank + 1) / 4) << 4) + (HighConf << 1) + (LowConf << 2) + ((AltBank != 0) << 3) + ((PC ^ (PC >> 2)) << 7)) & ((1 << LOGBIAS) - 1)
 
#define LOGINB   8
 
#define INB   1
 
#define LOGIMNB   9
 
#define IMNB   2
 
#define LOGGNB   10
 
#define GNB   3
 
#define PNB   3
 
#define LOGPNB   9
 
#define LOGLNB   10
 
#define LNB   3
 
#define LOGLOCAL   8
 
#define NLOCAL   (1 << LOGLOCAL)
 
#define INDLOCAL   ((PC ^ (PC >> 2)) & (NLOCAL - 1))
 
#define LOGSNB   9
 
#define SNB   3
 
#define LOGSECLOCAL   4
 
#define NSECLOCAL   (1 << LOGSECLOCAL)
 
#define INDSLOCAL   (((PC ^ (PC >> 5))) & (NSECLOCAL - 1))
 
#define LOGTNB   10
 
#define TNB   2
 
#define NTLOCAL   16
 
#define INDTLOCAL   (((PC ^ (PC >> (LOGTNB)))) & (NTLOCAL - 1))
 
#define VARTHRES
 
#define WIDTHRES   12
 
#define WIDTHRESP   8
 
#define LOGSIZEUP   6
 
#define LOGSIZEUPS   (LOGSIZEUP / 2)
 
#define INDUPD   (PC ^ (PC >> 2)) & ((1 << LOGSIZEUP) - 1)
 
#define INDUPDS   ((PC ^ (PC >> 2)) & ((1 << (LOGSIZEUPS)) - 1))
 
#define EWIDTH   6
 
#define CONFWIDTH   7
 
#define HISTBUFFERLENGTH    4096
 
#define POWER
 
#define NHIST   36
 
#define NBANKLOW    10
 
#define NBANKHIGH   20
 
#define BORN    13
 
#define BORNINFASSOC   9
 
#define BORNSUPASSOC   23
 
#define MINHIST   6
 
#define MAXHIST   3000
 
#define LOGG   10 /* logsize of the banks in the tagged TAGE tables */
 
#define TBITS    8
 
#define NNN   1
 
#define HYSTSHIFT   2
 
#define LOGB   13
 
#define PHISTWIDTH   27
 
#define UWIDTH    1
 
#define CWIDTH   3
 
#define LOGSIZEUSEALT   4
 
#define ALTWIDTH   5
 
#define SIZEUSEALT   (1 << (LOGSIZEUSEALT))
 
#define INDUSEALT   (((((HitBank - 1) / 8) << 1) + AltConf) % (SIZEUSEALT - 1))
 
#define LOGL   5
 
#define WIDTHNBITERLOOP   10
 
#define LOOPTAG   10
 
#define OPTREMP
 
#define GINDEX
 
#define CONFLOOP   15
 

Functions

int predictorsize ()
 

Variables

long long IMLIcount
 
int8_t Bias [(1<< LOGBIAS)]
 
int8_t BiasSK [(1<< LOGBIAS)]
 
int8_t BiasBank [(1<< LOGBIAS)]
 
int Im [INB] = {8}
 
int8_t IGEHLA [INB][(1<< LOGINB)] = {{0}}
 
int8_t * IGEHL [INB]
 
int IMm [IMNB] = {10, 4}
 
int8_t IMGEHLA [IMNB][(1<< LOGIMNB)] = {{0}}
 
int8_t * IMGEHL [IMNB]
 
long long IMHIST [256]
 
int Gm [GNB] = {40, 24, 10}
 
int8_t GGEHLA [GNB][(1<< LOGGNB)] = {{0}}
 
int8_t * GGEHL [GNB]
 
int Pm [PNB] = {25, 16, 9}
 
int8_t PGEHLA [PNB][(1<< LOGPNB)] = {{0}}
 
int8_t * PGEHL [PNB]
 
int Lm [LNB] = {11, 6, 3}
 
int8_t LGEHLA [LNB][(1<< LOGLNB)] = {{0}}
 
int8_t * LGEHL [LNB]
 
long long L_shist [NLOCAL]
 
int Sm [SNB] = {16, 11, 6}
 
int8_t SGEHLA [SNB][(1<< LOGSNB)] = {{0}}
 
int8_t * SGEHL [SNB]
 
long long S_slhist [NSECLOCAL]
 
int Tm [TNB] = {9, 4}
 
int8_t TGEHLA [TNB][(1<< LOGTNB)] = {{0}}
 
int8_t * TGEHL [TNB]
 
long long T_slhist [NTLOCAL]
 
int updatethreshold
 
int Pupdatethreshold [(1<< LOGSIZEUP)]
 
int8_t WG [(1<< LOGSIZEUPS)]
 
int8_t WL [(1<< LOGSIZEUPS)]
 
int8_t WS [(1<< LOGSIZEUPS)]
 
int8_t WT [(1<< LOGSIZEUPS)]
 
int8_t WP [(1<< LOGSIZEUPS)]
 
int8_t WI [(1<< LOGSIZEUPS)]
 
int8_t WIM [(1<< LOGSIZEUPS)]
 
int8_t WB [(1<< LOGSIZEUPS)]
 
int LSUM
 
int8_t FirstH
 
int8_t SecondH
 
bool MedConf
 
int SizeTable [NHIST+1]
 
bool NOSKIP [NHIST+1]
 
bool LowConf
 
bool HighConf
 
bool AltConf
 
int8_t use_alt_on_na [SIZEUSEALT]
 
long long GHIST
 
int8_t BIM
 
int TICK
 
uint8_t ghist [HISTBUFFERLENGTH]
 
int ptghist
 
long long phist
 
folded_history ch_i [NHIST+1]
 
folded_history ch_t [2][NHIST+1]
 
bentrybtable
 
gentrygtable [NHIST+1]
 
int m [NHIST+1]
 
int TB [NHIST+1]
 
int logg [NHIST+1]
 
int GI [NHIST+1]
 
uint GTAG [NHIST+1]
 
int BI
 
bool pred_taken
 
bool alttaken
 
bool tage_pred
 
bool LongestMatchPred
 
int HitBank
 
int AltBank
 
int Seed
 
bool pred_inter
 
lentryltable
 
bool predloop
 
int LIB
 
int LI
 
int LHIT
 
int LTAG
 
bool LVALID
 
int8_t WITHLOOP
 
class PREDICTOR predictor
 
bool was_predicted_taken
 

Macro Definition Documentation

◆ ALTWIDTH

#define ALTWIDTH   5

◆ BORN

#define BORN    13

◆ BORNINFASSOC

#define BORNINFASSOC   9

◆ BORNSUPASSOC

#define BORNSUPASSOC   23

◆ BORNTICK

#define BORNTICK   1024

◆ CONFLOOP

#define CONFLOOP   15

◆ CONFWIDTH

#define CONFWIDTH   7

◆ CWIDTH

#define CWIDTH   3

◆ EWIDTH

#define EWIDTH   6

◆ GINDEX

#define GINDEX
Value:
(((long long)PC) ^ bhist ^ (bhist >> (8 - i)) ^ (bhist >> (16 - 2 * i)) ^ (bhist >> (24 - 3 * i)) ^ (bhist >> (32 - 3 * i)) ^ (bhist >> (40 - 4 * i))) \
& ((1 << (logs - (i >= (NBR - 2)))) - 1)

◆ GNB

#define GNB   3

◆ HISTBUFFERLENGTH

#define HISTBUFFERLENGTH    4096

◆ HYSTSHIFT

#define HYSTSHIFT   2

◆ IMLI

#define IMLI

◆ IMNB

#define IMNB   2

◆ INB

#define INB   1

◆ INDBIAS

#define INDBIAS   (((((PC ^ (PC >> 2)) << 1) ^ (LowConf & (LongestMatchPred != alttaken))) << 1) + pred_inter) & ((1 << LOGBIAS) - 1)

◆ INDBIASBANK

#define INDBIASBANK    (pred_inter + (((HitBank + 1) / 4) << 4) + (HighConf << 1) + (LowConf << 2) + ((AltBank != 0) << 3) + ((PC ^ (PC >> 2)) << 7)) & ((1 << LOGBIAS) - 1)

◆ INDBIASSK

#define INDBIASSK   (((((PC ^ (PC >> (LOGBIAS - 2))) << 1) ^ (HighConf)) << 1) + pred_inter) & ((1 << LOGBIAS) - 1)

◆ INDLOCAL

#define INDLOCAL   ((PC ^ (PC >> 2)) & (NLOCAL - 1))

◆ INDSLOCAL

#define INDSLOCAL   (((PC ^ (PC >> 5))) & (NSECLOCAL - 1))

◆ INDTLOCAL

#define INDTLOCAL   (((PC ^ (PC >> (LOGTNB)))) & (NTLOCAL - 1))

◆ INDUPD

#define INDUPD   (PC ^ (PC >> 2)) & ((1 << LOGSIZEUP) - 1)

◆ INDUPDS

#define INDUPDS   ((PC ^ (PC >> 2)) & ((1 << (LOGSIZEUPS)) - 1))

◆ INDUSEALT

#define INDUSEALT   (((((HitBank - 1) / 8) << 1) + AltConf) % (SIZEUSEALT - 1))

◆ LNB

#define LNB   3

◆ LOCALH

#define LOCALH

◆ LOCALS

#define LOCALS

◆ LOCALT

#define LOCALT

◆ LOGB

#define LOGB   13

◆ LOGBIAS

#define LOGBIAS   8

◆ LOGG

#define LOGG   10 /* logsize of the banks in the tagged TAGE tables */

◆ LOGGNB

#define LOGGNB   10

◆ LOGIMNB

#define LOGIMNB   9

◆ LOGINB

#define LOGINB   8

◆ LOGL

#define LOGL   5

◆ LOGLNB

#define LOGLNB   10

◆ LOGLOCAL

#define LOGLOCAL   8

◆ LOGPNB

#define LOGPNB   9

◆ LOGSECLOCAL

#define LOGSECLOCAL   4

◆ LOGSIZEUP

#define LOGSIZEUP   6

◆ LOGSIZEUPS

#define LOGSIZEUPS   (LOGSIZEUP / 2)

◆ LOGSIZEUSEALT

#define LOGSIZEUSEALT   4

◆ LOGSNB

#define LOGSNB   9

◆ LOGTNB

#define LOGTNB   10

◆ LOOPPREDICTOR

#define LOOPPREDICTOR

◆ LOOPTAG

#define LOOPTAG   10

◆ MAXHIST

#define MAXHIST   3000

◆ MINHIST

#define MINHIST   6

◆ NBANKHIGH

#define NBANKHIGH   20

◆ NBANKLOW

#define NBANKLOW    10

◆ NHIST

#define NHIST   36

◆ NLOCAL

#define NLOCAL   (1 << LOGLOCAL)

◆ NNN

#define NNN   1

◆ NSECLOCAL

#define NSECLOCAL   (1 << LOGSECLOCAL)

◆ NTLOCAL

#define NTLOCAL   16

◆ OPTREMP

#define OPTREMP

◆ PERCWIDTH

#define PERCWIDTH   6

◆ PHISTWIDTH

#define PHISTWIDTH   27

◆ PNB

#define PNB   3

◆ POWER

#define POWER

◆ SC

#define SC

◆ SIZEUSEALT

#define SIZEUSEALT   (1 << (LOGSIZEUSEALT))

◆ SNB

#define SNB   3

◆ TBITS

#define TBITS    8

◆ TNB

#define TNB   2

◆ UWIDTH

#define UWIDTH    1

◆ VARTHRES

#define VARTHRES

◆ WIDTHNBITERLOOP

#define WIDTHNBITERLOOP   10

◆ WIDTHRES

#define WIDTHRES   12

◆ WIDTHRESP

#define WIDTHRESP   8

Function Documentation

◆ predictorsize()

int predictorsize ( )

Variable Documentation

◆ AltBank

int AltBank

◆ AltConf

bool AltConf

◆ alttaken

bool alttaken

◆ BI

int BI

◆ Bias

int8_t Bias[(1<< LOGBIAS)]

◆ BiasBank

int8_t BiasBank[(1<< LOGBIAS)]

◆ BiasSK

int8_t BiasSK[(1<< LOGBIAS)]

◆ BIM

int8_t BIM

◆ btable

bentry* btable

◆ ch_i

◆ ch_t

folded_history ch_t[2][NHIST+1]

◆ FirstH

int8_t FirstH

◆ GGEHL

int8_t* GGEHL[GNB]

◆ GGEHLA

int8_t GGEHLA[GNB][(1<< LOGGNB)] = {{0}}

◆ GHIST

long long GHIST

◆ ghist

uint8_t ghist[HISTBUFFERLENGTH]

◆ GI

int GI[NHIST+1]

◆ Gm

int Gm[GNB] = {40, 24, 10}

◆ gtable

gentry* gtable[NHIST+1]

◆ GTAG

uint GTAG[NHIST+1]

◆ HighConf

bool HighConf

◆ HitBank

int HitBank

◆ IGEHL

int8_t* IGEHL[INB]

◆ IGEHLA

int8_t IGEHLA[INB][(1<< LOGINB)] = {{0}}

◆ Im

int Im[INB] = {8}

◆ IMGEHL

int8_t* IMGEHL[IMNB]

◆ IMGEHLA

int8_t IMGEHLA[IMNB][(1<< LOGIMNB)] = {{0}}

◆ IMHIST

long long IMHIST[256]

◆ IMLIcount

long long IMLIcount

◆ IMm

int IMm[IMNB] = {10, 4}

◆ L_shist

long long L_shist[NLOCAL]

◆ LGEHL

int8_t* LGEHL[LNB]

◆ LGEHLA

int8_t LGEHLA[LNB][(1<< LOGLNB)] = {{0}}

◆ LHIT

int LHIT

◆ LI

int LI

◆ LIB

int LIB

◆ Lm

int Lm[LNB] = {11, 6, 3}

◆ logg

int logg[NHIST+1]

◆ LongestMatchPred

bool LongestMatchPred

◆ LowConf

bool LowConf

◆ LSUM

int LSUM

◆ ltable

lentry* ltable

◆ LTAG

int LTAG

◆ LVALID

bool LVALID

◆ m

int m[NHIST+1]

◆ MedConf

bool MedConf

◆ NOSKIP

bool NOSKIP[NHIST+1]

◆ PGEHL

int8_t* PGEHL[PNB]

◆ PGEHLA

int8_t PGEHLA[PNB][(1<< LOGPNB)] = {{0}}

◆ phist

long long phist

◆ Pm

int Pm[PNB] = {25, 16, 9}

◆ pred_inter

bool pred_inter

◆ pred_taken

bool pred_taken

◆ predictor

class PREDICTOR predictor

◆ predloop

bool predloop

◆ ptghist

int ptghist

◆ Pupdatethreshold

int Pupdatethreshold[(1<< LOGSIZEUP)]

◆ S_slhist

long long S_slhist[NSECLOCAL]

◆ SecondH

int8_t SecondH

◆ Seed

int Seed

◆ SGEHL

int8_t* SGEHL[SNB]

◆ SGEHLA

int8_t SGEHLA[SNB][(1<< LOGSNB)] = {{0}}

◆ SizeTable

int SizeTable[NHIST+1]

◆ Sm

int Sm[SNB] = {16, 11, 6}

◆ T_slhist

long long T_slhist[NTLOCAL]

◆ tage_pred

bool tage_pred

◆ TB

int TB[NHIST+1]

◆ TGEHL

int8_t* TGEHL[TNB]

◆ TGEHLA

int8_t TGEHLA[TNB][(1<< LOGTNB)] = {{0}}

◆ TICK

int TICK

◆ Tm

int Tm[TNB] = {9, 4}

◆ updatethreshold

int updatethreshold

◆ use_alt_on_na

int8_t use_alt_on_na[SIZEUSEALT]

◆ was_predicted_taken

bool was_predicted_taken

◆ WB

int8_t WB[(1<< LOGSIZEUPS)]

◆ WG

int8_t WG[(1<< LOGSIZEUPS)]

◆ WI

int8_t WI[(1<< LOGSIZEUPS)]

◆ WIM

int8_t WIM[(1<< LOGSIZEUPS)]

◆ WITHLOOP

int8_t WITHLOOP

◆ WL

int8_t WL[(1<< LOGSIZEUPS)]

◆ WP

int8_t WP[(1<< LOGSIZEUPS)]

◆ WS

int8_t WS[(1<< LOGSIZEUPS)]

◆ WT

int8_t WT[(1<< LOGSIZEUPS)]