1/* 2 * Copyright (c) 2004-2006 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; --- 195 unchanged lines hidden (view full) --- 204 Result instResult; 205 206 /** Records changes to result? */ 207 bool recordResult; 208 209 /** PC of this instruction. */ 210 Addr PC; 211 |
212 protected: |
213 /** Next non-speculative PC. It is not filled in at fetch, but rather 214 * once the target of the branch is truly known (either decode or 215 * execute). 216 */ 217 Addr nextPC; 218 219 /** Next non-speculative NPC. Target PC for Mips or Sparc. */ 220 Addr nextNPC; 221 222 /** Predicted next PC. */ 223 Addr predPC; 224 225 /** Predicted next NPC. */ 226 Addr predNPC; 227 228 /** If this is a branch that was predicted taken */ 229 bool predTaken; 230 |
231 public: 232 |
233 /** Count of total number of dynamic instructions. */ 234 static int instcount; 235 236#ifdef DEBUG 237 void dumpSNList(); 238#endif 239 240 /** Whether or not the source register is ready. --- 147 unchanged lines hidden (view full) --- 388 /** Returns the next PC. This could be the speculative next PC if it is 389 * called prior to the actual branch target being calculated. 390 */ 391 Addr readNextPC() { return nextPC; } 392 393 /** Returns the next NPC. This could be the speculative next NPC if it is 394 * called prior to the actual branch target being calculated. 395 */ |
396 Addr readNextNPC() 397 { 398#if ISA_HAS_DELAY_SLOT 399 return nextNPC; 400#else 401 return nextPC + sizeof(TheISA::MachInst); 402#endif 403 } |
404 405 /** Set the predicted target of this current instruction. */ 406 void setPredTarg(Addr predicted_PC, Addr predicted_NPC) 407 { 408 predPC = predicted_PC; 409 predNPC = predicted_NPC; 410 } 411 --- 12 unchanged lines hidden (view full) --- 424 void setPredTaken(bool predicted_taken) 425 { 426 predTaken = predicted_taken; 427 } 428 429 /** Returns whether the instruction mispredicted. */ 430 bool mispredicted() 431 { |
432 return readPredPC() != readNextPC() || 433 readPredNPC() != readNextNPC(); |
434 } 435 436 // 437 // Instruction types. Forward checks to StaticInst object. 438 // 439 bool isNop() const { return staticInst->isNop(); } 440 bool isMemRef() const { return staticInst->isMemRef(); } 441 bool isLoad() const { return staticInst->isLoad(); } --- 436 unchanged lines hidden --- |