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; --- 207 unchanged lines hidden (view full) --- 216 Addr nextPC; 217 218 /** Next non-speculative NPC. Target PC for Mips or Sparc. */ 219 Addr nextNPC; 220 221 /** Predicted next PC. */ 222 Addr predPC; 223 |
224 /** Predicted next NPC. */ 225 Addr predNPC; 226 227 /** If this is a branch that was predicted taken */ 228 bool predTaken; 229 |
230 /** Count of total number of dynamic instructions. */ 231 static int instcount; 232 233#ifdef DEBUG 234 void dumpSNList(); 235#endif 236 237 /** Whether or not the source register is ready. --- 99 unchanged lines hidden (view full) --- 337 { 338 _flatDestRegIdx[idx] = flattened_dest; 339 } 340 341 /** BaseDynInst constructor given a binary instruction. 342 * @param inst The binary instruction. 343 * @param PC The PC of the instruction. 344 * @param pred_PC The predicted next PC. |
345 * @param pred_NPC The predicted next NPC. |
346 * @param seq_num The sequence number of the instruction. 347 * @param cpu Pointer to the instruction's CPU. 348 */ |
349 BaseDynInst(TheISA::ExtMachInst inst, Addr PC, 350 Addr pred_PC, Addr pred_NPC, |
351 InstSeqNum seq_num, ImplCPU *cpu); 352 353 /** BaseDynInst constructor given a StaticInst pointer. 354 * @param _staticInst The StaticInst for this BaseDynInst. 355 */ 356 BaseDynInst(StaticInstPtr &_staticInst); 357 358 /** BaseDynInst destructor. */ --- 29 unchanged lines hidden (view full) --- 388 Addr readNextPC() { return nextPC; } 389 390 /** Returns the next NPC. This could be the speculative next NPC if it is 391 * called prior to the actual branch target being calculated. 392 */ 393 Addr readNextNPC() { return nextNPC; } 394 395 /** Set the predicted target of this current instruction. */ |
396 void setPredTarg(Addr predicted_PC, Addr predicted_NPC) 397 { 398 predPC = predicted_PC; 399 predNPC = predicted_NPC; 400 } |
401 |
402 /** Returns the predicted PC immediately after the branch. */ 403 Addr readPredPC() { return predPC; } |
404 |
405 /** Returns the predicted PC two instructions after the branch */ 406 Addr readPredNPC() { return predNPC; } 407 |
408 /** Returns whether the instruction was predicted taken or not. */ |
409 bool readPredTaken() 410 { 411 return predTaken; 412 } |
413 |
414 void setPredTaken(bool predicted_taken) 415 { 416 predTaken = predicted_taken; 417 } 418 |
419 /** Returns whether the instruction mispredicted. */ 420 bool mispredicted() |
421 { 422 return predPC != nextPC || predNPC != nextNPC; 423 } 424 |
425 // 426 // Instruction types. Forward checks to StaticInst object. 427 // 428 bool isNop() const { return staticInst->isNop(); } 429 bool isMemRef() const { return staticInst->isMemRef(); } 430 bool isLoad() const { return staticInst->isLoad(); } 431 bool isStore() const { return staticInst->isStore(); } 432 bool isStoreConditional() const --- 434 unchanged lines hidden --- |