ThePipeline::createFrontEndSchedule(inst);
}
- // Don't let instruction pass to next stage if it hasnt completed
- // all of it's requests for this stage.
- all_reqs_completed = processInstSchedule(inst);
+ int reqs_processed = 0;
+ all_reqs_completed = processInstSchedule(inst, reqs_processed);
+
+ // If the instruction isnt squashed & we've completed one request
+ // Then we can officially count this instruction toward the stage's
+ // bandwidth count
+ if (reqs_processed > 0)
+ instsProcessed++;
if (!all_reqs_completed) {
if (new_inst) {
nextStage->size = 0;
toNextStageIndex = 0;
-
+
sortInsts();
+ instsProcessed = 0;
+
processStage(status_change);
if (status_change) {
DynInstPtr inst;
bool last_req_completed = true;
- int insts_processed = 0;
-
while (insts_available > 0 &&
- insts_processed < stageWidth &&
+ instsProcessed < stageWidth &&
(!nextStageValid || canSendInstToStage(stageNum+1)) &&
last_req_completed) {
assert(!insts_to_stage.empty());
continue;
}
+ int reqs_processed = 0;
+ last_req_completed = processInstSchedule(inst, reqs_processed);
- last_req_completed = processInstSchedule(inst);
+ // If the instruction isnt squashed & we've completed one request
+ // Then we can officially count this instruction toward the stage's
+ // bandwidth count
+ if (reqs_processed > 0)
+ instsProcessed++;
// Don't let instruction pass to next stage if it hasnt completed
// all of it's requests for this stage.
break;
}
- insts_processed++;
-
insts_to_stage.pop();
//++stageProcessedInsts;
}
bool
-PipelineStage::processInstSchedule(DynInstPtr inst)
+PipelineStage::processInstSchedule(DynInstPtr inst,int &reqs_processed)
{
bool last_req_completed = true;
ThreadID tid = inst->readTid();
panic("%i: encountered %s fault!\n",
curTick, req->fault->name());
}
+
+ reqs_processed++;
} else {
DPRINTF(InOrderStage, "[tid:%i]: [sn:%i] request to %s failed."
"\n", tid, inst->seqNum, cpu->resPool->name(res_num));
virtual void processInsts(ThreadID tid);
/** Process all resources on an instruction's resource schedule */
- virtual bool processInstSchedule(DynInstPtr inst);
+ virtual bool processInstSchedule(DynInstPtr inst, int &reqs_processed);
/** Is there room in the next stage buffer for this instruction? */
virtual bool canSendInstToStage(unsigned stage_num);
std::vector<DynInstPtr> switchedOutBuffer;
std::vector<bool> switchedOutValid;
+ /** Instructions that we've processed this tick
+ * NOTE: "Processed" means completed at least 1 instruction request
+ */
+ unsigned instsProcessed;
+
/** Queue of all instructions coming from previous stage on this cycle. */
std::queue<DynInstPtr> insts[ThePipeline::MaxThreads];