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
--- 18 unchanged lines hidden (view full) ---
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_process_handle.hh"
36#include "systemc/ext/utils/sc_report_handler.hh"
37
38namespace sc_gem5
39{
40
41SensitivityTimeout::SensitivityTimeout(Process *p, ::sc_core::sc_time t) :
42 Sensitivity(p), timeoutEvent([this]() { this->timeout(); })
--- 164 unchanged lines hidden (view full) ---
207 forEachKid([](Process *p) { p->enable(true); });
208
209 _disabled = false;
210}
211
212void
213Process::kill(bool inc_kids)
214{
215 // Propogate the kill to our children no matter what happens to us.
216 if (inc_kids)
217 forEachKid([](Process *p) { p->kill(true); });
218
219 // If we're in the middle of unwinding, ignore the kill request.
220 if (_isUnwinding)
221 return;
222
--- 7 unchanged lines hidden (view full) ---
230 // Inject the kill exception into this process if it's started.
231 if (!_needsStart)
232 injectException(killException);
233}
234
235void
236Process::reset(bool inc_kids)
237{
238 // Propogate the reset to our children no matter what happens to us.
239 if (inc_kids)
240 forEachKid([](Process *p) { p->reset(true); });
241
242 // If we're in the middle of unwinding, ignore the reset request.
243 if (_isUnwinding)
244 return;
245
--- 6 unchanged lines hidden (view full) ---
252 }
253
254 _resetEvent.notify();
255}
256
257void
258Process::throw_it(ExceptionWrapperBase &exc, bool inc_kids)
259{
260 if (inc_kids)
261 forEachKid([&exc](Process *p) { p->throw_it(exc, true); });
262
263 // Only inject an exception into threads that have started.
264 if (!_needsStart)
265 injectException(exc);
266}
267
--- 141 unchanged lines hidden ---
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
--- 18 unchanged lines hidden (view full) ---
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_process_handle.hh"
36#include "systemc/ext/utils/sc_report_handler.hh"
37
38namespace sc_gem5
39{
40
41SensitivityTimeout::SensitivityTimeout(Process *p, ::sc_core::sc_time t) :
42 Sensitivity(p), timeoutEvent([this]() { this->timeout(); })
--- 164 unchanged lines hidden (view full) ---
207 forEachKid([](Process *p) { p->enable(true); });
208
209 _disabled = false;
210}
211
212void
213Process::kill(bool inc_kids)
214{
215 // Propogate the kill to our children no matter what happens to us.
216 if (inc_kids)
217 forEachKid([](Process *p) { p->kill(true); });
218
219 // If we're in the middle of unwinding, ignore the kill request.
220 if (_isUnwinding)
221 return;
222
--- 7 unchanged lines hidden (view full) ---
230 // Inject the kill exception into this process if it's started.
231 if (!_needsStart)
232 injectException(killException);
233}
234
235void
236Process::reset(bool inc_kids)
237{
238 // Propogate the reset to our children no matter what happens to us.
239 if (inc_kids)
240 forEachKid([](Process *p) { p->reset(true); });
241
242 // If we're in the middle of unwinding, ignore the reset request.
243 if (_isUnwinding)
244 return;
245
--- 6 unchanged lines hidden (view full) ---
252 }
253
254 _resetEvent.notify();
255}
256
257void
258Process::throw_it(ExceptionWrapperBase &exc, bool inc_kids)
259{
260 if (inc_kids)
261 forEachKid([&exc](Process *p) { p->throw_it(exc, true); });
262
263 // Only inject an exception into threads that have started.
264 if (!_needsStart)
265 injectException(exc);
266}
267
--- 141 unchanged lines hidden ---