tournament.hh (8842:a02932e2e73d) | tournament.hh (9360:515891d9057a) |
---|---|
1/* 2 * Copyright (c) 2011 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 --- 49 unchanged lines hidden (view full) --- 58 * or misspeculating. 59 */ 60class TournamentBP 61{ 62 public: 63 /** 64 * Default branch predictor constructor. 65 */ | 1/* 2 * Copyright (c) 2011 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 --- 49 unchanged lines hidden (view full) --- 58 * or misspeculating. 59 */ 60class TournamentBP 61{ 62 public: 63 /** 64 * Default branch predictor constructor. 65 */ |
66 TournamentBP(unsigned localPredictorSize, 67 unsigned localCtrBits, | 66 TournamentBP(unsigned localCtrBits, |
68 unsigned localHistoryTableSize, 69 unsigned localHistoryBits, 70 unsigned globalPredictorSize, 71 unsigned globalHistoryBits, 72 unsigned globalCtrBits, 73 unsigned choicePredictorSize, 74 unsigned choiceCtrBits, 75 unsigned instShiftAmt); --- 100 unchanged lines hidden (view full) --- 176 bool globalUsed; 177 }; 178 179 /** Flag for invalid predictor index */ 180 static const int invalidPredictorIndex = -1; 181 /** Local counters. */ 182 std::vector<SatCounter> localCtrs; 183 | 67 unsigned localHistoryTableSize, 68 unsigned localHistoryBits, 69 unsigned globalPredictorSize, 70 unsigned globalHistoryBits, 71 unsigned globalCtrBits, 72 unsigned choicePredictorSize, 73 unsigned choiceCtrBits, 74 unsigned instShiftAmt); --- 100 unchanged lines hidden (view full) --- 175 bool globalUsed; 176 }; 177 178 /** Flag for invalid predictor index */ 179 static const int invalidPredictorIndex = -1; 180 /** Local counters. */ 181 std::vector<SatCounter> localCtrs; 182 |
184 /** Size of the local predictor. */ | 183 /** Number of counters in the local predictor. */ |
185 unsigned localPredictorSize; 186 | 184 unsigned localPredictorSize; 185 |
187 /** Mask to get the proper index bits into the predictor. */ | 186 /** Mask to truncate values stored in the local history table. */ |
188 unsigned localPredictorMask; 189 190 /** Number of bits of the local predictor's counters. */ 191 unsigned localCtrBits; 192 193 /** Array of local history table entries. */ 194 std::vector<unsigned> localHistoryTable; 195 | 187 unsigned localPredictorMask; 188 189 /** Number of bits of the local predictor's counters. */ 190 unsigned localCtrBits; 191 192 /** Array of local history table entries. */ 193 std::vector<unsigned> localHistoryTable; 194 |
196 /** Size of the local history table. */ | 195 /** Number of entries in the local history table. */ |
197 unsigned localHistoryTableSize; 198 | 196 unsigned localHistoryTableSize; 197 |
199 /** Number of bits for each entry of the local history table. 200 * @todo Doesn't this come from the size of the local predictor? 201 */ | 198 /** Number of bits for each entry of the local history table. */ |
202 unsigned localHistoryBits; 203 | 199 unsigned localHistoryBits; 200 |
204 /** Mask to get the proper local history. */ 205 unsigned localHistoryMask; 206 | |
207 /** Array of counters that make up the global predictor. */ 208 std::vector<SatCounter> globalCtrs; 209 | 201 /** Array of counters that make up the global predictor. */ 202 std::vector<SatCounter> globalCtrs; 203 |
210 /** Size of the global predictor. */ | 204 /** Number of entries in the global predictor. */ |
211 unsigned globalPredictorSize; 212 213 /** Number of bits of the global predictor's counters. */ 214 unsigned globalCtrBits; 215 | 205 unsigned globalPredictorSize; 206 207 /** Number of bits of the global predictor's counters. */ 208 unsigned globalCtrBits; 209 |
216 /** Global history register. */ | 210 /** Global history register. Contains as much history as specified by 211 * globalHistoryBits. Actual number of bits used is determined by 212 * globalHistoryMask and choiceHistoryMask. */ |
217 unsigned globalHistory; 218 | 213 unsigned globalHistory; 214 |
219 /** Number of bits for the global history. */ | 215 /** Number of bits for the global history. Determines maximum number of 216 entries in global and choice predictor tables. */ |
220 unsigned globalHistoryBits; 221 | 217 unsigned globalHistoryBits; 218 |
222 /** Mask to get the proper global history. */ | 219 /** Mask to apply to globalHistory to access global history table. 220 * Based on globalPredictorSize.*/ |
223 unsigned globalHistoryMask; 224 | 221 unsigned globalHistoryMask; 222 |
223 /** Mask to apply to globalHistory to access choice history table. 224 * Based on choicePredictorSize.*/ 225 unsigned choiceHistoryMask; 226 227 /** Mask to control how much history is stored. All of it might not be 228 * used. */ 229 unsigned historyRegisterMask; 230 |
|
225 /** Array of counters that make up the choice predictor. */ 226 std::vector<SatCounter> choiceCtrs; 227 | 231 /** Array of counters that make up the choice predictor. */ 232 std::vector<SatCounter> choiceCtrs; 233 |
228 /** Size of the choice predictor (identical to the global predictor). */ | 234 /** Number of entries in the choice predictor. */ |
229 unsigned choicePredictorSize; 230 | 235 unsigned choicePredictorSize; 236 |
231 /** Number of bits of the choice predictor's counters. */ | 237 /** Number of bits in the choice predictor's counters. */ |
232 unsigned choiceCtrBits; 233 234 /** Number of bits to shift the instruction over to get rid of the word 235 * offset. 236 */ 237 unsigned instShiftAmt; 238 | 238 unsigned choiceCtrBits; 239 240 /** Number of bits to shift the instruction over to get rid of the word 241 * offset. 242 */ 243 unsigned instShiftAmt; 244 |
239 /** Threshold for the counter value; above the threshold is taken, | 245 /** Thresholds for the counter value; above the threshold is taken, |
240 * equal to or below the threshold is not taken. 241 */ | 246 * equal to or below the threshold is not taken. 247 */ |
242 unsigned threshold; | 248 unsigned localThreshold; 249 unsigned globalThreshold; 250 unsigned choiceThreshold; |
243}; 244 245#endif // __CPU_O3_TOURNAMENT_PRED_HH__ | 251}; 252 253#endif // __CPU_O3_TOURNAMENT_PRED_HH__ |