Deleted Added
sdiff udiff text old ( 13180:79e680f62779 ) new ( 13189:057566bc8fd6 )
full compact
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

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

59{
60 protected:
61 Process *process;
62
63 public:
64 Sensitivity(Process *p) : process(p) {}
65 virtual ~Sensitivity() {}
66
67 void satisfy(bool timedOut=false);
68
69 virtual void notifyWork(Event *e) { satisfy(); }
70 void notify(Event *e);
71 void notify() { notify(nullptr); }
72
73 const std::string name();
74};
75
76class SensitivityTimeout : virtual public Sensitivity
77{

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

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); }
137};
138
139class SensitivityTimeoutAndEventAndList :
140 public SensitivityTimeout, public SensitivityEventAndList
141{
142 public:
143 SensitivityTimeoutAndEventAndList(
144 Process *p, ::sc_core::sc_time t,

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

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); }
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.

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

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; }
349
350 protected:
351 Process(const char *name, ProcessFuncWrapper *func, bool internal=false);
352
353 static Process *_newest;
354
355 virtual ~Process()
356 {

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

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
374 bool _needsStart;
375 bool _dynamic;
376 bool _isUnwinding;
377 bool _terminated;
378
379 void terminate();
380
381 bool _suspended;

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

392 PendingSensitivities pendingStaticSensitivities;
393
394 Sensitivity *dynamicSensitivity;
395
396 std::unique_ptr<::sc_core::sc_report> _lastReport;
397};
398
399inline void
400Sensitivity::satisfy(bool timedOut)
401{
402 process->timedOut(timedOut);
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__