/** The number of physical registers in the CPU. */
unsigned numPhysRegs;
+ /** Number of instructions currently in flight to FUs */
+ int wbOutstanding;
+
/** Delay between commit stage and the IQ.
* @todo: Make there be a distinction between the delays within IEW.
*/
deferredMemInsts.clear();
blockedMemInsts.clear();
retryMemInsts.clear();
+ wbOutstanding = 0;
}
template <class Impl>
bool
InstructionQueue<Impl>::isDrained() const
{
- bool drained = dependGraph.empty() && instsToExecute.empty();
+ bool drained = dependGraph.empty() &&
+ instsToExecute.empty() &&
+ wbOutstanding == 0;
for (ThreadID tid = 0; tid < numThreads; ++tid)
drained = drained && memDepUnit[tid].isDrained();
assert(!cpu->switchedOut());
// The CPU could have been sleeping until this op completed (*extremely*
// long latency op). Wake it if it was. This may be overkill.
+ --wbOutstanding;
iewStage->wakeCPU();
if (fu_idx > -1)
} else {
Cycles issue_latency = fuPool->getIssueLatency(op_class);
// Generate completion event for the FU
+ ++wbOutstanding;
FUCompletion *execution = new FUCompletion(issuing_inst,
idx, this);