bpred_unit.hh (10273:6e6557085eb7) | bpred_unit.hh (10330:f54586c894e3) |
---|---|
1/* 2 * Copyright (c) 2011-2012, 2014 ARM Limited 3 * Copyright (c) 2010 The University of Edinburgh 4 * All rights reserved 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 164 unchanged lines hidden (view full) --- 173 * @param bp_history Pointer to the branch predictor state that is 174 * associated with the branch lookup that is being updated. 175 * @param squashed Set to true when this function is called during a 176 * squash operation. 177 * @todo Make this update flexible enough to handle a global predictor. 178 */ 179 virtual void update(Addr instPC, bool taken, void *bp_history, 180 bool squashed) = 0; | 1/* 2 * Copyright (c) 2011-2012, 2014 ARM Limited 3 * Copyright (c) 2010 The University of Edinburgh 4 * All rights reserved 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 164 unchanged lines hidden (view full) --- 173 * @param bp_history Pointer to the branch predictor state that is 174 * associated with the branch lookup that is being updated. 175 * @param squashed Set to true when this function is called during a 176 * squash operation. 177 * @todo Make this update flexible enough to handle a global predictor. 178 */ 179 virtual void update(Addr instPC, bool taken, void *bp_history, 180 bool squashed) = 0; |
181 /** 182 * Deletes the associated history with a branch, performs no predictor 183 * updates. Used for branches that mispredict and update tables but 184 * are still speculative and later retire. 185 * @param bp_history History to delete associated with this predictor 186 */ 187 virtual void retireSquashed(void *bp_history) = 0; |
|
181 182 /** 183 * Updates the BTB with the target of a branch. 184 * @param inst_PC The branch's PC that will be updated. 185 * @param target_PC The branch's target that will be added to the BTB. 186 */ 187 void BTBUpdate(Addr instPC, const TheISA::PCState &target) 188 { BTB.update(instPC, target, 0); } --- 6 unchanged lines hidden (view full) --- 195 * Makes a predictor history struct that contains any 196 * information needed to update the predictor, BTB, and RAS. 197 */ 198 PredictorHistory(const InstSeqNum &seq_num, Addr instPC, 199 bool pred_taken, void *bp_history, 200 ThreadID _tid) 201 : seqNum(seq_num), pc(instPC), bpHistory(bp_history), RASTarget(0), 202 RASIndex(0), tid(_tid), predTaken(pred_taken), usedRAS(0), pushedRAS(0), | 188 189 /** 190 * Updates the BTB with the target of a branch. 191 * @param inst_PC The branch's PC that will be updated. 192 * @param target_PC The branch's target that will be added to the BTB. 193 */ 194 void BTBUpdate(Addr instPC, const TheISA::PCState &target) 195 { BTB.update(instPC, target, 0); } --- 6 unchanged lines hidden (view full) --- 202 * Makes a predictor history struct that contains any 203 * information needed to update the predictor, BTB, and RAS. 204 */ 205 PredictorHistory(const InstSeqNum &seq_num, Addr instPC, 206 bool pred_taken, void *bp_history, 207 ThreadID _tid) 208 : seqNum(seq_num), pc(instPC), bpHistory(bp_history), RASTarget(0), 209 RASIndex(0), tid(_tid), predTaken(pred_taken), usedRAS(0), pushedRAS(0), |
203 wasCall(0), wasReturn(0) | 210 wasCall(0), wasReturn(0), wasSquashed(0) |
204 {} 205 206 bool operator==(const PredictorHistory &entry) const { 207 return this->seqNum == entry.seqNum; 208 } 209 210 /** The sequence number for the predictor history entry. */ 211 InstSeqNum seqNum; --- 17 unchanged lines hidden (view full) --- 229 ThreadID tid; 230 231 /** Whether or not it was predicted taken. */ 232 bool predTaken; 233 234 /** Whether or not the RAS was used. */ 235 bool usedRAS; 236 | 211 {} 212 213 bool operator==(const PredictorHistory &entry) const { 214 return this->seqNum == entry.seqNum; 215 } 216 217 /** The sequence number for the predictor history entry. */ 218 InstSeqNum seqNum; --- 17 unchanged lines hidden (view full) --- 236 ThreadID tid; 237 238 /** Whether or not it was predicted taken. */ 239 bool predTaken; 240 241 /** Whether or not the RAS was used. */ 242 bool usedRAS; 243 |
237 /* Wether or not the RAS was pushed */ | 244 /* Whether or not the RAS was pushed */ |
238 bool pushedRAS; 239 240 /** Whether or not the instruction was a call. */ 241 bool wasCall; 242 243 /** Whether or not the instruction was a return. */ 244 bool wasReturn; | 245 bool pushedRAS; 246 247 /** Whether or not the instruction was a call. */ 248 bool wasCall; 249 250 /** Whether or not the instruction was a return. */ 251 bool wasReturn; |
252 253 /** Whether this instruction has already mispredicted/updated bp */ 254 bool wasSquashed; |
|
245 }; 246 247 typedef std::deque<PredictorHistory> History; 248 249 /** Number of the threads for which the branch history is maintained. */ 250 uint32_t numThreads; 251 252 /** --- 33 unchanged lines hidden --- | 255 }; 256 257 typedef std::deque<PredictorHistory> History; 258 259 /** Number of the threads for which the branch history is maintained. */ 260 uint32_t numThreads; 261 262 /** --- 33 unchanged lines hidden --- |