2bit_local.hh (13626:d6a6358aa6db) | 2bit_local.hh (13959:ea907b02c800) |
---|---|
1/* 2 * Copyright (c) 2011, 2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 83 unchanged lines hidden (view full) --- 92 * @param taken Whether or not the branch was taken. 93 */ 94 void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, 95 bool squashed, const StaticInstPtr & inst, Addr corrTarget); 96 97 void squash(ThreadID tid, void *bp_history) 98 { assert(bp_history == NULL); } 99 | 1/* 2 * Copyright (c) 2011, 2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 83 unchanged lines hidden (view full) --- 92 * @param taken Whether or not the branch was taken. 93 */ 94 void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, 95 bool squashed, const StaticInstPtr & inst, Addr corrTarget); 96 97 void squash(ThreadID tid, void *bp_history) 98 { assert(bp_history == NULL); } 99 |
100 void reset(); 101 | |
102 private: 103 /** 104 * Returns the taken/not taken prediction given the value of the 105 * counter. 106 * @param count The value of the counter. 107 * @return The prediction based on the counter value. 108 */ 109 inline bool getPrediction(uint8_t &count); 110 111 /** Calculates the local index based on the PC. */ 112 inline unsigned getLocalIndex(Addr &PC); 113 | 100 private: 101 /** 102 * Returns the taken/not taken prediction given the value of the 103 * counter. 104 * @param count The value of the counter. 105 * @return The prediction based on the counter value. 106 */ 107 inline bool getPrediction(uint8_t &count); 108 109 /** Calculates the local index based on the PC. */ 110 inline unsigned getLocalIndex(Addr &PC); 111 |
114 /** Array of counters that make up the local predictor. */ 115 std::vector<SatCounter> localCtrs; 116 | |
117 /** Size of the local predictor. */ | 112 /** Size of the local predictor. */ |
118 unsigned localPredictorSize; | 113 const unsigned localPredictorSize; |
119 | 114 |
115 /** Number of bits of the local predictor's counters. */ 116 const unsigned localCtrBits; 117 |
|
120 /** Number of sets. */ | 118 /** Number of sets. */ |
121 unsigned localPredictorSets; | 119 const unsigned localPredictorSets; |
122 | 120 |
123 /** Number of bits of the local predictor's counters. */ 124 unsigned localCtrBits; | 121 /** Array of counters that make up the local predictor. */ 122 std::vector<SatCounter> localCtrs; |
125 126 /** Mask to get index bits. */ | 123 124 /** Mask to get index bits. */ |
127 unsigned indexMask; | 125 const unsigned indexMask; |
128}; 129 130#endif // __CPU_PRED_2BIT_LOCAL_PRED_HH__ | 126}; 127 128#endif // __CPU_PRED_2BIT_LOCAL_PRED_HH__ |