Deleted Added
sdiff udiff text old ( 5741:323dac95e72c ) new ( 5780:50c9d48de3ca )
full compact
1/*
2 * Copyright (c) 2003-2006 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;

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

45#include "sim/pseudo_inst.hh"
46#include "sim/serialize.hh"
47#include "sim/sim_events.hh"
48#include "sim/sim_exit.hh"
49#include "sim/stat_control.hh"
50#include "sim/stats.hh"
51#include "sim/system.hh"
52#include "sim/debug.hh"
53#include "sim/vptr.hh"
54
55using namespace std;
56
57using namespace Stats;
58using namespace TheISA;
59
60namespace PseudoInst {
61
62void
63arm(ThreadContext *tc)
64{
65 if (tc->getKernelStats())
66 tc->getKernelStats()->arm();
67}
68
69void

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

120}
121
122uint64_t
123quiesceTime(ThreadContext *tc)
124{
125 return (tc->readLastActivate() - tc->readLastSuspend()) / Clock::Int::ns;
126}
127
128uint64_t
129rpns(ThreadContext *tc)
130{
131 return curTick / Clock::Int::ns;
132}
133
134void
135m5exit(ThreadContext *tc, Tick delay)
136{
137 Tick when = curTick + delay * Clock::Int::ns;
138 Event *event = new SimLoopExitEvent("m5_exit instruction encountered", 0);
139 mainEventQueue.schedule(event, when);
140}
141
142void
143loadsymbol(ThreadContext *tc)
144{
145 const string &filename = tc->getCpuPtr()->system->params()->symbolfile;
146 if (filename.empty()) {
147 return;
148 }
149

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

183
184
185 DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
186 }
187 file.close();
188}
189
190void
191resetstats(ThreadContext *tc, Tick delay, Tick period)
192{
193 if (!tc->getCpuPtr()->params()->do_statistics_insts)
194 return;
195
196
197 Tick when = curTick + delay * Clock::Int::ns;
198 Tick repeat = period * Clock::Int::ns;

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

209
210 Tick when = curTick + delay * Clock::Int::ns;
211 Tick repeat = period * Clock::Int::ns;
212
213 Stats::StatEvent(true, false, when, repeat);
214}
215
216void
217addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
218{
219 char symb[100];
220 CopyStringOut(tc, symb, symbolAddr, 100);
221 std::string symbol(symb);
222
223 DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
224
225 tc->getSystemPtr()->kernelSymtab->insert(addr,symbol);
226}
227
228void
229dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
230{
231 if (!tc->getCpuPtr()->params()->do_statistics_insts)
232 return;
233
234
235 Tick when = curTick + delay * Clock::Int::ns;
236 Tick repeat = period * Clock::Int::ns;

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

246
247 Tick when = curTick + delay * Clock::Int::ns;
248 Tick repeat = period * Clock::Int::ns;
249
250 Event *event = new SimLoopExitEvent("checkpoint", 0, repeat);
251 mainEventQueue.schedule(event, when);
252}
253
254uint64_t
255readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
256{
257 const string &file = tc->getSystemPtr()->params()->readfile;
258 if (file.empty()) {
259 return ULL(0);
260 }
261

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

281 }
282
283 close(fd);
284 CopyIn(tc, vaddr, buf, result);
285 delete [] buf;
286 return result;
287}
288
289void
290debugbreak(ThreadContext *tc)
291{
292 debug_break();
293}
294
295void
296switchcpu(ThreadContext *tc)
297{
298 exitSimLoop("switchcpu");
299}
300
301/* namespace PseudoInst */ }