/*
- * Copyright (c) 2011-2014, 2017-2019 ARM Limited
+ * Copyright (c) 2011-2014, 2017-2020 ARM Limited
* Copyright (c) 2013 Advanced Micro Devices, Inc.
* All rights reserved.
*
// Tell the memory dependence unit to wake any dependents on this
// instruction if it is a memory instruction. Also complete the memory
// instruction at this point since we know it executed without issues.
- // @todo: Might want to rename "completeMemInst" to something that
- // indicates that it won't need to be replayed, and call this
- // earlier. Might not be a big deal.
+ ThreadID tid = completed_inst->threadNumber;
if (completed_inst->isMemRef()) {
- memDepUnit[completed_inst->threadNumber].wakeDependents(completed_inst);
- completeMemInst(completed_inst);
+ memDepUnit[tid].completeInst(completed_inst);
+
+ DPRINTF(IQ, "Completing mem instruction PC: %s [sn:%llu]\n",
+ completed_inst->pcState(), completed_inst->seqNum);
+
+ ++freeEntries;
+ completed_inst->memOpDone(true);
+ count[tid]--;
} else if (completed_inst->isMemBarrier() ||
completed_inst->isWriteBarrier()) {
- memDepUnit[completed_inst->threadNumber].completeBarrier(completed_inst);
+ // Completes a non mem ref barrier
+ memDepUnit[tid].completeInst(completed_inst);
}
for (int dest_reg_idx = 0;
memDepUnit[replay_inst->threadNumber].replay();
}
-template <class Impl>
-void
-InstructionQueue<Impl>::completeMemInst(const DynInstPtr &completed_inst)
-{
- ThreadID tid = completed_inst->threadNumber;
-
- DPRINTF(IQ, "Completing mem instruction PC: %s [sn:%llu]\n",
- completed_inst->pcState(), completed_inst->seqNum);
-
- ++freeEntries;
-
- completed_inst->memOpDone(true);
-
- memDepUnit[tid].completed(completed_inst);
- count[tid]--;
-}
-
template <class Impl>
void
InstructionQueue<Impl>::deferMemInst(const DynInstPtr &deferred_inst)
*/
void replay();
- /** Completes a memory instruction. */
- void completed(const DynInstPtr &inst);
-
- /** Completes a barrier instruction. */
- void completeBarrier(const DynInstPtr &inst);
-
- /** Wakes any dependents of a memory instruction. */
- void wakeDependents(const DynInstPtr &inst);
+ /** Notifies completion of an instruction. */
+ void completeInst(const DynInstPtr &inst);
/** Squashes all instructions up until a given sequence number for a
* specific thread.
void dumpLists();
private:
+
+ /** Completes a memory instruction. */
+ void completed(const DynInstPtr &inst);
+
+ /** Wakes any dependents of a memory instruction. */
+ void wakeDependents(const DynInstPtr &inst);
+
typedef typename std::list<DynInstPtr>::iterator ListIt;
class MemDepEntry;