summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/first_stage.cc
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-02-04 00:08:13 -0500
committerKorey Sewell <ksewell@umich.edu>2011-02-04 00:08:13 -0500
commit7f937e11e2779628002d063a368ee3101a32471d (patch)
tree4abcb47af12755b24520a51c29650ce16a13cd94 /src/cpu/inorder/first_stage.cc
parent091a3e6cc0f089b6ba6877c8127ebd2ebf8e7c21 (diff)
downloadgem5-7f937e11e2779628002d063a368ee3101a32471d.tar.xz
inorder: activity tracking bug
Previous code was marking CPU activity on almost every cycle due to a bug in tracking the status of pipeline stages. This disables the CPU from sleeping on long latency stalls and increases simulation time
Diffstat (limited to 'src/cpu/inorder/first_stage.cc')
-rw-r--r--src/cpu/inorder/first_stage.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cpu/inorder/first_stage.cc b/src/cpu/inorder/first_stage.cc
index ae458c604..424d6b6a4 100644
--- a/src/cpu/inorder/first_stage.cc
+++ b/src/cpu/inorder/first_stage.cc
@@ -126,8 +126,10 @@ FirstStage::processStage(bool &status_change)
if (tid >= 0) {
DPRINTF(InOrderStage, "Processing [tid:%i]\n",tid);
processThread(status_change, tid);
+ DPRINTF(InOrderStage, "Done Processing [tid:%i]\n",tid);
} else {
DPRINTF(InOrderStage, "No more threads to fetch from.\n");
+ break;
}
}
@@ -148,7 +150,7 @@ FirstStage::processInsts(ThreadID tid)
{
bool all_reqs_completed = true;
- for (int insts_fetched = 0;
+ for (int insts_fetched = instsProcessed;
insts_fetched < stageWidth && canSendInstToStage(1);
insts_fetched++) {
@@ -200,8 +202,11 @@ FirstStage::processInsts(ThreadID tid)
"list.\n", tid, inst->seqNum);
insts[tid].push(inst);
}
+ block(tid);
break;
} else if (!insts[tid].empty()){
+ DPRINTF(InOrderStage, "[tid:%u]: [sn:%u] Finished all "
+ "requests for this stage.\n", tid, inst->seqNum);
insts[tid].pop();
}
@@ -210,7 +215,7 @@ FirstStage::processInsts(ThreadID tid)
// Record that stage has written to the time buffer for activity
// tracking.
- if (toNextStageIndex) {
+ if (instsProcessed) {
wroteToTimeBuffer = true;
}
}