Deleted Added
sdiff udiff text old ( 13442:5314c50529a5 ) new ( 13443:a111cb197897 )
full compact
1/*
2 * Copyright (c) 2014 The University of Wisconsin
3 *
4 * Copyright (c) 2006 INRIA (Institut National de Recherche en
5 * Informatique et en Automatique / French National Research Institute
6 * for Computer Science and Applied Mathematics)
7 *
8 * All rights reserved.

--- 41 unchanged lines hidden (view full) ---

50LTAGE::LTAGE(const LTAGEParams *params)
51 : BPredUnit(params),
52 logSizeBiMP(params->logSizeBiMP),
53 logRatioBiModalHystEntries(params->logRatioBiModalHystEntries),
54 logSizeTagTables(params->logSizeTagTables),
55 logSizeLoopPred(params->logSizeLoopPred),
56 nHistoryTables(params->nHistoryTables),
57 tagTableCounterBits(params->tagTableCounterBits),
58 histBufferSize(params->histBufferSize),
59 minHist(params->minHist),
60 maxHist(params->maxHist),
61 minTagWidth(params->minTagWidth),
62 loopTableAgeBits(params->loopTableAgeBits),
63 loopTableConfidenceBits(params->loopTableConfidenceBits),
64 loopTableTagBits(params->loopTableTagBits),
65 loopTableIterBits(params->loopTableIterBits),
66 confidenceThreshold((1 << loopTableConfidenceBits) - 1),
67 loopTagMask((1 << loopTableTagBits) - 1),
68 loopNumIterMask((1 << loopTableIterBits) - 1),
69 threadHistory(params->numThreads)
70{
71 // we use uint16_t type for these vales, so they cannot be more than
72 // 16 bits
73 assert(loopTableTagBits <= 16);
74 assert(loopTableIterBits <= 16);
75
76 assert(params->histBufferSize > params->maxHist * 2);
77 useAltPredForNewlyAllocated = 0;
78 logTick = 19;

--- 492 unchanged lines hidden (view full) ---

571 ctrUpdate(useAltPredForNewlyAllocated,
572 bi->altTaken == taken, 4);
573 }
574 }
575 }
576
577 if (alloc) {
578 // is there some "unuseful" entry to allocate
579 int8_t min = 1;
580 for (int i = nHistoryTables; i > bi->hitBank; i--) {
581 if (gtable[i][bi->tableIndices[i]].u < min) {
582 min = gtable[i][bi->tableIndices[i]].u;
583 }
584 }
585
586 // we allocate an entry with a longer history
587 // to avoid ping-pong, we do not choose systematically the next

--- 12 unchanged lines hidden (view full) ---

600 }
601
602
603 //Allocate only one entry
604 for (int i = X; i <= nHistoryTables; i++) {
605 if ((gtable[i][bi->tableIndices[i]].u == 0)) {
606 gtable[i][bi->tableIndices[i]].tag = bi->tableTags[i];
607 gtable[i][bi->tableIndices[i]].ctr = (taken) ? 0 : -1;
608 gtable[i][bi->tableIndices[i]].u = 0; //?
609 break;
610 }
611 }
612 }
613 //periodic reset of u: reset is not complete but bit by bit
614 tCounter++;
615 if ((tCounter & ((ULL(1) << logTick) - 1)) == 0) {
616 // reset least significant bit

--- 21 unchanged lines hidden (view full) ---

638 branch_pc);
639 }
640 if (bi->altBank == 0) {
641 baseUpdate(pc, taken, bi);
642 }
643 }
644
645 // update the u counter
646 if (longest_match_pred != bi->altTaken) {
647 if (longest_match_pred == taken) {
648 if (gtable[bi->hitBank][bi->hitBankIndex].u < 1) {
649 gtable[bi->hitBank][bi->hitBankIndex].u++;
650 }
651 }
652 }
653 } else {
654 baseUpdate(pc, taken, bi);
655 }
656
657 //END PREDICTOR UPDATE
658 }
659 if (!squashed) {

--- 124 unchanged lines hidden ---