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 virtual void notifyWork(Event *e);
68 void notify(Event *e);
69 void notify() { notify(nullptr); }
70
71 const std::string name();
72};
73
74class SensitivityTimeout : virtual public Sensitivity
75{

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

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 {}
133};
134
135class SensitivityTimeoutAndEventAndList :
136 public SensitivityTimeout, public SensitivityEventAndList
137{
138 public:
139 SensitivityTimeoutAndEventAndList(
140 Process *p, ::sc_core::sc_time t,

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

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 {}
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.

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

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; }
341
342 protected:
343 Process(const char *name, ProcessFuncWrapper *func, bool internal=false);
344
345 static Process *_newest;
346
347 virtual ~Process()
348 {

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

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
363 bool _needsStart;
364 bool _dynamic;
365 bool _isUnwinding;
366 bool _terminated;
367
368 void terminate();
369
370 bool _suspended;

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

381 PendingSensitivities pendingStaticSensitivities;
382
383 Sensitivity *dynamicSensitivity;
384
385 std::unique_ptr<::sc_core::sc_report> _lastReport;
386};
387
388inline void
389Sensitivity::notifyWork(Event *e)
390{
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__