From 760cc5735f48f3a5a52ebe31df0c039b23c3d611 Mon Sep 17 00:00:00 2001 From: Jose Marinho Date: Thu, 20 Jul 2017 14:57:39 +0100 Subject: cpu, cpu, sim: move Cycle probe update Move the code responsible for performing the actual probe point notify into BaseCPU. Use BaseCPU activateContext and suspendContext to keep track of sleep cycles. Create a probe point (ppActiveCycles) that does not count cycles where the processor was asleep. Rename ppCycles to ppAllCycles to reflect its nature. Change-Id: I1907ddd07d0ff9f2ef22cc9f61f5f46c630c9d66 Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/5762 Maintainer: Andreas Sandberg Reviewed-by: Jason Lowe-Power --- src/cpu/o3/cpu.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cpu/o3/cpu.cc') diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 091c3a6ad..c4bc13fb4 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -568,7 +568,7 @@ FullO3CPU::tick() assert(drainState() != DrainState::Drained); ++numCycles; - ppCycles->notify(1); + updateCycleCounters(BaseCPU::CPU_STATE_ON); // activity = false; @@ -796,6 +796,8 @@ FullO3CPU::haltContext(ThreadID tid) deactivateThread(tid); removeThread(tid); + + updateCycleCounters(BaseCPU::CPU_STATE_SLEEP); } template @@ -1771,7 +1773,6 @@ FullO3CPU::wakeCPU() --cycles; idleCycles += cycles; numCycles += cycles; - ppCycles->notify(cycles); } schedule(tickEvent, clockEdge()); -- cgit v1.2.3