bi_mode.hh (11427:fb512311295e) bi_mode.hh (11429:cf5af0cc3be4)
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(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;
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);
68
69 private:
66
67 private:
70 void updateGlobalHistReg(ThreadID tid, bool taken);
68 void updateGlobalHistReg(bool taken);
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
69
70 struct BPHistory {
71 unsigned globalHistoryReg;
72 // was the taken array's prediction used?
73 // true: takenPred used
74 // false: notPred used
75 bool takenUsed;
76 // prediction of the taken array

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

89
90 // choice predictors
91 std::vector<SatCounter> choiceCounters;
92 // taken direction predictors
93 std::vector<SatCounter> takenCounters;
94 // not-taken direction predictors
95 std::vector<SatCounter> notTakenCounters;
96
99 std::vector<unsigned> globalHistoryReg;
97 unsigned globalHistoryReg;
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__
98 unsigned globalHistoryBits;
99 unsigned historyRegisterMask;
100
101 unsigned choicePredictorSize;
102 unsigned choiceCtrBits;
103 unsigned choiceHistoryMask;
104 unsigned globalPredictorSize;
105 unsigned globalCtrBits;
106 unsigned globalHistoryMask;
107
108 unsigned choiceThreshold;
109 unsigned takenThreshold;
110 unsigned notTakenThreshold;
111};
112
113#endif // __CPU_PRED_BI_MODE_PRED_HH__