process.cc (13131:bf07048d69e4) process.cc (13133:41d8cd260825)
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution;
11 * neither the name of the copyright holders nor the names of its
12 * contributors may be used to endorse or promote products derived from
13 * this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * Authors: Gabe Black
28 */
29
30#include "systemc/core/process.hh"
31
32#include "base/logging.hh"
33#include "systemc/core/event.hh"
34#include "systemc/core/scheduler.hh"
35#include "systemc/ext/core/sc_main.hh"
36#include "systemc/ext/core/sc_process_handle.hh"
37#include "systemc/ext/utils/sc_report_handler.hh"
38
39namespace sc_gem5
40{
41
42SensitivityTimeout::SensitivityTimeout(Process *p, ::sc_core::sc_time t) :
43 Sensitivity(p), timeoutEvent([this]() { this->timeout(); })
44{
45 scheduler.schedule(&timeoutEvent, t);
46}
47
48SensitivityTimeout::~SensitivityTimeout()
49{
50 if (timeoutEvent.scheduled())
51 scheduler.deschedule(&timeoutEvent);
52}
53
54void
55SensitivityTimeout::timeout()
56{
57 notify();
58}
59
60SensitivityEvent::SensitivityEvent(
61 Process *p, const ::sc_core::sc_event *e) : Sensitivity(p), event(e)
62{
63 Event::getFromScEvent(event)->addSensitivity(this);
64}
65
66SensitivityEvent::~SensitivityEvent()
67{
68 Event::getFromScEvent(event)->delSensitivity(this);
69}
70
71SensitivityEventAndList::SensitivityEventAndList(
72 Process *p, const ::sc_core::sc_event_and_list *list) :
73 Sensitivity(p), list(list), count(0)
74{
75 for (auto e: list->events)
76 Event::getFromScEvent(e)->addSensitivity(this);
77}
78
79SensitivityEventAndList::~SensitivityEventAndList()
80{
81 for (auto e: list->events)
82 Event::getFromScEvent(e)->delSensitivity(this);
83}
84
85void
86SensitivityEventAndList::notifyWork(Event *e)
87{
88 e->delSensitivity(this);
89 count++;
90 if (count == list->events.size())
91 process->satisfySensitivity(this);
92}
93
94SensitivityEventOrList::SensitivityEventOrList(
95 Process *p, const ::sc_core::sc_event_or_list *list) :
96 Sensitivity(p), list(list)
97{
98 for (auto e: list->events)
99 Event::getFromScEvent(e)->addSensitivity(this);
100}
101
102SensitivityEventOrList::~SensitivityEventOrList()
103{
104 for (auto e: list->events)
105 Event::getFromScEvent(e)->delSensitivity(this);
106}
107
108void
109SensitivityTimeoutAndEventAndList::notifyWork(Event *e)
110{
111 if (e) {
112 // An event went off which must be part of the sc_event_and_list.
113 SensitivityEventAndList::notifyWork(e);
114 } else {
115 // There's no inciting event, so this must be a timeout.
116 SensitivityTimeout::notifyWork(e);
117 }
118}
119
120
121class UnwindExceptionReset : public ::sc_core::sc_unwind_exception
122{
123 public:
124 UnwindExceptionReset() { _isReset = true; }
125};
126
127class UnwindExceptionKill : public ::sc_core::sc_unwind_exception
128{
129 public:
130 UnwindExceptionKill() {}
131};
132
133template <typename T>
134struct BuiltinExceptionWrapper : public ExceptionWrapperBase
135{
136 public:
137 T t;
138 void throw_it() override { throw t; }
139};
140
141BuiltinExceptionWrapper<UnwindExceptionReset> resetException;
142BuiltinExceptionWrapper<UnwindExceptionKill> killException;
143
144
145void
146Process::forEachKid(const std::function<void(Process *)> &work)
147{
148 for (auto &kid: get_child_objects()) {
149 Process *p_kid = dynamic_cast<Process *>(kid);
150 if (p_kid)
151 work(p_kid);
152 }
153}
154
155void
156Process::suspend(bool inc_kids)
157{
158 if (inc_kids)
159 forEachKid([](Process *p) { p->suspend(true); });
160
161 if (!_suspended) {
162 _suspended = true;
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution;
11 * neither the name of the copyright holders nor the names of its
12 * contributors may be used to endorse or promote products derived from
13 * this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * Authors: Gabe Black
28 */
29
30#include "systemc/core/process.hh"
31
32#include "base/logging.hh"
33#include "systemc/core/event.hh"
34#include "systemc/core/scheduler.hh"
35#include "systemc/ext/core/sc_main.hh"
36#include "systemc/ext/core/sc_process_handle.hh"
37#include "systemc/ext/utils/sc_report_handler.hh"
38
39namespace sc_gem5
40{
41
42SensitivityTimeout::SensitivityTimeout(Process *p, ::sc_core::sc_time t) :
43 Sensitivity(p), timeoutEvent([this]() { this->timeout(); })
44{
45 scheduler.schedule(&timeoutEvent, t);
46}
47
48SensitivityTimeout::~SensitivityTimeout()
49{
50 if (timeoutEvent.scheduled())
51 scheduler.deschedule(&timeoutEvent);
52}
53
54void
55SensitivityTimeout::timeout()
56{
57 notify();
58}
59
60SensitivityEvent::SensitivityEvent(
61 Process *p, const ::sc_core::sc_event *e) : Sensitivity(p), event(e)
62{
63 Event::getFromScEvent(event)->addSensitivity(this);
64}
65
66SensitivityEvent::~SensitivityEvent()
67{
68 Event::getFromScEvent(event)->delSensitivity(this);
69}
70
71SensitivityEventAndList::SensitivityEventAndList(
72 Process *p, const ::sc_core::sc_event_and_list *list) :
73 Sensitivity(p), list(list), count(0)
74{
75 for (auto e: list->events)
76 Event::getFromScEvent(e)->addSensitivity(this);
77}
78
79SensitivityEventAndList::~SensitivityEventAndList()
80{
81 for (auto e: list->events)
82 Event::getFromScEvent(e)->delSensitivity(this);
83}
84
85void
86SensitivityEventAndList::notifyWork(Event *e)
87{
88 e->delSensitivity(this);
89 count++;
90 if (count == list->events.size())
91 process->satisfySensitivity(this);
92}
93
94SensitivityEventOrList::SensitivityEventOrList(
95 Process *p, const ::sc_core::sc_event_or_list *list) :
96 Sensitivity(p), list(list)
97{
98 for (auto e: list->events)
99 Event::getFromScEvent(e)->addSensitivity(this);
100}
101
102SensitivityEventOrList::~SensitivityEventOrList()
103{
104 for (auto e: list->events)
105 Event::getFromScEvent(e)->delSensitivity(this);
106}
107
108void
109SensitivityTimeoutAndEventAndList::notifyWork(Event *e)
110{
111 if (e) {
112 // An event went off which must be part of the sc_event_and_list.
113 SensitivityEventAndList::notifyWork(e);
114 } else {
115 // There's no inciting event, so this must be a timeout.
116 SensitivityTimeout::notifyWork(e);
117 }
118}
119
120
121class UnwindExceptionReset : public ::sc_core::sc_unwind_exception
122{
123 public:
124 UnwindExceptionReset() { _isReset = true; }
125};
126
127class UnwindExceptionKill : public ::sc_core::sc_unwind_exception
128{
129 public:
130 UnwindExceptionKill() {}
131};
132
133template <typename T>
134struct BuiltinExceptionWrapper : public ExceptionWrapperBase
135{
136 public:
137 T t;
138 void throw_it() override { throw t; }
139};
140
141BuiltinExceptionWrapper<UnwindExceptionReset> resetException;
142BuiltinExceptionWrapper<UnwindExceptionKill> killException;
143
144
145void
146Process::forEachKid(const std::function<void(Process *)> &work)
147{
148 for (auto &kid: get_child_objects()) {
149 Process *p_kid = dynamic_cast<Process *>(kid);
150 if (p_kid)
151 work(p_kid);
152 }
153}
154
155void
156Process::suspend(bool inc_kids)
157{
158 if (inc_kids)
159 forEachKid([](Process *p) { p->suspend(true); });
160
161 if (!_suspended) {
162 _suspended = true;
163 _suspendedReady = false;
164 }
163 _suspendedReady = scheduler.suspend(this);
165
164
166 if (procKind() != ::sc_core::SC_METHOD_PROC_ &&
167 scheduler.current() == this) {
168 scheduler.yield();
165 if (procKind() != ::sc_core::SC_METHOD_PROC_ &&
166 scheduler.current() == this) {
167 // This isn't in the spec, but Accellera says that a thread that
168 // self suspends should be marked ready immediately when it's
169 // resumed.
170 _suspendedReady = true;
171 scheduler.yield();
172 }
169 }
170}
171
172void
173Process::resume(bool inc_kids)
174{
175 if (inc_kids)
176 forEachKid([](Process *p) { p->resume(true); });
177
178 if (_suspended) {
179 _suspended = false;
180 if (_suspendedReady)
173 }
174}
175
176void
177Process::resume(bool inc_kids)
178{
179 if (inc_kids)
180 forEachKid([](Process *p) { p->resume(true); });
181
182 if (_suspended) {
183 _suspended = false;
184 if (_suspendedReady)
181 ready();
185 scheduler.resume(this);
182 _suspendedReady = false;
183 }
184}
185
186void
187Process::disable(bool inc_kids)
188{
189 if (inc_kids)
190 forEachKid([](Process *p) { p->disable(true); });
191
192 if (!::sc_core::sc_allow_process_control_corners &&
193 dynamic_cast<SensitivityTimeout *>(dynamicSensitivity)) {
194 std::string message("attempt to disable a thread with timeout wait: ");
195 message += name();
196 SC_REPORT_ERROR("Undefined process control interaction",
197 message.c_str());
198 }
199
200 _disabled = true;
201}
202
203void
204Process::enable(bool inc_kids)
205{
206
207 if (inc_kids)
208 forEachKid([](Process *p) { p->enable(true); });
209
210 _disabled = false;
211}
212
213void
214Process::kill(bool inc_kids)
215{
216 if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
217 SC_REPORT_ERROR(
218 "(E572) a process may not be killed before it is initialized",
219 name());
220 }
221
222 // Propogate the kill to our children no matter what happens to us.
223 if (inc_kids)
224 forEachKid([](Process *p) { p->kill(true); });
225
226 // If we're in the middle of unwinding, ignore the kill request.
227 if (_isUnwinding)
228 return;
229
230 // Update our state.
231 terminate();
232 _isUnwinding = true;
233
234 // Make sure this process isn't marked ready
235 popListNode();
236
237 // Inject the kill exception into this process if it's started.
238 if (!_needsStart)
239 injectException(killException);
240}
241
242void
243Process::reset(bool inc_kids)
244{
245 if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
246 SC_REPORT_ERROR(
247 "(E573) a process may not be asynchronously reset while"
248 "the simulation is not running", name());
249 }
250
251 // Propogate the reset to our children no matter what happens to us.
252 if (inc_kids)
253 forEachKid([](Process *p) { p->reset(true); });
254
255 // If we're in the middle of unwinding, ignore the reset request.
256 if (_isUnwinding)
257 return;
258
259
260 if (_needsStart) {
261 scheduler.runNow(this);
262 } else {
263 _isUnwinding = true;
264 injectException(resetException);
265 }
266
267 _resetEvent.notify();
268}
269
270void
271Process::throw_it(ExceptionWrapperBase &exc, bool inc_kids)
272{
273 if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
274 SC_REPORT_ERROR(
275 "(E574) throw_it not allowed unless simulation is running ",
276 name());
277 }
278
279 if (inc_kids)
280 forEachKid([&exc](Process *p) { p->throw_it(exc, true); });
281
282 // Only inject an exception into threads that have started.
283 if (!_needsStart)
284 injectException(exc);
285}
286
287void
288Process::injectException(ExceptionWrapperBase &exc)
289{
290 excWrapper = &exc;
291 scheduler.runNow(this);
292};
293
294void
295Process::syncResetOn(bool inc_kids)
296{
297 if (inc_kids)
298 forEachKid([](Process *p) { p->syncResetOn(true); });
299
300 _syncReset = true;
301}
302
303void
304Process::syncResetOff(bool inc_kids)
305{
306 if (inc_kids)
307 forEachKid([](Process *p) { p->syncResetOff(true); });
308
309 _syncReset = false;
310}
311
312void
313Process::dontInitialize()
314{
315 scheduler.dontInitialize(this);
316}
317
318void
319Process::finalize()
320{
321 for (auto &s: pendingStaticSensitivities) {
322 s->finalize(staticSensitivities);
323 delete s;
324 s = nullptr;
325 }
326 pendingStaticSensitivities.clear();
327};
328
329void
330Process::run()
331{
332 bool reset;
333 do {
334 reset = false;
335 try {
336 func->call();
337 } catch(const ::sc_core::sc_unwind_exception &exc) {
338 reset = exc.is_reset();
339 _isUnwinding = false;
340 }
341 } while (reset);
342 needsStart(true);
343}
344
345void
346Process::addStatic(PendingSensitivity *s)
347{
348 pendingStaticSensitivities.push_back(s);
349}
350
351void
352Process::setDynamic(Sensitivity *s)
353{
354 delete dynamicSensitivity;
355 dynamicSensitivity = s;
356}
357
358void
359Process::satisfySensitivity(Sensitivity *s)
360{
361 // If there's a dynamic sensitivity and this wasn't it, ignore.
362 if (dynamicSensitivity && dynamicSensitivity != s)
363 return;
364
365 setDynamic(nullptr);
366 ready();
367}
368
369void
370Process::ready()
371{
372 if (disabled())
373 return;
374 if (suspended())
375 _suspendedReady = true;
376 else
377 scheduler.ready(this);
378}
379
380void
381Process::lastReport(::sc_core::sc_report *report)
382{
383 if (report) {
384 _lastReport = std::unique_ptr<::sc_core::sc_report>(
385 new ::sc_core::sc_report(*report));
386 } else {
387 _lastReport = nullptr;
388 }
389}
390
391::sc_core::sc_report *Process::lastReport() const { return _lastReport.get(); }
392
393Process::Process(const char *name, ProcessFuncWrapper *func) :
394 ::sc_core::sc_process_b(name), excWrapper(nullptr), func(func),
395 _needsStart(true), _isUnwinding(false), _terminated(false),
396 _suspended(false), _disabled(false), _syncReset(false), refCount(0),
397 stackSize(::Fiber::DefaultStackSize), dynamicSensitivity(nullptr)
398{
399 _dynamic =
400 (::sc_core::sc_get_status() >
401 ::sc_core::SC_BEFORE_END_OF_ELABORATION);
402 _newest = this;
403}
404
405void
406Process::terminate()
407{
408 _terminated = true;
409 _suspendedReady = false;
410 _suspended = false;
411 _syncReset = false;
412 delete dynamicSensitivity;
413 dynamicSensitivity = nullptr;
414 for (auto s: staticSensitivities)
415 delete s;
416 staticSensitivities.clear();
417
418 _terminatedEvent.notify();
419}
420
421Process *Process::_newest;
422
423void
424throw_it_wrapper(Process *p, ExceptionWrapperBase &exc, bool inc_kids)
425{
426 p->throw_it(exc, inc_kids);
427}
428
429} // namespace sc_gem5
186 _suspendedReady = false;
187 }
188}
189
190void
191Process::disable(bool inc_kids)
192{
193 if (inc_kids)
194 forEachKid([](Process *p) { p->disable(true); });
195
196 if (!::sc_core::sc_allow_process_control_corners &&
197 dynamic_cast<SensitivityTimeout *>(dynamicSensitivity)) {
198 std::string message("attempt to disable a thread with timeout wait: ");
199 message += name();
200 SC_REPORT_ERROR("Undefined process control interaction",
201 message.c_str());
202 }
203
204 _disabled = true;
205}
206
207void
208Process::enable(bool inc_kids)
209{
210
211 if (inc_kids)
212 forEachKid([](Process *p) { p->enable(true); });
213
214 _disabled = false;
215}
216
217void
218Process::kill(bool inc_kids)
219{
220 if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
221 SC_REPORT_ERROR(
222 "(E572) a process may not be killed before it is initialized",
223 name());
224 }
225
226 // Propogate the kill to our children no matter what happens to us.
227 if (inc_kids)
228 forEachKid([](Process *p) { p->kill(true); });
229
230 // If we're in the middle of unwinding, ignore the kill request.
231 if (_isUnwinding)
232 return;
233
234 // Update our state.
235 terminate();
236 _isUnwinding = true;
237
238 // Make sure this process isn't marked ready
239 popListNode();
240
241 // Inject the kill exception into this process if it's started.
242 if (!_needsStart)
243 injectException(killException);
244}
245
246void
247Process::reset(bool inc_kids)
248{
249 if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
250 SC_REPORT_ERROR(
251 "(E573) a process may not be asynchronously reset while"
252 "the simulation is not running", name());
253 }
254
255 // Propogate the reset to our children no matter what happens to us.
256 if (inc_kids)
257 forEachKid([](Process *p) { p->reset(true); });
258
259 // If we're in the middle of unwinding, ignore the reset request.
260 if (_isUnwinding)
261 return;
262
263
264 if (_needsStart) {
265 scheduler.runNow(this);
266 } else {
267 _isUnwinding = true;
268 injectException(resetException);
269 }
270
271 _resetEvent.notify();
272}
273
274void
275Process::throw_it(ExceptionWrapperBase &exc, bool inc_kids)
276{
277 if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
278 SC_REPORT_ERROR(
279 "(E574) throw_it not allowed unless simulation is running ",
280 name());
281 }
282
283 if (inc_kids)
284 forEachKid([&exc](Process *p) { p->throw_it(exc, true); });
285
286 // Only inject an exception into threads that have started.
287 if (!_needsStart)
288 injectException(exc);
289}
290
291void
292Process::injectException(ExceptionWrapperBase &exc)
293{
294 excWrapper = &exc;
295 scheduler.runNow(this);
296};
297
298void
299Process::syncResetOn(bool inc_kids)
300{
301 if (inc_kids)
302 forEachKid([](Process *p) { p->syncResetOn(true); });
303
304 _syncReset = true;
305}
306
307void
308Process::syncResetOff(bool inc_kids)
309{
310 if (inc_kids)
311 forEachKid([](Process *p) { p->syncResetOff(true); });
312
313 _syncReset = false;
314}
315
316void
317Process::dontInitialize()
318{
319 scheduler.dontInitialize(this);
320}
321
322void
323Process::finalize()
324{
325 for (auto &s: pendingStaticSensitivities) {
326 s->finalize(staticSensitivities);
327 delete s;
328 s = nullptr;
329 }
330 pendingStaticSensitivities.clear();
331};
332
333void
334Process::run()
335{
336 bool reset;
337 do {
338 reset = false;
339 try {
340 func->call();
341 } catch(const ::sc_core::sc_unwind_exception &exc) {
342 reset = exc.is_reset();
343 _isUnwinding = false;
344 }
345 } while (reset);
346 needsStart(true);
347}
348
349void
350Process::addStatic(PendingSensitivity *s)
351{
352 pendingStaticSensitivities.push_back(s);
353}
354
355void
356Process::setDynamic(Sensitivity *s)
357{
358 delete dynamicSensitivity;
359 dynamicSensitivity = s;
360}
361
362void
363Process::satisfySensitivity(Sensitivity *s)
364{
365 // If there's a dynamic sensitivity and this wasn't it, ignore.
366 if (dynamicSensitivity && dynamicSensitivity != s)
367 return;
368
369 setDynamic(nullptr);
370 ready();
371}
372
373void
374Process::ready()
375{
376 if (disabled())
377 return;
378 if (suspended())
379 _suspendedReady = true;
380 else
381 scheduler.ready(this);
382}
383
384void
385Process::lastReport(::sc_core::sc_report *report)
386{
387 if (report) {
388 _lastReport = std::unique_ptr<::sc_core::sc_report>(
389 new ::sc_core::sc_report(*report));
390 } else {
391 _lastReport = nullptr;
392 }
393}
394
395::sc_core::sc_report *Process::lastReport() const { return _lastReport.get(); }
396
397Process::Process(const char *name, ProcessFuncWrapper *func) :
398 ::sc_core::sc_process_b(name), excWrapper(nullptr), func(func),
399 _needsStart(true), _isUnwinding(false), _terminated(false),
400 _suspended(false), _disabled(false), _syncReset(false), refCount(0),
401 stackSize(::Fiber::DefaultStackSize), dynamicSensitivity(nullptr)
402{
403 _dynamic =
404 (::sc_core::sc_get_status() >
405 ::sc_core::SC_BEFORE_END_OF_ELABORATION);
406 _newest = this;
407}
408
409void
410Process::terminate()
411{
412 _terminated = true;
413 _suspendedReady = false;
414 _suspended = false;
415 _syncReset = false;
416 delete dynamicSensitivity;
417 dynamicSensitivity = nullptr;
418 for (auto s: staticSensitivities)
419 delete s;
420 staticSensitivities.clear();
421
422 _terminatedEvent.notify();
423}
424
425Process *Process::_newest;
426
427void
428throw_it_wrapper(Process *p, ExceptionWrapperBase &exc, bool inc_kids)
429{
430 p->throw_it(exc, inc_kids);
431}
432
433} // namespace sc_gem5