pseudo_inst.cc (7811:a8fc35183c10) pseudo_inst.cc (7819:afe8476ee9e9)
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;

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

83 tc->suspend();
84 if (tc->getKernelStats())
85 tc->getKernelStats()->quiesce();
86}
87
88void
89quiesceNs(ThreadContext *tc, uint64_t ns)
90{
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;

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

83 tc->suspend();
84 if (tc->getKernelStats())
85 tc->getKernelStats()->quiesce();
86}
87
88void
89quiesceNs(ThreadContext *tc, uint64_t ns)
90{
91 if (!tc->getCpuPtr()->params()->do_quiesce || ns == 0)
91 BaseCPU *cpu = tc->getCpuPtr();
92
93 if (!cpu->params()->do_quiesce || ns == 0)
92 return;
93
94 EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
95
96 Tick resume = curTick + SimClock::Int::ns * ns;
97
94 return;
95
96 EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
97
98 Tick resume = curTick + SimClock::Int::ns * ns;
99
98 mainEventQueue.reschedule(quiesceEvent, resume, true);
100 cpu->reschedule(quiesceEvent, resume, true);
99
100 DPRINTF(Quiesce, "%s: quiesceNs(%d) until %d\n",
101
102 DPRINTF(Quiesce, "%s: quiesceNs(%d) until %d\n",
101 tc->getCpuPtr()->name(), ns, resume);
103 cpu->name(), ns, resume);
102
103 tc->suspend();
104 if (tc->getKernelStats())
105 tc->getKernelStats()->quiesce();
106}
107
108void
109quiesceCycles(ThreadContext *tc, uint64_t cycles)
110{
104
105 tc->suspend();
106 if (tc->getKernelStats())
107 tc->getKernelStats()->quiesce();
108}
109
110void
111quiesceCycles(ThreadContext *tc, uint64_t cycles)
112{
111 if (!tc->getCpuPtr()->params()->do_quiesce || cycles == 0)
113 BaseCPU *cpu = tc->getCpuPtr();
114
115 if (!cpu->params()->do_quiesce || cycles == 0)
112 return;
113
114 EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
115
116 return;
117
118 EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
119
116 Tick resume = curTick + tc->getCpuPtr()->ticks(cycles);
120 Tick resume = curTick + cpu->ticks(cycles);
117
121
118 mainEventQueue.reschedule(quiesceEvent, resume, true);
122 cpu->reschedule(quiesceEvent, resume, true);
119
120 DPRINTF(Quiesce, "%s: quiesceCycles(%d) until %d\n",
123
124 DPRINTF(Quiesce, "%s: quiesceCycles(%d) until %d\n",
121 tc->getCpuPtr()->name(), cycles, resume);
125 cpu->name(), cycles, resume);
122
123 tc->suspend();
124 if (tc->getKernelStats())
125 tc->getKernelStats()->quiesce();
126}
127
128uint64_t
129quiesceTime(ThreadContext *tc)

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

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;
126
127 tc->suspend();
128 if (tc->getKernelStats())
129 tc->getKernelStats()->quiesce();
130}
131
132uint64_t
133quiesceTime(ThreadContext *tc)

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

152 if (other_tc->status() == ThreadContext::Suspended)
153 other_tc->activate();
154}
155
156void
157m5exit(ThreadContext *tc, Tick delay)
158{
159 Tick when = curTick + delay * SimClock::Int::ns;
156 Event *event = new SimLoopExitEvent("m5_exit instruction encountered", 0);
157 mainEventQueue.schedule(event, when);
160 exitSimLoop("m5_exit instruction encountered", 0, when);
158}
159
160#if FULL_SYSTEM
161
162void
163loadsymbol(ThreadContext *tc)
164{
165 const string &filename = tc->getCpuPtr()->system->params()->symbolfile;

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

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
161}
162
163#if FULL_SYSTEM
164
165void
166loadsymbol(ThreadContext *tc)
167{
168 const string &filename = tc->getCpuPtr()->system->params()->symbolfile;

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

269m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
270{
271 if (!tc->getCpuPtr()->params()->do_checkpoint_insts)
272 return;
273
274 Tick when = curTick + delay * SimClock::Int::ns;
275 Tick repeat = period * SimClock::Int::ns;
276
274 Event *event = new SimLoopExitEvent("checkpoint", 0, repeat);
275 mainEventQueue.schedule(event, when);
277 exitSimLoop("checkpoint", 0, when, repeat);
276}
277
278#if FULL_SYSTEM
279
280uint64_t
281readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
282{
283 const string &file = tc->getSystemPtr()->params()->readfile;

--- 46 unchanged lines hidden ---
278}
279
280#if FULL_SYSTEM
281
282uint64_t
283readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
284{
285 const string &file = tc->getSystemPtr()->params()->readfile;

--- 46 unchanged lines hidden ---