changeset ee82c2c30421 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=ee82c2c30421
description:
        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 <[email protected]>

diffstat:

 configs/common/Simulation.py |   1 +
 src/cpu/base.cc              |  11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r f56c10663a01 -r ee82c2c30421 configs/common/Simulation.py
--- a/configs/common/Simulation.py      Mon Apr 13 17:33:57 2015 -0500
+++ b/configs/common/Simulation.py      Tue Apr 14 11:01:10 2015 -0500
@@ -462,6 +462,7 @@
             switch_cpus[i].system =  testsys
             switch_cpus[i].workload = testsys.cpu[i].workload
             switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain
+            switch_cpus[i].progress_interval = testsys.cpu[i].progress_interval
             # simulation period
             if options.maxinsts:
                 switch_cpus[i].max_insts_any_thread = options.maxinsts
diff -r f56c10663a01 -r ee82c2c30421 src/cpu/base.cc
--- a/src/cpu/base.cc   Mon Apr 13 17:33:57 2015 -0500
+++ b/src/cpu/base.cc   Tue Apr 14 11:01:10 2015 -0500
@@ -94,6 +94,14 @@
 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 @@
             temp - lastNumInst);
 #endif
     lastNumInst = temp;
-
-    if (_repeatEvent)
-        cpu->schedule(this, curTick() + _interval);
 }
 
 const char *
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to