summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorMalek Musleh <malek.musleh@gmail.com>2015-04-14 11:01:10 -0500
committerMalek Musleh <malek.musleh@gmail.com>2015-04-14 11:01:10 -0500
commit826f69b47073f23ced9b6a2f5eac51e3ae9bc953 (patch)
treee51be674b77157fe419d1c6687f2e21a634d36df /src/cpu
parent34ad1123ee5927e3b1503f07649620a533d3eab9 (diff)
downloadgem5-826f69b47073f23ced9b6a2f5eac51e3ae9bc953.tar.xz
config, cpu: fix progress interval for switched CPUs
This patch ensures that the CPU progress Event is triggered for the new set of switched_cpus that get scheduled (e.g. during fast-forwarding). it also avoids printing the interval state if the cpu is currently switched out. Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/base.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index b761e714e..4d8b09ed2 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -94,6 +94,14 @@ void
CPUProgressEvent::process()
{
Counter temp = cpu->totalOps();
+
+ if (_repeatEvent)
+ cpu->schedule(this, curTick() + _interval);
+
+ if(cpu->switchedOut()) {
+ return;
+ }
+
#ifndef NDEBUG
double ipc = double(temp - lastNumInst) / (_interval / cpu->clockPeriod());
@@ -107,9 +115,6 @@ CPUProgressEvent::process()
temp - lastNumInst);
#endif
lastNumInst = temp;
-
- if (_repeatEvent)
- cpu->schedule(this, curTick() + _interval);
}
const char *