Deleted Added
sdiff udiff text old ( 10910:32f3d1c454ec ) new ( 10913:38dbdeea7f1f )
full compact
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

42#include "cpu/minor/dyn_inst.hh"
43#include "cpu/minor/fetch1.hh"
44#include "cpu/minor/pipeline.hh"
45#include "debug/Drain.hh"
46#include "debug/MinorCPU.hh"
47#include "debug/Quiesce.hh"
48
49MinorCPU::MinorCPU(MinorCPUParams *params) :
50 BaseCPU(params)
51{
52 /* This is only written for one thread at the moment */
53 Minor::MinorThread *thread;
54
55 if (FullSystem) {
56 thread = new Minor::MinorThread(this, 0, params->system, params->itb,
57 params->dtb, params->isa[0]);
58 } else {

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

188
189 for (auto i = threads.begin(); i != threads.end(); i ++)
190 (*i)->startup();
191
192 /* CPU state setup, activate initial context */
193 activateContext(0);
194}
195
196DrainState
197MinorCPU::drain()
198{
199 DPRINTF(Drain, "MinorCPU drain\n");
200
201 /* Need to suspend all threads and wait for Execute to idle.
202 * Tell Fetch1 not to fetch */
203 if (pipeline->drain()) {
204 DPRINTF(Drain, "MinorCPU drained\n");
205 return DrainState::Drained;
206 } else {
207 DPRINTF(Drain, "MinorCPU not finished draining\n");
208 return DrainState::Draining;
209 }
210}
211
212void
213MinorCPU::signalDrainDone()
214{
215 DPRINTF(Drain, "MinorCPU drain done\n");
216 signalDrainDone();
217}
218
219void
220MinorCPU::drainResume()
221{
222 assert(drainState() == DrainState::Drained);
223
224 if (switchedOut()) {
225 DPRINTF(Drain, "drainResume while switched out. Ignoring\n");
226 return;
227 }
228
229 DPRINTF(Drain, "MinorCPU drainResume\n");
230
231 if (!system->isTimingMode()) {
232 fatal("The Minor CPU requires the memory system to be in "
233 "'timing' mode.\n");
234 }
235
236 wakeup();
237 pipeline->drainResume();
238}
239
240void
241MinorCPU::memWriteback()
242{
243 DPRINTF(Drain, "MinorCPU memWriteback\n");
244}
245

--- 97 unchanged lines hidden ---