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>
This commit is contained in:
parent
34ad1123ee
commit
826f69b470
2 changed files with 9 additions and 3 deletions
|
@ -462,6 +462,7 @@ def run(options, root, testsys, cpu_class):
|
||||||
switch_cpus[i].system = testsys
|
switch_cpus[i].system = testsys
|
||||||
switch_cpus[i].workload = testsys.cpu[i].workload
|
switch_cpus[i].workload = testsys.cpu[i].workload
|
||||||
switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain
|
switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain
|
||||||
|
switch_cpus[i].progress_interval = testsys.cpu[i].progress_interval
|
||||||
# simulation period
|
# simulation period
|
||||||
if options.maxinsts:
|
if options.maxinsts:
|
||||||
switch_cpus[i].max_insts_any_thread = options.maxinsts
|
switch_cpus[i].max_insts_any_thread = options.maxinsts
|
||||||
|
|
|
@ -94,6 +94,14 @@ void
|
||||||
CPUProgressEvent::process()
|
CPUProgressEvent::process()
|
||||||
{
|
{
|
||||||
Counter temp = cpu->totalOps();
|
Counter temp = cpu->totalOps();
|
||||||
|
|
||||||
|
if (_repeatEvent)
|
||||||
|
cpu->schedule(this, curTick() + _interval);
|
||||||
|
|
||||||
|
if(cpu->switchedOut()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
double ipc = double(temp - lastNumInst) / (_interval / cpu->clockPeriod());
|
double ipc = double(temp - lastNumInst) / (_interval / cpu->clockPeriod());
|
||||||
|
|
||||||
|
@ -107,9 +115,6 @@ CPUProgressEvent::process()
|
||||||
temp - lastNumInst);
|
temp - lastNumInst);
|
||||||
#endif
|
#endif
|
||||||
lastNumInst = temp;
|
lastNumInst = temp;
|
||||||
|
|
||||||
if (_repeatEvent)
|
|
||||||
cpu->schedule(this, curTick() + _interval);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
|
Loading…
Reference in a new issue