bi_mode.hh (11433:72b075cdc336) | bi_mode.hh (11434:b5aed9d2d54e) |
---|---|
1/* 2 * Copyright (c) 2014 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 43 unchanged lines hidden (view full) --- 52 * pattern. By separating the predictors into taken/not-taken arrays, and using 53 * the branch's PC to choose between the two, destructive aliasing is reduced. 54 */ 55 56class BiModeBP : public BPredUnit 57{ 58 public: 59 BiModeBP(const BiModeBPParams *params); | 1/* 2 * Copyright (c) 2014 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 43 unchanged lines hidden (view full) --- 52 * pattern. By separating the predictors into taken/not-taken arrays, and using 53 * the branch's PC to choose between the two, destructive aliasing is reduced. 54 */ 55 56class BiModeBP : public BPredUnit 57{ 58 public: 59 BiModeBP(const BiModeBPParams *params); |
60 void uncondBranch(Addr pc, void * &bp_history); 61 void squash(void *bp_history); 62 bool lookup(Addr branch_addr, void * &bp_history); 63 void btbUpdate(Addr branch_addr, void * &bp_history); 64 void update(Addr branch_addr, bool taken, void *bp_history, bool squashed); 65 void retireSquashed(void *bp_history); 66 unsigned getGHR(void *bp_history) const; | 60 void uncondBranch(ThreadID tid, Addr pc, void * &bp_history); 61 void squash(ThreadID tid, void *bp_history); 62 bool lookup(ThreadID tid, Addr branch_addr, void * &bp_history); 63 void btbUpdate(ThreadID tid, Addr branch_addr, void * &bp_history); 64 void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, 65 bool squashed); 66 void retireSquashed(ThreadID tid, void *bp_history); 67 unsigned getGHR(ThreadID tid, void *bp_history) const; |
67 68 private: | 68 69 private: |
69 void updateGlobalHistReg(bool taken); | 70 void updateGlobalHistReg(ThreadID tid, bool taken); |
70 71 struct BPHistory { 72 unsigned globalHistoryReg; 73 // was the taken array's prediction used? 74 // true: takenPred used 75 // false: notPred used 76 bool takenUsed; 77 // prediction of the taken array --- 12 unchanged lines hidden (view full) --- 90 91 // choice predictors 92 std::vector<SatCounter> choiceCounters; 93 // taken direction predictors 94 std::vector<SatCounter> takenCounters; 95 // not-taken direction predictors 96 std::vector<SatCounter> notTakenCounters; 97 | 71 72 struct BPHistory { 73 unsigned globalHistoryReg; 74 // was the taken array's prediction used? 75 // true: takenPred used 76 // false: notPred used 77 bool takenUsed; 78 // prediction of the taken array --- 12 unchanged lines hidden (view full) --- 91 92 // choice predictors 93 std::vector<SatCounter> choiceCounters; 94 // taken direction predictors 95 std::vector<SatCounter> takenCounters; 96 // not-taken direction predictors 97 std::vector<SatCounter> notTakenCounters; 98 |
98 unsigned globalHistoryReg; | 99 std::vector<unsigned> globalHistoryReg; |
99 unsigned globalHistoryBits; 100 unsigned historyRegisterMask; 101 102 unsigned choicePredictorSize; 103 unsigned choiceCtrBits; 104 unsigned choiceHistoryMask; 105 unsigned globalPredictorSize; 106 unsigned globalCtrBits; 107 unsigned globalHistoryMask; 108 109 unsigned choiceThreshold; 110 unsigned takenThreshold; 111 unsigned notTakenThreshold; 112}; 113 114#endif // __CPU_PRED_BI_MODE_PRED_HH__ | 100 unsigned globalHistoryBits; 101 unsigned historyRegisterMask; 102 103 unsigned choicePredictorSize; 104 unsigned choiceCtrBits; 105 unsigned choiceHistoryMask; 106 unsigned globalPredictorSize; 107 unsigned globalCtrBits; 108 unsigned globalHistoryMask; 109 110 unsigned choiceThreshold; 111 unsigned takenThreshold; 112 unsigned notTakenThreshold; 113}; 114 115#endif // __CPU_PRED_BI_MODE_PRED_HH__ |