process.hh (13180:79e680f62779) process.hh (13189:057566bc8fd6)
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#ifndef __SYSTEMC_CORE_PROCESS_HH__
31#define __SYSTEMC_CORE_PROCESS_HH__
32
33#include <functional>
34#include <memory>
35#include <vector>
36
37#include "base/fiber.hh"
38#include "sim/eventq.hh"
39#include "systemc/core/bindinfo.hh"
40#include "systemc/core/event.hh"
41#include "systemc/core/list.hh"
42#include "systemc/core/object.hh"
43#include "systemc/core/sched_event.hh"
44#include "systemc/ext/core/sc_event.hh"
45#include "systemc/ext/core/sc_export.hh"
46#include "systemc/ext/core/sc_interface.hh"
47#include "systemc/ext/core/sc_module.hh"
48#include "systemc/ext/core/sc_port.hh"
49#include "systemc/ext/core/sc_process_handle.hh"
50#include "systemc/ext/utils/sc_report.hh"
51
52namespace sc_gem5
53{
54
55class ScHalt
56{};
57
58class Sensitivity
59{
60 protected:
61 Process *process;
62
63 public:
64 Sensitivity(Process *p) : process(p) {}
65 virtual ~Sensitivity() {}
66
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#ifndef __SYSTEMC_CORE_PROCESS_HH__
31#define __SYSTEMC_CORE_PROCESS_HH__
32
33#include <functional>
34#include <memory>
35#include <vector>
36
37#include "base/fiber.hh"
38#include "sim/eventq.hh"
39#include "systemc/core/bindinfo.hh"
40#include "systemc/core/event.hh"
41#include "systemc/core/list.hh"
42#include "systemc/core/object.hh"
43#include "systemc/core/sched_event.hh"
44#include "systemc/ext/core/sc_event.hh"
45#include "systemc/ext/core/sc_export.hh"
46#include "systemc/ext/core/sc_interface.hh"
47#include "systemc/ext/core/sc_module.hh"
48#include "systemc/ext/core/sc_port.hh"
49#include "systemc/ext/core/sc_process_handle.hh"
50#include "systemc/ext/utils/sc_report.hh"
51
52namespace sc_gem5
53{
54
55class ScHalt
56{};
57
58class Sensitivity
59{
60 protected:
61 Process *process;
62
63 public:
64 Sensitivity(Process *p) : process(p) {}
65 virtual ~Sensitivity() {}
66
67 virtual void notifyWork(Event *e);
67 void satisfy(bool timedOut=false);
68
69 virtual void notifyWork(Event *e) { satisfy(); }
68 void notify(Event *e);
69 void notify() { notify(nullptr); }
70
71 const std::string name();
72};
73
74class SensitivityTimeout : virtual public Sensitivity
75{
76 private:
77 void timeout();
78 ScEvent timeoutEvent;
79
80 public:
81 SensitivityTimeout(Process *p, ::sc_core::sc_time t);
82 ~SensitivityTimeout();
83};
84
85class SensitivityEvent : virtual public Sensitivity
86{
87 private:
88 const ::sc_core::sc_event *event;
89
90 public:
91 SensitivityEvent(Process *p, const ::sc_core::sc_event *e);
92 ~SensitivityEvent();
93};
94
95//XXX This sensitivity can't be reused. To reset it, it has to be deleted and
96//recreated. That works for dynamic sensitivities, but not for static.
97//Fortunately processes can't be statically sensitive to sc_event_and_lists.
98class SensitivityEventAndList : virtual public Sensitivity
99{
100 private:
101 const ::sc_core::sc_event_and_list *list;
102 int count;
103
104 public:
105 SensitivityEventAndList(
106 Process *p, const ::sc_core::sc_event_and_list *list);
107 ~SensitivityEventAndList();
108
109 void notifyWork(Event *e) override;
110};
111
112class SensitivityEventOrList : virtual public Sensitivity
113{
114 private:
115 const ::sc_core::sc_event_or_list *list;
116
117 public:
118 SensitivityEventOrList(
119 Process *p, const ::sc_core::sc_event_or_list *list);
120 ~SensitivityEventOrList();
121};
122
123// Combined sensitivities. These trigger when any of their parts do.
124
125class SensitivityTimeoutAndEvent :
126 public SensitivityTimeout, public SensitivityEvent
127{
128 public:
129 SensitivityTimeoutAndEvent(
130 Process *p, ::sc_core::sc_time t, const ::sc_core::sc_event *e) :
131 Sensitivity(p), SensitivityTimeout(p, t), SensitivityEvent(p, e)
132 {}
70 void notify(Event *e);
71 void notify() { notify(nullptr); }
72
73 const std::string name();
74};
75
76class SensitivityTimeout : virtual public Sensitivity
77{
78 private:
79 void timeout();
80 ScEvent timeoutEvent;
81
82 public:
83 SensitivityTimeout(Process *p, ::sc_core::sc_time t);
84 ~SensitivityTimeout();
85};
86
87class SensitivityEvent : virtual public Sensitivity
88{
89 private:
90 const ::sc_core::sc_event *event;
91
92 public:
93 SensitivityEvent(Process *p, const ::sc_core::sc_event *e);
94 ~SensitivityEvent();
95};
96
97//XXX This sensitivity can't be reused. To reset it, it has to be deleted and
98//recreated. That works for dynamic sensitivities, but not for static.
99//Fortunately processes can't be statically sensitive to sc_event_and_lists.
100class SensitivityEventAndList : virtual public Sensitivity
101{
102 private:
103 const ::sc_core::sc_event_and_list *list;
104 int count;
105
106 public:
107 SensitivityEventAndList(
108 Process *p, const ::sc_core::sc_event_and_list *list);
109 ~SensitivityEventAndList();
110
111 void notifyWork(Event *e) override;
112};
113
114class SensitivityEventOrList : virtual public Sensitivity
115{
116 private:
117 const ::sc_core::sc_event_or_list *list;
118
119 public:
120 SensitivityEventOrList(
121 Process *p, const ::sc_core::sc_event_or_list *list);
122 ~SensitivityEventOrList();
123};
124
125// Combined sensitivities. These trigger when any of their parts do.
126
127class SensitivityTimeoutAndEvent :
128 public SensitivityTimeout, public SensitivityEvent
129{
130 public:
131 SensitivityTimeoutAndEvent(
132 Process *p, ::sc_core::sc_time t, const ::sc_core::sc_event *e) :
133 Sensitivity(p), SensitivityTimeout(p, t), SensitivityEvent(p, e)
134 {}
135
136 void notifyWork(Event *e) override { satisfy(e == nullptr); }
133};
134
135class SensitivityTimeoutAndEventAndList :
136 public SensitivityTimeout, public SensitivityEventAndList
137{
138 public:
139 SensitivityTimeoutAndEventAndList(
140 Process *p, ::sc_core::sc_time t,
141 const ::sc_core::sc_event_and_list *eal) :
142 Sensitivity(p), SensitivityTimeout(p, t),
143 SensitivityEventAndList(p, eal)
144 {}
145
146 void notifyWork(Event *e) override;
147};
148
149class SensitivityTimeoutAndEventOrList :
150 public SensitivityTimeout, public SensitivityEventOrList
151{
152 public:
153 SensitivityTimeoutAndEventOrList(
154 Process *p, ::sc_core::sc_time t,
155 const ::sc_core::sc_event_or_list *eol) :
156 Sensitivity(p), SensitivityTimeout(p, t),
157 SensitivityEventOrList(p, eol)
158 {}
137};
138
139class SensitivityTimeoutAndEventAndList :
140 public SensitivityTimeout, public SensitivityEventAndList
141{
142 public:
143 SensitivityTimeoutAndEventAndList(
144 Process *p, ::sc_core::sc_time t,
145 const ::sc_core::sc_event_and_list *eal) :
146 Sensitivity(p), SensitivityTimeout(p, t),
147 SensitivityEventAndList(p, eal)
148 {}
149
150 void notifyWork(Event *e) override;
151};
152
153class SensitivityTimeoutAndEventOrList :
154 public SensitivityTimeout, public SensitivityEventOrList
155{
156 public:
157 SensitivityTimeoutAndEventOrList(
158 Process *p, ::sc_core::sc_time t,
159 const ::sc_core::sc_event_or_list *eol) :
160 Sensitivity(p), SensitivityTimeout(p, t),
161 SensitivityEventOrList(p, eol)
162 {}
163
164 void notifyWork(Event *e) override { satisfy(e == nullptr); }
159};
160
161typedef std::vector<Sensitivity *> Sensitivities;
162
163
164/*
165 * Pending sensitivities. These are records of sensitivities to install later,
166 * once all the information to configure them is available.
167 */
168
169class PendingSensitivity
170{
171 protected:
172 Process *process;
173
174 public:
175 virtual void finalize(Sensitivities &s) = 0;
176 PendingSensitivity(Process *p) : process(p) {}
177 virtual ~PendingSensitivity() {}
178};
179
180class PendingSensitivityEvent : public PendingSensitivity
181{
182 private:
183 const sc_core::sc_event *event;
184
185 public:
186 PendingSensitivityEvent(Process *p, const sc_core::sc_event *e) :
187 PendingSensitivity(p), event(e) {}
188
189 void
190 finalize(Sensitivities &s) override
191 {
192 s.push_back(new SensitivityEvent(process, event));
193 }
194};
195
196class PendingSensitivityInterface : public PendingSensitivity
197{
198 private:
199 const sc_core::sc_interface *interface;
200
201 public:
202 PendingSensitivityInterface(Process *p, const sc_core::sc_interface *i) :
203 PendingSensitivity(p), interface(i)
204 {}
205
206 void
207 finalize(Sensitivities &s) override
208 {
209 s.push_back(new SensitivityEvent(process,
210 &interface->default_event()));
211 }
212};
213
214class PendingSensitivityPort : public PendingSensitivity
215{
216 private:
217 const sc_core::sc_port_base *port;
218
219 public:
220 PendingSensitivityPort(Process *p, const sc_core::sc_port_base *pb) :
221 PendingSensitivity(p), port(pb)
222 {}
223
224 void
225 finalize(Sensitivities &s) override
226 {
227 for (int i = 0; i < port->size(); i++) {
228 const ::sc_core::sc_event *e =
229 &port->_gem5Interface(i)->default_event();
230 s.push_back(new SensitivityEvent(process, e));
231 }
232 }
233};
234
235class PendingSensitivityExport : public PendingSensitivity
236{
237 private:
238 const sc_core::sc_export_base *exp;
239
240 public:
241 PendingSensitivityExport(Process *p, const sc_core::sc_export_base *exp) :
242 PendingSensitivity(p), exp(exp)
243 {}
244
245 void
246 finalize(Sensitivities &s) override
247 {
248 s.push_back(new SensitivityEvent(process,
249 &exp->get_interface()->default_event()));
250 }
251};
252
253class PendingSensitivityFinder : public PendingSensitivity
254{
255 private:
256 const sc_core::sc_event_finder *finder;
257
258 public:
259 PendingSensitivityFinder(Process *p, const sc_core::sc_event_finder *f) :
260 PendingSensitivity(p), finder(f)
261 {}
262
263 void
264 finalize(Sensitivities &s) override
265 {
266 const ::sc_core::sc_port_base *port = finder->port();
267 int size = port->size();
268 for (int i = 0; i < size; i++) {
269 ::sc_core::sc_interface *interface = port->_gem5Interface(i);
270 const ::sc_core::sc_event *event = &finder->find_event(interface);
271 s.push_back(new SensitivityEvent(process, event));
272 }
273 }
274};
275
276typedef std::vector<PendingSensitivity *> PendingSensitivities;
277
278
279class Process : public ::sc_core::sc_process_b, public ListNode
280{
281 public:
282 virtual ::sc_core::sc_curr_proc_kind procKind() const = 0;
283 bool needsStart() const { return _needsStart; }
284 void needsStart(bool ns) { _needsStart = ns; }
285 bool dynamic() const { return _dynamic; }
286 bool isUnwinding() const { return _isUnwinding; }
287 void isUnwinding(bool v) { _isUnwinding = v; }
288 bool terminated() const { return _terminated; }
289
290 void forEachKid(const std::function<void(Process *)> &work);
291
292 bool suspended() const { return _suspended; }
293 bool disabled() const { return _disabled; }
294
295 void suspend(bool inc_kids);
296 void resume(bool inc_kids);
297 void disable(bool inc_kids);
298 void enable(bool inc_kids);
299
300 void kill(bool inc_kids);
301 void reset(bool inc_kids);
302 virtual void throw_it(ExceptionWrapperBase &exc, bool inc_kids);
303
304 void injectException(ExceptionWrapperBase &exc);
305 ExceptionWrapperBase *excWrapper;
306
307 void syncResetOn(bool inc_kids);
308 void syncResetOff(bool inc_kids);
309
310 void incref() { refCount++; }
311 void decref() { refCount--; }
312
313 const ::sc_core::sc_event &resetEvent() { return _resetEvent; }
314 const ::sc_core::sc_event &terminatedEvent() { return _terminatedEvent; }
315
316 // This should only be called before initialization.
317 void dontInitialize();
318
319 void setStackSize(size_t size) { stackSize = size; }
320
321 void finalize();
322
323 void run();
324
325 void addStatic(PendingSensitivity *);
326 void setDynamic(Sensitivity *);
327
328 void satisfySensitivity(Sensitivity *);
329
330 void ready();
331
332 virtual Fiber *fiber() { return Fiber::primaryFiber(); }
333
334 static Process *newest() { return _newest; }
335
336 void lastReport(::sc_core::sc_report *report);
337 ::sc_core::sc_report *lastReport() const;
338
339 bool hasStaticSensitivities() { return !staticSensitivities.empty(); }
340 bool internal() { return _internal; }
165};
166
167typedef std::vector<Sensitivity *> Sensitivities;
168
169
170/*
171 * Pending sensitivities. These are records of sensitivities to install later,
172 * once all the information to configure them is available.
173 */
174
175class PendingSensitivity
176{
177 protected:
178 Process *process;
179
180 public:
181 virtual void finalize(Sensitivities &s) = 0;
182 PendingSensitivity(Process *p) : process(p) {}
183 virtual ~PendingSensitivity() {}
184};
185
186class PendingSensitivityEvent : public PendingSensitivity
187{
188 private:
189 const sc_core::sc_event *event;
190
191 public:
192 PendingSensitivityEvent(Process *p, const sc_core::sc_event *e) :
193 PendingSensitivity(p), event(e) {}
194
195 void
196 finalize(Sensitivities &s) override
197 {
198 s.push_back(new SensitivityEvent(process, event));
199 }
200};
201
202class PendingSensitivityInterface : public PendingSensitivity
203{
204 private:
205 const sc_core::sc_interface *interface;
206
207 public:
208 PendingSensitivityInterface(Process *p, const sc_core::sc_interface *i) :
209 PendingSensitivity(p), interface(i)
210 {}
211
212 void
213 finalize(Sensitivities &s) override
214 {
215 s.push_back(new SensitivityEvent(process,
216 &interface->default_event()));
217 }
218};
219
220class PendingSensitivityPort : public PendingSensitivity
221{
222 private:
223 const sc_core::sc_port_base *port;
224
225 public:
226 PendingSensitivityPort(Process *p, const sc_core::sc_port_base *pb) :
227 PendingSensitivity(p), port(pb)
228 {}
229
230 void
231 finalize(Sensitivities &s) override
232 {
233 for (int i = 0; i < port->size(); i++) {
234 const ::sc_core::sc_event *e =
235 &port->_gem5Interface(i)->default_event();
236 s.push_back(new SensitivityEvent(process, e));
237 }
238 }
239};
240
241class PendingSensitivityExport : public PendingSensitivity
242{
243 private:
244 const sc_core::sc_export_base *exp;
245
246 public:
247 PendingSensitivityExport(Process *p, const sc_core::sc_export_base *exp) :
248 PendingSensitivity(p), exp(exp)
249 {}
250
251 void
252 finalize(Sensitivities &s) override
253 {
254 s.push_back(new SensitivityEvent(process,
255 &exp->get_interface()->default_event()));
256 }
257};
258
259class PendingSensitivityFinder : public PendingSensitivity
260{
261 private:
262 const sc_core::sc_event_finder *finder;
263
264 public:
265 PendingSensitivityFinder(Process *p, const sc_core::sc_event_finder *f) :
266 PendingSensitivity(p), finder(f)
267 {}
268
269 void
270 finalize(Sensitivities &s) override
271 {
272 const ::sc_core::sc_port_base *port = finder->port();
273 int size = port->size();
274 for (int i = 0; i < size; i++) {
275 ::sc_core::sc_interface *interface = port->_gem5Interface(i);
276 const ::sc_core::sc_event *event = &finder->find_event(interface);
277 s.push_back(new SensitivityEvent(process, event));
278 }
279 }
280};
281
282typedef std::vector<PendingSensitivity *> PendingSensitivities;
283
284
285class Process : public ::sc_core::sc_process_b, public ListNode
286{
287 public:
288 virtual ::sc_core::sc_curr_proc_kind procKind() const = 0;
289 bool needsStart() const { return _needsStart; }
290 void needsStart(bool ns) { _needsStart = ns; }
291 bool dynamic() const { return _dynamic; }
292 bool isUnwinding() const { return _isUnwinding; }
293 void isUnwinding(bool v) { _isUnwinding = v; }
294 bool terminated() const { return _terminated; }
295
296 void forEachKid(const std::function<void(Process *)> &work);
297
298 bool suspended() const { return _suspended; }
299 bool disabled() const { return _disabled; }
300
301 void suspend(bool inc_kids);
302 void resume(bool inc_kids);
303 void disable(bool inc_kids);
304 void enable(bool inc_kids);
305
306 void kill(bool inc_kids);
307 void reset(bool inc_kids);
308 virtual void throw_it(ExceptionWrapperBase &exc, bool inc_kids);
309
310 void injectException(ExceptionWrapperBase &exc);
311 ExceptionWrapperBase *excWrapper;
312
313 void syncResetOn(bool inc_kids);
314 void syncResetOff(bool inc_kids);
315
316 void incref() { refCount++; }
317 void decref() { refCount--; }
318
319 const ::sc_core::sc_event &resetEvent() { return _resetEvent; }
320 const ::sc_core::sc_event &terminatedEvent() { return _terminatedEvent; }
321
322 // This should only be called before initialization.
323 void dontInitialize();
324
325 void setStackSize(size_t size) { stackSize = size; }
326
327 void finalize();
328
329 void run();
330
331 void addStatic(PendingSensitivity *);
332 void setDynamic(Sensitivity *);
333
334 void satisfySensitivity(Sensitivity *);
335
336 void ready();
337
338 virtual Fiber *fiber() { return Fiber::primaryFiber(); }
339
340 static Process *newest() { return _newest; }
341
342 void lastReport(::sc_core::sc_report *report);
343 ::sc_core::sc_report *lastReport() const;
344
345 bool hasStaticSensitivities() { return !staticSensitivities.empty(); }
346 bool internal() { return _internal; }
347 bool timedOut() { return _timedOut; }
348 void timedOut(bool to) { _timedOut = to; }
341
342 protected:
343 Process(const char *name, ProcessFuncWrapper *func, bool internal=false);
344
345 static Process *_newest;
346
347 virtual ~Process()
348 {
349 popListNode();
350 delete func;
351 for (auto s: staticSensitivities)
352 delete s;
353 }
354
355 ::sc_core::sc_event _resetEvent;
356 ::sc_core::sc_event _terminatedEvent;
357
358 ProcessFuncWrapper *func;
359 sc_core::sc_curr_proc_kind _procKind;
360
361 bool _internal;
362
349
350 protected:
351 Process(const char *name, ProcessFuncWrapper *func, bool internal=false);
352
353 static Process *_newest;
354
355 virtual ~Process()
356 {
357 popListNode();
358 delete func;
359 for (auto s: staticSensitivities)
360 delete s;
361 }
362
363 ::sc_core::sc_event _resetEvent;
364 ::sc_core::sc_event _terminatedEvent;
365
366 ProcessFuncWrapper *func;
367 sc_core::sc_curr_proc_kind _procKind;
368
369 bool _internal;
370
371 // Needed to support the deprecated "timed_out" function.
372 bool _timedOut;
373
363 bool _needsStart;
364 bool _dynamic;
365 bool _isUnwinding;
366 bool _terminated;
367
368 void terminate();
369
370 bool _suspended;
371 bool _suspendedReady;
372 bool _disabled;
373
374 bool _syncReset;
375
376 int refCount;
377
378 size_t stackSize;
379
380 Sensitivities staticSensitivities;
381 PendingSensitivities pendingStaticSensitivities;
382
383 Sensitivity *dynamicSensitivity;
384
385 std::unique_ptr<::sc_core::sc_report> _lastReport;
386};
387
388inline void
374 bool _needsStart;
375 bool _dynamic;
376 bool _isUnwinding;
377 bool _terminated;
378
379 void terminate();
380
381 bool _suspended;
382 bool _suspendedReady;
383 bool _disabled;
384
385 bool _syncReset;
386
387 int refCount;
388
389 size_t stackSize;
390
391 Sensitivities staticSensitivities;
392 PendingSensitivities pendingStaticSensitivities;
393
394 Sensitivity *dynamicSensitivity;
395
396 std::unique_ptr<::sc_core::sc_report> _lastReport;
397};
398
399inline void
389Sensitivity::notifyWork(Event *e)
400Sensitivity::satisfy(bool timedOut)
390{
401{
402 process->timedOut(timedOut);
391 process->satisfySensitivity(this);
392}
393
394inline void
395Sensitivity::notify(Event *e)
396{
397 if (!process->disabled())
398 notifyWork(e);
399}
400
401inline const std::string
402Sensitivity::name()
403{
404 return std::string(process->name()) + ".timeout";
405}
406
407} // namespace sc_gem5
408
409#endif //__SYSTEMC_CORE_PROCESS_HH__
403 process->satisfySensitivity(this);
404}
405
406inline void
407Sensitivity::notify(Event *e)
408{
409 if (!process->disabled())
410 notifyWork(e);
411}
412
413inline const std::string
414Sensitivity::name()
415{
416 return std::string(process->name()) + ".timeout";
417}
418
419} // namespace sc_gem5
420
421#endif //__SYSTEMC_CORE_PROCESS_HH__