ChampSim
ittage_64KB.h
Go to the documentation of this file.
1 /*
2 Code has been largely inspired by the tagged PPM predictor simulator from Pierre Michaud, the OGEHL predictor simulator from by André Seznec, the TAGE predictor simulator from André Seznec and Pierre Michaud, the L-TAGE simulator by Andre Seznec
3 */
4 
5 #include "instruction.h"
6 
7 #include <inttypes.h>
8 #include <math.h>
9 #define NHIST 15 /*number of tagged tables*/
10 #define SHARINGTABLES /* share some interleaved tables*/
11 #define INITHISTLENGTH /* use tuned history lengths*/
12 /*list of the history length*/
13 
14 #define IUM
15 //if a matching entry corresponds to an inflight branch use the real target of this inflight branch
16 
17 #define LOGG 12
18 
19 #ifndef SHARINGTABLES
20 #define TBITS 7
21 #endif
22 #ifndef INITHISTLENGTH
23 #define MINHIST 8 // shortest history length
24 #define MAXHIST 2000
25 #endif
26 
27 #define LOGTICK 6 //for management of the reset of useful counters
28 #define HISTBUFFERLENGTH 4096
29 //size of the history circular buffer
30 
31 #define LOGSPEC 6
32 
34 {
35 
36 int m[NHIST+1]={0, 0, 10, 16, 27, 44, 60, 96, 109, 219, 449, 487, 714, 1313, 2146, 3881};
37 int TICK; //control counter for the resetting of useful bits
38 
39 // utility class for index computation
41 {
42 // this is the cyclic shift register for folding
43 // a long global history into a smaller number of bits; see P. Michaud's PPM-like predictor at CBP-1
44 public:
45  uint64_t comp;
46  uint64_t CLENGTH;
47  uint64_t OLENGTH;
48  uint64_t OUTPOINT;
49 
51 
52  void init(uint64_t original_length, uint64_t compressed_length)
53  {
54  comp = 0;
55  OLENGTH = original_length;
56  CLENGTH = compressed_length;
58  }
59 
60  void update(uint8_t* h, uint64_t PT)
61  {
62  comp = (comp << 1) | h[PT & (HISTBUFFERLENGTH - 1)];
63  comp ^= h[(PT + OLENGTH) & (HISTBUFFERLENGTH - 1)] << OUTPOINT;
64  comp ^= (comp >> CLENGTH);
65  comp &= (1 << CLENGTH) - 1;
66  }
67 };
68 
69 
70 //class for storing speculative predictions: i.e. provided by a table entry that has already provided a still speculative prediction
71 class specentry
72 {
73 public:
74  uint64_t tag;
75  uint64_t pred;
76  specentry (){ //nothing
77  }
78 };
79 
80 
81 class gentry // ITTAGE global table entry
82 {
83 public:
84  int8_t ctr; // 2 bits
85  uint16_t tag; // width dependent on the table
86  uint64_t target; // 25 bits (18 offset + 7-bit region pointer)
87  int8_t u; // 1 bit
88  gentry ()
89  {
90  ctr = 0;
91  tag = 0;
92  u = 0;
93  target = 0;
94  }
95 };
96 
97 class regionentry // ITTAGE target region table entry
98 {
99 public:
100  uint64_t region; // 46 bits
101  int8_t u; // 1 bit
103  {
104  region = 0;
105  u = 0;
106  }
107 };
108 
109 int8_t USE_ALT_ON_NA; // "Use alternate prediction on weak predictions": a 4-bit counter to determine whether the newly allocated entries should be considered as valid or not for delivering the prediction
110 
111 //for managing global history and path
112 
114 //for management at fetch time
115 uint64_t Fetch_ptghist;
116 folded_history Fetch_ch_i[NHIST + 1]; //utility for computing TAGE indices
117 folded_history Fetch_ch_t[2][NHIST + 1]; //utility for computing TAGE tags
118 
119 // for management at retire time
120 uint64_t Retire_ptghist;
121 folded_history Retire_ch_i[NHIST + 1]; //utility for computing TAGE indices
122 folded_history Retire_ch_t[2][NHIST + 1]; //utility for computing TAGE tags
123 
124 
125 //predictor tables
126 gentry *gtable[NHIST + 1]; // ITTAGE tables (T0 has no tags other tables are tagged)
127 regionentry *rtable; // Target region tables
128 
129 
130 int TB[NHIST + 1]; // tag width for the different tagged tables
131 int logg[NHIST + 1]; // log of number entries of the different tagged tables
132 int GI[NHIST + 1] ; // indexes to the different tables are computed only once
133 uint64_t GTAG[NHIST + 1]; // tags for the different tables are computed only once
134 
135 
136 uint64_t pred_taken; // prediction
137 uint64_t alttaken; // alternate TAGEprediction
138 uint64_t tage_pred; // TAGE prediction
139 int HitBank; // longest matching bank
140 int AltBank; // alternate matching bank
142 
143 int Seed; // for the pseudo-random number generator
144 
145 //for the IUM
149 
150 
151 public:
153  {
154  USE_ALT_ON_NA = 0;
155  Seed = 0;
156  PtIumRetire = 0;
157  PtIumFetch = 0;
158 
159  for (int i = 0; i < HISTBUFFERLENGTH; i++)
160  ghist[0] = 0;
161  Fetch_ptghist = 0;
162  Retire_ptghist = 0;
163 #ifndef INITHISTLENGTH
164  m[0] = 0;
165  m[1] = 0;
166  m[2] = MINHIST;
167  m[NHIST] = MAXHIST;
168  for (int i = 3; i <= NHIST; i++) {
169  m[i] = (int) (((double) MINHIST * pow ((double) (MAXHIST) / (double) MINHIST, (double) (i - 2) / (double) ((NHIST - 2)))) + 0.5);
170  }
171  for (int i = 2; i <= NHIST; i++)
172  if (m[i] <= m[i - 1] + 2)
173  m[i] = m[i - 1] + 2;
174 #endif
175 #ifndef SHARINGTABLES
176  for (int i = 2; i <= NHIST; i++) {
177  TB[i] = (TBITS + i);
178  if (TB[i] >= 16)
179  TB[i] = 16;
180  }
181  TB[0] = 0; // table T0 is tagless
182  TB[1] = 6;
183  logg[0] = LOGG;
184  logg[1]= LOGG-1;
185 
186  for (int i = 2; i <= 4; i++)
187  logg[i] = LOGG - 2;
188  for (int i = 5; i <= 13; i++)
189  logg[i] = LOGG - 3;
190  for (int i = 14; i <= NHIST; i++)
191  logg[i] = LOGG - 4;
192 #endif
193 #ifdef SHARINGTABLES
194 #define STEP1 3
195 #define STEP2 11
196  logg[0] = LOGG;
197  logg[1] = LOGG;
198  logg[STEP1] = LOGG;
199  logg[STEP2] = LOGG - 1;
200 
201  for (int i = 2; i <= STEP1-1; i++)
202  logg[i] = logg[1] - 3; /* grouped together with T1 4Kentries */
203 
204  for (int i = STEP1+1; i <= STEP2-1; i++)
205  logg[i] = logg[STEP1] - 3; /*grouped together with T4 4K entries */
206 
207  for (int i = STEP2+1; i <= 15; i++)
208  logg[i] = logg[STEP2] - 3; /*grouped together with T12 2K entries */
209 
210  gtable[0] = new gentry[1 << logg[0]];
211  gtable[1] = new gentry[1 << logg[1]];
212  gtable[STEP1] = new gentry[1 << logg[STEP1]];
213  gtable[STEP2] = new gentry[1 << logg[STEP2]];
214  TB[0] = 0; //T0 is tagless
215  for (int i = 1; i <= STEP1-1; i++) {
216  gtable[i] = gtable[1];
217  TB[i] = 9;
218  }
219 
220  for (int i = STEP1; i <= STEP2-1; i++) {
221  gtable[i] = gtable[STEP1];
222  TB[i] = 13;
223  }
224 
225  for (int i = STEP2; i <= 15; i++) {
226  gtable[i] = gtable[STEP2];
227  TB[i] = 15;
228  }
229 #endif
230 
231 //initialisation of index and tag computation functions
232  for (int i = 1; i <= NHIST; i++) {
233  Fetch_ch_i[i].init (m[i], (logg[i]));
234  Fetch_ch_t[0][i].init (Fetch_ch_i[i].OLENGTH, TB[i]);
235  Fetch_ch_t[1][i].init (Fetch_ch_i[i].OLENGTH, TB[i] - 1);
236  }
237 
238  for (int i = 1; i <= NHIST; i++) {
239  Retire_ch_i[i].init (m[i], (logg[i]));
240  Retire_ch_t[0][i].init (Retire_ch_i[i].OLENGTH, TB[i]);
241  Retire_ch_t[1][i].init (Retire_ch_i[i].OLENGTH, TB[i] - 1);
242  }
243  rtable = new regionentry[128];
244  IUMPred = new specentry[1 << LOGSPEC];
245 #ifndef SHARINGTABLES
246  for (int i = 0; i <= NHIST; i++) {
247  gtable[i] = new gentry[1 << (logg[i])];
248  }
249 #endif
250 
251 #define PRINTCHAR
252 #ifdef PRINTCHAR
253 //for printing predictor characteristics
254  int NBENTRY = 0;
255  int STORAGESIZE = 0;
256  fprintf(stdout,"history lengths: " );
257 
258  for (int i = 0; i <= NHIST; i++) {
259  fprintf (stdout, "%d ", m[i]);
260  }
261  fprintf (stdout, "\n");
262 #ifndef SHARINGTABLES
263  for (int i = 0; i <= NHIST; i++) {
264  STORAGESIZE += (1 << logg[i]) * (25 + 2 + (i != 0) + TB[i]);
265  NBENTRY += (1 << logg[i]);
266  }
267 #else
268 //The ITTAGE physical tables: four global tables shared (interleaved) among several logic ITTAGE tables
269 //Entry width: target 25 bits + 2 bits confidence counter + TB[i] tag bits + 1 useful bit (except T0)
270  STORAGESIZE += (1 << (logg[0])) * (25 + 2 + TB[0]);
271  STORAGESIZE += (1 << (logg[1])) * (25 + 2 + 1 + TB[1]);
272  STORAGESIZE += (1 << (logg[STEP1])) * (25 + 2 + 1 + TB[STEP1]);
273  STORAGESIZE += (1 << (logg[STEP2])) * (25 + 2 + 1 + TB[STEP2]);
274 
275  NBENTRY += (1 << (logg[0])) + (1 << (logg[1])) + (1 << (logg[STEP1])) + (1 << (logg[STEP2]));
276 #endif
277  fprintf(stdout, "ITTAGE tables: %d bytes;", STORAGESIZE/8);
278  fprintf(stdout, "Region table: %d bytes;", 15*128/8);
279  STORAGESIZE += 15 * 128; //Region Table (14 bits Region + 1 bit for replacement)
280 #ifdef IUM
281  fprintf(stdout, "IUM: %d bytes;", (1 << LOGSPEC) * 48/8);
282  STORAGESIZE += (1 << LOGSPEC) * 48; //entries in the speculative update table are 32 bits + 16 tag bits
283 #endif
284 
285  fprintf (stdout, "Total Storage= %d bytes;\n", STORAGESIZE / 8);
286 #endif
287  }
288 
289  // the index functions for the tagged tables uses path history as in the OGEHL predictor
290 
291  // gindex computes a full hash of pc, ghist
292  uint64_t gindex (uint64_t pc, int bank, folded_history* ch_i)
293  {
294  uint64_t index;
295  index = pc ^ (pc >> (abs (logg[bank] - bank) + 1)) ^ ch_i[bank].comp;
296  return (index & ((1 << (logg[bank])) - 1));
297  }
298 
299  // tag computation
300  uint16_t gtag(uint64_t pc, int bank, folded_history* ch0, folded_history* ch1)
301  {
302  uint16_t tag = pc ^ ch0[bank].comp ^ (ch1[bank].comp << 1);
303  return (tag & ((1 << TB[bank]) - 1));
304  }
305 
306 
307  //just a simple pseudo random number generator: use available information
308  // to allocate entries in the loop predictor
309  int MYRANDOM()
310  {
311  Seed++;
312  Seed ^= Fetch_ptghist;
313  Seed = (Seed >> 11) + (Seed << 21);
314  Seed += Retire_ptghist;
315  return (Seed);
316  };
317 
318 
319  void Tagepred()
320  {
321  alttaken = 0;
322  HitBank = -1;
323  AltBank = -1;
324  //Look for the bank with longest matching history
325  for (int i = NHIST; i >= 0; i--) {
326  if (gtable[i][GI[i]].tag == GTAG[i]) {
327  HitBank = i;
328  break;
329  }
330  }
331  //Look for the alternate bank
332  for (int i = HitBank - 1; i >= 0; i--) {
333  if (gtable[i][GI[i]].tag == GTAG[i]) {
334  AltBank = i;
335  break;
336  }
337  }
338  //computes the prediction and the alternate prediction
339  if (AltBank >= 0)
342 
343  //proceed with the indirection through the target region table
344  alttaken = (alttaken & ((1 << 18) - 1)) + (rtable[(alttaken >> 18) & 127].region << 18);
345  tage_pred = (tage_pred & ((1 << 18) - 1)) + (rtable[(tage_pred >> 18) & 127].region << 18);
347  //if the entry is recognized as a newly allocated entry and
348  //USE_ALT_ON_NA is positive use the alternate prediction
349  if (AltBank >= 0)
350  if ((USE_ALT_ON_NA >= 0) & (gtable[HitBank][GI[HitBank]].ctr == 0))
351  tage_pred = alttaken;
352  }
353 
354  // PREDICTION
355  uint64_t predict_brindirect(uint64_t pc)
356  {
357  // computes the table addresses and the partial tags
358  for (int i = 0; i <= NHIST; i++) {
359  GI[i] = gindex(pc, i, Fetch_ch_i);
360  GTAG[i] = gtag(pc, i, Fetch_ch_t[0], Fetch_ch_t[1]);
361  }
362 #ifdef SHARINGTABLES
363  for (int i = 2; i <= STEP1-1; i++)
364  GI[i] = ((GI[1] & 7) ^ (i - 1)) + (GI[i] << 3);
365 
366  for (int i = STEP1+1; i <= STEP2-1; i++)
367  GI[i] = ((GI[STEP1] & 7) ^ (i - STEP1)) + (GI[i] << 3);
368 
369  for (int i = STEP2+1; i <= 15; i++)
370  GI[i] = ((GI[STEP2] & 7) ^ (i - STEP2)) + (GI[i] << 3);
371 #endif
372 
373  GTAG[0] = 0;
374  GI[0] = pc & ((1 << logg[0]) - 1);
375 
376  Tagepred();
377 
378  //if the entry providing the target already provides
380 
381  return pred_taken;
382  }
383 
384  uint64_t PredSpecIUM(uint64_t pred)
385  {
386 #ifdef IUM
387  uint64_t IumTag = (HitBank) + (GI[HitBank] << 4);
388  int Min = (PtIumRetire > PtIumFetch + 8) ? PtIumFetch + 8 : PtIumRetire;
389 
390  for (int i = PtIumFetch; i < Min; i++) {
391  if (IUMPred[i & ((1 << LOGSPEC) - 1)].tag == IumTag)
392  return IUMPred[i & ((1 << LOGSPEC) - 1)].pred;
393  }
394 #endif
395  return pred;
396  }
397 
398  void UpdateSpecIUM(uint64_t target)
399  {
400 #ifdef IUM
401  uint64_t IumTag = (HitBank) + (GI[HitBank] << 4);
402  PtIumFetch--;
403  IUMPred[PtIumFetch & ((1 << LOGSPEC) - 1)].tag = IumTag;
404  IUMPred[PtIumFetch & ((1 << LOGSPEC) - 1)].pred = target;
405 #endif
406  }
407 
408  // UPDATE FETCH HISTORIES
409  void fetch_history_update(uint64_t pc, uint8_t branch_type, uint8_t taken, uint64_t target)
410  {
412  UpdateSpecIUM(target);
413  }
415  }
416 
417  void HistoryUpdate(uint64_t pc, uint8_t branch_type, uint8_t taken, uint64_t target, uint64_t &Y, folded_history * H, folded_history * G, folded_history * J)
418  {
419  int maxt = ((branch_type == BRANCH_INDIRECT) || (branch_type == BRANCH_INDIRECT_CALL)) ? 10 : 0;
421  maxt = 5;
422 
423  uint64_t PATH = ((target ^ (target >> 3) ^ pc));
425  PATH = taken;
426 
427  for (int t = 0; t < maxt; t++) {
428  bool P = (PATH & 1);
429  PATH >>= 1;
430 
431  //update history
432  Y--;
433  ghist[Y & (HISTBUFFERLENGTH - 1)] = P;
434 
435  //prepare next index and tag computations for user branchs
436  for (int i = 1; i <= NHIST; i++) {
437  H[i].update(ghist, Y);
438  G[i].update(ghist, Y);
439  J[i].update(ghist, Y);
440  }
441  }
442 
443 //END UPDATE FETCH HISTORIES
444  }
445 
446 // PREDICTOR UPDATE
447 
448  void update_brindirect(uint64_t pc, uint8_t branch_type, uint8_t taken, uint64_t target)
449  {
450  int NRAND = MYRANDOM ();
451 
453  PtIumRetire--;
454 
455  //Recompute the prediction by the ITTAGE predictor: on an effective implementation one would try to avoid this recomputation by propagating the prediction with the branch instruction
456  for (int i = 0; i <= NHIST; i++) {
457  GI[i] = gindex (pc, i, Retire_ch_i);
458  GTAG[i] = gtag (pc, i, Retire_ch_t[0], Retire_ch_t[1]);
459  }
460 #ifdef SHARINGTABLES
461  for (int i = 2; i <= STEP1-1; i++)
462  GI[i] = ((GI[1] & 7) ^ (i - 1)) + (GI[i] << 3);
463 
464  for (int i = STEP1+1; i <= STEP2-1; i++)
465  GI[i] = ((GI[STEP1] & 7) ^ (i - STEP1)) + (GI[i] << 3);
466 
467  for (int i = STEP2+1; i <= 15; i++)
468  GI[i] = ((GI[STEP2] & 7) ^ (i - STEP2)) + (GI[i] << 3);
469 #endif
470  GTAG[0] = 0;
471  GI[0] = pc & ((1 << logg[0]) - 1);
472 
473  Tagepred();
474 
475  bool ALLOC = (LongestMatchPred != target);
476 //allocation if the Longest Matching entry does not provide the correct entry
477 
478  if ((HitBank > 0) & (AltBank >= 0)) {
479 // Manage the selection between longest matching and alternate matching
480 // for "pseudo"-newly allocated longest matching entry
481  bool PseudoNewAlloc = (gtable[HitBank][GI[HitBank]].ctr == 0);
482  if (PseudoNewAlloc) {
483  if (alttaken) {
484  if (LongestMatchPred != alttaken) {
485  if ((alttaken == target) || (LongestMatchPred == target)) {
486  if (alttaken == target) {
487  if (USE_ALT_ON_NA < 7)
488  USE_ALT_ON_NA++;
489  } else {
490  if (USE_ALT_ON_NA >= -8)
491  USE_ALT_ON_NA--;
492  }
493  }
494  }
495  }
496  }
497  }
498 
499  if (ALLOC) {
500  //Need to compute the target field (Offset + Region pointer)
501  uint64_t Region = (target >> 18);
502  int64_t PtRegion = -1;
503  //Associative search on the region table
504  for (int i = 0; i < 128; i++) {
505  if (rtable[i].region == Region) {
506  PtRegion = i;
507  break;
508  }
509  }
510 
511  if (PtRegion == -1) {
512  //miss in the target region table, allocate a free entry
513  for (int i = 0; i < 128; i++) {
514  if (rtable[i].u == 0) {
515  PtRegion = i;
516  rtable[i].region = Region;
517  rtable[i].u = 1;
518  break;
519  }
520  }
521 
522  // a very simple replacement policy (don't care for the competition, but some replacement is needed in a real processor)
523  if (PtRegion == -1) {
524  for (int i = 0; i < 128; i++) {
525  rtable[i].u = 0;
526  }
527  PtRegion = 0;
528  rtable[0].region = Region;
529  rtable[0].u = 1;
530  }
531  }
532  uint64_t IndTarget = (target & ((1 << 18) - 1)) + (PtRegion << 18);
533 
534  // we allocate an entry with a longer history
535  //to avoid ping-pong, we do not choose systematically the next entry, but among the 2 next entries
536  int Y = NRAND;
537  int X = HitBank + 1;
538  if ((Y & 31) == 0) {
539  X++;
540  }
541  int T = 2;
542  //allocating 3 entries on a misprediction just work a little bit better than a single allocation
543  for (int i = X; i <= NHIST; i += 1) {
544  if (gtable[i][GI[i]].u == 0) {
545  gtable[i][GI[i]].tag = GTAG[i];
546  gtable[i][GI[i]].target = IndTarget;
547  gtable[i][GI[i]].ctr = 0;
548  gtable[i][GI[i]].u = 0;
549  if (TICK > 0)
550  TICK--;
551  if (T == 0)
552  break;
553  T--;
554  i += 1;
555  }
556  else
557  TICK++;
558  }
559  }
560 
561  if ((TICK >= (1 << LOGTICK))) {
562  TICK = 0;
563 // reset the useful bit
564  for (int i = 0; i <= NHIST; i++)
565  for (int j = 0; j < (1 << logg[i]); j++)
566  gtable[i][j].u = 0;
567  }
568  if (LongestMatchPred == target) {
569  if (gtable[HitBank][GI[HitBank]].ctr < 3)
570  gtable[HitBank][GI[HitBank]].ctr++;
571  } else {
572  if (gtable[HitBank][GI[HitBank]].ctr > 0)
573  gtable[HitBank][GI[HitBank]].ctr--;
574  else { // replace the target field by the new target
575  // Need to compute the target field :-)
576  uint64_t Region = (target >> 18);
577  int64_t PtRegion = -1;
578 
579  for (int i = 0; i < 128; i++)
580  if (rtable[i].region == Region) {
581  PtRegion = i;
582  break;
583  }
584  if (PtRegion == -1) {
585  for (int i = 0; i < 128; i++)
586  if (rtable[i].u == 0) {
587  PtRegion = i;
588  rtable[i].region = Region;
589  rtable[i].u = 1;
590  break;
591  }
592 
593  //a very simple replacement policy (don't care for the competition, but some replacement is needed in a real processor)
594  if (PtRegion == -1) {
595  for (int i = 0; i < 128; i++)
596  rtable[i].u = 0;
597  PtRegion = 0;
598  rtable[0].region = Region;
599  rtable[0].u = 1;
600  }
601  }
602  uint64_t IndTarget = (target & ((1 << 18) - 1)) + (PtRegion << 18);
603  gtable[HitBank][GI[HitBank]].target = IndTarget;
604  }
605  }
606 
607  // update the u bit
608  if (HitBank != 0) {
609  if (LongestMatchPred != alttaken) {
610  if (LongestMatchPred == target) {
611  gtable[HitBank][GI[HitBank]].u = 1;
612  }
613  }
614  }
615 //END PREDICTOR UPDATE
616  }
617 
618  // UPDATE RETIRE HISTORY PATH
620 
621  }
622 
623 };
Definition: ittage_64KB.h:41
void update(uint8_t *h, uint64_t PT)
Definition: ittage_64KB.h:60
folded_history()
Definition: ittage_64KB.h:50
uint64_t comp
Definition: ittage_64KB.h:45
void init(uint64_t original_length, uint64_t compressed_length)
Definition: ittage_64KB.h:52
uint64_t CLENGTH
Definition: ittage_64KB.h:46
uint64_t OLENGTH
Definition: ittage_64KB.h:47
uint64_t OUTPOINT
Definition: ittage_64KB.h:48
Definition: ittage_64KB.h:82
uint64_t target
Definition: ittage_64KB.h:86
gentry()
Definition: ittage_64KB.h:88
int8_t u
Definition: ittage_64KB.h:87
uint16_t tag
Definition: ittage_64KB.h:85
int8_t ctr
Definition: ittage_64KB.h:84
Definition: ittage_64KB.h:98
int8_t u
Definition: ittage_64KB.h:101
regionentry()
Definition: ittage_64KB.h:102
uint64_t region
Definition: ittage_64KB.h:100
Definition: ittage_64KB.h:72
uint64_t tag
Definition: ittage_64KB.h:74
uint64_t pred
Definition: ittage_64KB.h:75
specentry()
Definition: ittage_64KB.h:76
Definition: ittage_64KB.h:34
int HitBank
Definition: ittage_64KB.h:139
uint64_t alttaken
Definition: ittage_64KB.h:137
int Seed
Definition: ittage_64KB.h:143
int8_t USE_ALT_ON_NA
Definition: ittage_64KB.h:109
folded_history Retire_ch_i[NHIST+1]
Definition: ittage_64KB.h:121
void update_brindirect(uint64_t pc, uint8_t branch_type, uint8_t taken, uint64_t target)
Definition: ittage_64KB.h:448
uint64_t Retire_ptghist
Definition: ittage_64KB.h:120
int PtIumRetire
Definition: ittage_64KB.h:146
uint64_t Fetch_ptghist
Definition: ittage_64KB.h:115
uint64_t GTAG[NHIST+1]
Definition: ittage_64KB.h:133
int logg[NHIST+1]
Definition: ittage_64KB.h:131
uint8_t ghist[HISTBUFFERLENGTH]
Definition: ittage_64KB.h:113
my_predictor(void)
Definition: ittage_64KB.h:152
int PtIumFetch
Definition: ittage_64KB.h:147
int AltBank
Definition: ittage_64KB.h:140
uint64_t LongestMatchPred
Definition: ittage_64KB.h:141
folded_history Fetch_ch_i[NHIST+1]
Definition: ittage_64KB.h:116
int TB[NHIST+1]
Definition: ittage_64KB.h:130
int TICK
Definition: ittage_64KB.h:37
void HistoryUpdate(uint64_t pc, uint8_t branch_type, uint8_t taken, uint64_t target, uint64_t &Y, folded_history *H, folded_history *G, folded_history *J)
Definition: ittage_64KB.h:417
void Tagepred()
Definition: ittage_64KB.h:319
int m[NHIST+1]
Definition: ittage_64KB.h:36
int GI[NHIST+1]
Definition: ittage_64KB.h:132
uint64_t gindex(uint64_t pc, int bank, folded_history *ch_i)
Definition: ittage_64KB.h:292
int MYRANDOM()
Definition: ittage_64KB.h:309
uint64_t tage_pred
Definition: ittage_64KB.h:138
uint64_t pred_taken
Definition: ittage_64KB.h:136
uint64_t PredSpecIUM(uint64_t pred)
Definition: ittage_64KB.h:384
specentry * IUMPred
Definition: ittage_64KB.h:148
regionentry * rtable
Definition: ittage_64KB.h:127
uint64_t predict_brindirect(uint64_t pc)
Definition: ittage_64KB.h:355
void UpdateSpecIUM(uint64_t target)
Definition: ittage_64KB.h:398
uint16_t gtag(uint64_t pc, int bank, folded_history *ch0, folded_history *ch1)
Definition: ittage_64KB.h:300
gentry * gtable[NHIST+1]
Definition: ittage_64KB.h:126
void fetch_history_update(uint64_t pc, uint8_t branch_type, uint8_t taken, uint64_t target)
Definition: ittage_64KB.h:409
folded_history Retire_ch_t[2][NHIST+1]
Definition: ittage_64KB.h:122
folded_history Fetch_ch_t[2][NHIST+1]
Definition: ittage_64KB.h:117
#define MINHIST
Definition: hashed_perceptron.cc:65
#define MAXHIST
Definition: hashed_perceptron.cc:61
branch_type
Definition: instruction.h:30
@ BRANCH_INDIRECT_CALL
Definition: instruction.h:36
@ BRANCH_DIRECT_CALL
Definition: instruction.h:35
@ BRANCH_CONDITIONAL
Definition: instruction.h:34
@ BRANCH_INDIRECT
Definition: instruction.h:33
#define HISTBUFFERLENGTH
Definition: ittage_64KB.h:28
#define LOGSPEC
Definition: ittage_64KB.h:31
#define LOGG
Definition: ittage_64KB.h:17
#define STEP1
#define LOGTICK
Definition: ittage_64KB.h:27
#define NHIST
Definition: ittage_64KB.h:9
#define STEP2
#define TBITS
Definition: tage_sc_l.cc:240
folded_history ch_i[NHIST+1]
Definition: tage_sc_l.cc:274