timing.cc (12085:de78ea63e0ca) timing.cc (12276:22c220be30c5)
1/*
2 * Copyright 2014 Google, Inc.
1/*
2 * Copyright 2014 Google, Inc.
3 * Copyright (c) 2010-2013,2015 ARM Limited
3 * Copyright (c) 2010-2013,2015,2017 ARM Limited
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license
11 * terms below provided that you ensure that this notice is replicated

--- 77 unchanged lines hidden (view full) ---

89
90TimingSimpleCPU::~TimingSimpleCPU()
91{
92}
93
94DrainState
95TimingSimpleCPU::drain()
96{
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license
11 * terms below provided that you ensure that this notice is replicated

--- 77 unchanged lines hidden (view full) ---

89
90TimingSimpleCPU::~TimingSimpleCPU()
91{
92}
93
94DrainState
95TimingSimpleCPU::drain()
96{
97 // Deschedule any power gating event (if any)
98 deschedulePowerGatingEvent();
99
97 if (switchedOut())
98 return DrainState::Drained;
99
100 if (_status == Idle ||
101 (_status == BaseSimpleCPU::Running && isDrained())) {
102 DPRINTF(Drain, "No need to drain.\n");
103 activeThreads.clear();
104 return DrainState::Drained;

--- 36 unchanged lines hidden (view full) ---

141 if (!fetchEvent.scheduled()) {
142 schedule(fetchEvent, nextCycle());
143 }
144 } else {
145 threadInfo[tid]->notIdleFraction = 0;
146 }
147 }
148
100 if (switchedOut())
101 return DrainState::Drained;
102
103 if (_status == Idle ||
104 (_status == BaseSimpleCPU::Running && isDrained())) {
105 DPRINTF(Drain, "No need to drain.\n");
106 activeThreads.clear();
107 return DrainState::Drained;

--- 36 unchanged lines hidden (view full) ---

144 if (!fetchEvent.scheduled()) {
145 schedule(fetchEvent, nextCycle());
146 }
147 } else {
148 threadInfo[tid]->notIdleFraction = 0;
149 }
150 }
151
152 // Reschedule any power gating event (if any)
153 schedulePowerGatingEvent();
154
149 system->totalNumInsts = 0;
150}
151
152bool
153TimingSimpleCPU::tryCompleteDrain()
154{
155 if (drainState() != DrainState::Draining)
156 return false;

--- 857 unchanged lines hidden ---
155 system->totalNumInsts = 0;
156}
157
158bool
159TimingSimpleCPU::tryCompleteDrain()
160{
161 if (drainState() != DrainState::Draining)
162 return false;

--- 857 unchanged lines hidden ---