summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/first_stage.cc
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2010-01-31 18:28:51 -0500
committerKorey Sewell <ksewell@umich.edu>2010-01-31 18:28:51 -0500
commitffa9ecb1fa71f1fe89a65975b2c558e312bbfbc8 (patch)
treeadbae9144a62e3a25720954b48feb4de8c46f259 /src/cpu/inorder/first_stage.cc
parent4d749472e3cb97ff0421fbf5cbc53d9c89ecfa45 (diff)
downloadgem5-ffa9ecb1fa71f1fe89a65975b2c558e312bbfbc8.tar.xz
inorder: pipeline stage stats
add idle/run/utilization stats for each pipeline stage
Diffstat (limited to 'src/cpu/inorder/first_stage.cc')
-rw-r--r--src/cpu/inorder/first_stage.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/cpu/inorder/first_stage.cc b/src/cpu/inorder/first_stage.cc
index 27831469e..c653d152b 100644
--- a/src/cpu/inorder/first_stage.cc
+++ b/src/cpu/inorder/first_stage.cc
@@ -118,9 +118,9 @@ FirstStage::processStage(bool &status_change)
status_change = checkSignalsAndUpdate(tid) || status_change;
}
- for (int threadFetched = 0; threadFetched < numFetchingThreads;
- threadFetched++) {
-
+ for (int insts_fetched = 0;
+ insts_fetched < stageWidth && canSendInstToStage(1);
+ insts_fetched++) {
ThreadID tid = getFetchingThread(fetchPolicy);
if (tid >= 0) {
@@ -130,6 +130,13 @@ FirstStage::processStage(bool &status_change)
DPRINTF(InOrderStage, "No more threads to fetch from.\n");
}
}
+
+ if (instsProcessed > 0) {
+ ++runCycles;
+ } else {
+ ++idleCycles;
+ }
+
}
//@TODO: Note in documentation, that when you make a pipeline stage change,
@@ -197,7 +204,6 @@ FirstStage::processInsts(ThreadID tid)
}
sendInstToNextStage(inst);
- //++stageProcessedInsts;
}
// Record that stage has written to the time buffer for activity