Deleted Added
sdiff udiff text old ( 6658:f4de76601762 ) new ( 7064:586b0e3a12b3 )
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;

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

88void
89quiesceNs(ThreadContext *tc, uint64_t ns)
90{
91 if (!tc->getCpuPtr()->params()->do_quiesce || ns == 0)
92 return;
93
94 EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
95
96 Tick resume = curTick + Clock::Int::ns * ns;
97
98 mainEventQueue.reschedule(quiesceEvent, resume, true);
99
100 DPRINTF(Quiesce, "%s: quiesceNs(%d) until %d\n",
101 tc->getCpuPtr()->name(), ns, resume);
102
103 tc->suspend();
104 if (tc->getKernelStats())

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

123 tc->suspend();
124 if (tc->getKernelStats())
125 tc->getKernelStats()->quiesce();
126}
127
128uint64_t
129quiesceTime(ThreadContext *tc)
130{
131 return (tc->readLastActivate() - tc->readLastSuspend()) / Clock::Int::ns;
132}
133
134#endif
135
136uint64_t
137rpns(ThreadContext *tc)
138{
139 return curTick / Clock::Int::ns;
140}
141
142void
143wakeCPU(ThreadContext *tc, uint64_t cpuid)
144{
145 System *sys = tc->getSystemPtr();
146 ThreadContext *other_tc = sys->threadContexts[cpuid];
147 if (other_tc->status() == ThreadContext::Suspended)
148 other_tc->activate();
149}
150
151void
152m5exit(ThreadContext *tc, Tick delay)
153{
154 Tick when = curTick + delay * Clock::Int::ns;
155 Event *event = new SimLoopExitEvent("m5_exit instruction encountered", 0);
156 mainEventQueue.schedule(event, when);
157}
158
159#if FULL_SYSTEM
160
161void
162loadsymbol(ThreadContext *tc)

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

224
225void
226resetstats(ThreadContext *tc, Tick delay, Tick period)
227{
228 if (!tc->getCpuPtr()->params()->do_statistics_insts)
229 return;
230
231
232 Tick when = curTick + delay * Clock::Int::ns;
233 Tick repeat = period * Clock::Int::ns;
234
235 Stats::StatEvent(false, true, when, repeat);
236}
237
238void
239dumpstats(ThreadContext *tc, Tick delay, Tick period)
240{
241 if (!tc->getCpuPtr()->params()->do_statistics_insts)
242 return;
243
244
245 Tick when = curTick + delay * Clock::Int::ns;
246 Tick repeat = period * Clock::Int::ns;
247
248 Stats::StatEvent(true, false, when, repeat);
249}
250
251void
252dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
253{
254 if (!tc->getCpuPtr()->params()->do_statistics_insts)
255 return;
256
257
258 Tick when = curTick + delay * Clock::Int::ns;
259 Tick repeat = period * Clock::Int::ns;
260
261 Stats::StatEvent(true, true, when, repeat);
262}
263
264void
265m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
266{
267 if (!tc->getCpuPtr()->params()->do_checkpoint_insts)
268 return;
269
270 Tick when = curTick + delay * Clock::Int::ns;
271 Tick repeat = period * Clock::Int::ns;
272
273 Event *event = new SimLoopExitEvent("checkpoint", 0, repeat);
274 mainEventQueue.schedule(event, when);
275}
276
277#if FULL_SYSTEM
278
279uint64_t

--- 49 unchanged lines hidden ---