}
/** Squashes a specific thread and resets the PC. */
- inline void doSquash(const TheISA::PCState &newPC, ThreadID tid);
+ inline void doSquash(const TheISA::PCState &newPC,
+ const DynInstPtr squashInst, ThreadID tid);
/** Squashes a specific thread and resets the PC. Also tells the CPU to
* remove any instructions between fetch and decode that should be sqaushed.
*/
void squashFromDecode(const TheISA::PCState &newPC,
- const InstSeqNum &seq_num, ThreadID tid);
+ const DynInstPtr squashInst,
+ const InstSeqNum seq_num, ThreadID tid);
/** Checks if a thread is stalled. */
bool checkStall(ThreadID tid) const;
* remove any instructions that are not in the ROB. The source of this
* squash should be the commit stage.
*/
- void squash(const TheISA::PCState &newPC, const InstSeqNum &seq_num,
- DynInstPtr &squashInst, ThreadID tid);
+ void squash(const TheISA::PCState &newPC, const InstSeqNum seq_num,
+ DynInstPtr squashInst, ThreadID tid);
/** Ticks the fetch stage, processing all inputs signals and fetching
* as many instructions as possible.
template <class Impl>
inline void
-DefaultFetch<Impl>::doSquash(const TheISA::PCState &newPC, ThreadID tid)
+DefaultFetch<Impl>::doSquash(const TheISA::PCState &newPC,
+ const DynInstPtr squashInst, ThreadID tid)
{
DPRINTF(Fetch, "[tid:%i]: Squashing, setting PC to: %s.\n",
tid, newPC);
pc[tid] = newPC;
fetchOffset[tid] = 0;
- macroop[tid] = NULL;
+ if (squashInst && squashInst->pcState().instAddr() == newPC.instAddr())
+ macroop[tid] = squashInst->macroop;
+ else
+ macroop[tid] = NULL;
predecoder.reset();
// Clear the icache miss if it's outstanding.
template<class Impl>
void
DefaultFetch<Impl>::squashFromDecode(const TheISA::PCState &newPC,
- const InstSeqNum &seq_num, ThreadID tid)
+ const DynInstPtr squashInst,
+ const InstSeqNum seq_num, ThreadID tid)
{
DPRINTF(Fetch, "[tid:%i]: Squashing from decode.\n", tid);
- doSquash(newPC, tid);
+ doSquash(newPC, squashInst, tid);
// Tell the CPU to remove any instructions that are in flight between
// fetch and decode.
template <class Impl>
void
DefaultFetch<Impl>::squash(const TheISA::PCState &newPC,
- const InstSeqNum &seq_num, DynInstPtr &squashInst,
+ const InstSeqNum seq_num, DynInstPtr squashInst,
ThreadID tid)
{
DPRINTF(Fetch, "[tid:%u]: Squash from commit.\n", tid);
- doSquash(newPC, tid);
+ doSquash(newPC, squashInst, tid);
// Tell the CPU to remove any instructions that are not in the ROB.
cpu->removeInstsNotInROB(tid);
DPRINTF(Fetch, "Squashing from decode with PC = %s\n", nextPC);
// Squash unless we're already squashing
squashFromDecode(fromDecode->decodeInfo[tid].nextPC,
+ fromDecode->decodeInfo[tid].squashInst,
fromDecode->decodeInfo[tid].doneSeqNum,
tid);