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 + SimClock::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()) /
132 SimClock::Int::ns;
133}
134
135#endif
136
137uint64_t
138rpns(ThreadContext *tc)
139{
140 return curTick / SimClock::Int::ns;
141}
142
143void
144wakeCPU(ThreadContext *tc, uint64_t cpuid)
145{
146 System *sys = tc->getSystemPtr();
147 ThreadContext *other_tc = sys->threadContexts[cpuid];
148 if (other_tc->status() == ThreadContext::Suspended)
149 other_tc->activate();
150}
151
152void
153m5exit(ThreadContext *tc, Tick delay)
154{
155 Tick when = curTick + delay * SimClock::Int::ns;
156 Event *event = new SimLoopExitEvent("m5_exit instruction encountered", 0);
157 mainEventQueue.schedule(event, when);
158}
159
160#if FULL_SYSTEM
161
162void
163loadsymbol(ThreadContext *tc)

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

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

--- 49 unchanged lines hidden ---