Deleted Added
sdiff udiff text old ( 2654:9559cfa91b9d ) new ( 2665:a124942bacb8 )
full compact
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <iostream>
30#include <string>
31#include <sstream>
32
33#include "base/cprintf.hh"
34#include "base/loader/symtab.hh"

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

41#include "cpu/sampler/sampler.hh"
42#include "sim/param.hh"
43#include "sim/process.hh"
44#include "sim/sim_events.hh"
45#include "sim/system.hh"
46
47#include "base/trace.hh"
48
49using namespace std;
50
51vector<BaseCPU *> BaseCPU::cpuList;
52
53// This variable reflects the max number of threads in any CPU. Be
54// careful to only use it once all the CPUs that you care about have
55// been initialized
56int maxThreadsPerCPU = 1;

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

145 true);
146 e->schedule(p->functionTraceStart);
147 }
148 }
149#if FULL_SYSTEM
150 profileEvent = NULL;
151 if (params->profile)
152 profileEvent = new ProfileEvent(this, params->profile);
153#endif
154
155}
156
157BaseCPU::Params::Params()
158{
159#if FULL_SYSTEM
160 profile = false;
161#endif
162 checker = NULL;
163}
164
165void
166BaseCPU::enableFunctionTrace()
167{
168 functionTracingEnabled = true;
169}
170
171BaseCPU::~BaseCPU()
172{
173}
174
175void
176BaseCPU::init()
177{
178 if (!params->deferRegistration)
179 registerExecContexts();
180}

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

205 stringstream namestr;
206 ccprintf(namestr, "%s.ctx%d", name(), i);
207 execContexts[i]->regStats(namestr.str());
208 }
209 } else if (size == 1)
210 execContexts[0]->regStats(name());
211
212#if FULL_SYSTEM
213#endif
214}
215
216
217void
218BaseCPU::registerExecContexts()
219{
220 for (int i = 0; i < execContexts.size(); ++i) {
221 ExecContext *xc = execContexts[i];
222
223#if FULL_SYSTEM
224 int id = params->cpu_id;
225 if (id != -1)
226 id += i;
227
228 xc->setCpuId(system->registerExecContext(xc, id));
229#else
230 xc->setCpuId(xc->getProcessPtr()->registerExecContext(xc));
231#endif
232 }
233 }
234}
235
236
237void
238BaseCPU::switchOut(Sampler *sampler)
239{
240 panic("This CPU doesn't support sampling!");

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

334}
335
336
337void
338BaseCPU::serialize(std::ostream &os)
339{
340 SERIALIZE_ARRAY(interrupts, TheISA::NumInterruptLevels);
341 SERIALIZE_SCALAR(intstatus);
342}
343
344void
345BaseCPU::unserialize(Checkpoint *cp, const std::string &section)
346{
347 UNSERIALIZE_ARRAY(interrupts, TheISA::NumInterruptLevels);
348 UNSERIALIZE_SCALAR(intstatus);
349}
350
351#endif // FULL_SYSTEM
352
353void
354BaseCPU::traceFunctionsInternal(Addr pc)
355{
356 if (!debugSymbolTable)

--- 25 unchanged lines hidden ---