From c0d613adb4eca09c32aca1cc90f04c29574f69c6 Mon Sep 17 00:00:00 2001 From: Anouk Van Laer Date: Fri, 17 Mar 2017 12:02:00 +0000 Subject: pwr: Adds logic to enter power gating for the cpu model If the CPU has been clock gated for a sufficient amount of time (configurable via pwrGatingLatency), the CPU will go into the OFF power state. This does not model hardware, just behaviour. Change-Id: Ib3681d1ffa6ad25eba60f47b4020325f63472d43 Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/3969 Reviewed-by: Jason Lowe-Power Maintainer: Andreas Sandberg --- src/cpu/o3/cpu.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/cpu/o3') diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 0695711f1..091c3a6ad 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -1031,6 +1031,9 @@ template DrainState FullO3CPU::drain() { + // Deschedule any power gating event (if any) + deschedulePowerGatingEvent(); + // If the CPU isn't doing anything, then return immediately. if (switchedOut()) return DrainState::Drained; @@ -1186,6 +1189,9 @@ FullO3CPU::drainResume() assert(!tickEvent.scheduled()); if (_status == Running) schedule(tickEvent, nextCycle()); + + // Reschedule any power gating event (if any) + schedulePowerGatingEvent(); } template -- cgit v1.2.3