process.hh (13259:3730df183b84) process.hh (13260:4d18f1d20093)
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

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

82 virtual void throw_it(ExceptionWrapperBase &exc, bool inc_kids);
83
84 void injectException(ExceptionWrapperBase &exc);
85 ExceptionWrapperBase *excWrapper;
86
87 void syncResetOn(bool inc_kids);
88 void syncResetOff(bool inc_kids);
89
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

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

82 virtual void throw_it(ExceptionWrapperBase &exc, bool inc_kids);
83
84 void injectException(ExceptionWrapperBase &exc);
85 ExceptionWrapperBase *excWrapper;
86
87 void syncResetOn(bool inc_kids);
88 void syncResetOff(bool inc_kids);
89
90 void signalReset(bool set, bool sync);
91
90 void incref() { refCount++; }
91 void decref() { refCount--; }
92
93 const ::sc_core::sc_event &resetEvent() { return _resetEvent; }
94 const ::sc_core::sc_event &terminatedEvent() { return _terminatedEvent; }
95
96 void setStackSize(size_t size) { stackSize = size; }
97
98 void run();
99
100 void addStatic(StaticSensitivity *);
101 void setDynamic(DynamicSensitivity *);
102 void clearDynamic() { setDynamic(nullptr); }
92 void incref() { refCount++; }
93 void decref() { refCount--; }
94
95 const ::sc_core::sc_event &resetEvent() { return _resetEvent; }
96 const ::sc_core::sc_event &terminatedEvent() { return _terminatedEvent; }
97
98 void setStackSize(size_t size) { stackSize = size; }
99
100 void run();
101
102 void addStatic(StaticSensitivity *);
103 void setDynamic(DynamicSensitivity *);
104 void clearDynamic() { setDynamic(nullptr); }
105 void addReset(ResetSensitivity *);
103
104 ScEvent timeoutEvent;
105 void setTimeout(::sc_core::sc_time t);
106 void cancelTimeout();
107
108 void satisfySensitivity(Sensitivity *);
109
110 void ready();
111
112 virtual Fiber *fiber() { return Fiber::primaryFiber(); }
113
114 static Process *newest() { return _newest; }
115
116 void lastReport(::sc_core::sc_report *report);
117 ::sc_core::sc_report *lastReport() const;
118
119 bool hasStaticSensitivities() { return !staticSensitivities.empty(); }
120 bool internal() { return _internal; }
121 bool timedOut() { return _timedOut; }
106
107 ScEvent timeoutEvent;
108 void setTimeout(::sc_core::sc_time t);
109 void cancelTimeout();
110
111 void satisfySensitivity(Sensitivity *);
112
113 void ready();
114
115 virtual Fiber *fiber() { return Fiber::primaryFiber(); }
116
117 static Process *newest() { return _newest; }
118
119 void lastReport(::sc_core::sc_report *report);
120 ::sc_core::sc_report *lastReport() const;
121
122 bool hasStaticSensitivities() { return !staticSensitivities.empty(); }
123 bool internal() { return _internal; }
124 bool timedOut() { return _timedOut; }
122 bool syncReset() { return _syncReset; }
125 bool inReset() { return _syncReset || syncResetCount || asyncResetCount; }
123
124 bool dontInitialize() { return _dontInitialize; }
125 void dontInitialize(bool di) { _dontInitialize = di; }
126
127 void joinWait(::sc_core::sc_join *join) { joinWaiters.push_back(join); }
128
126
127 bool dontInitialize() { return _dontInitialize; }
128 void dontInitialize(bool di) { _dontInitialize = di; }
129
130 void joinWait(::sc_core::sc_join *join) { joinWaiters.push_back(join); }
131
132 void waitCount(int count) { _waitCount = count; }
133
129 protected:
130 void timeout();
131
132 Process(const char *name, ProcessFuncWrapper *func, bool internal=false);
133
134 static Process *_newest;
135
136 virtual ~Process()

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

165 void terminate();
166
167 bool _suspended;
168 bool _suspendedReady;
169 bool _disabled;
170
171 bool _syncReset;
172
134 protected:
135 void timeout();
136
137 Process(const char *name, ProcessFuncWrapper *func, bool internal=false);
138
139 static Process *_newest;
140
141 virtual ~Process()

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

170 void terminate();
171
172 bool _suspended;
173 bool _suspendedReady;
174 bool _disabled;
175
176 bool _syncReset;
177
178 int syncResetCount;
179 int asyncResetCount;
180
181 int _waitCount;
182
173 int refCount;
174
175 size_t stackSize;
176
177 StaticSensitivities staticSensitivities;
178 DynamicSensitivity *dynamicSensitivity;
183 int refCount;
184
185 size_t stackSize;
186
187 StaticSensitivities staticSensitivities;
188 DynamicSensitivity *dynamicSensitivity;
189 ResetSensitivities resetSensitivities;
179
180 std::unique_ptr<::sc_core::sc_report> _lastReport;
181
182 std::vector<::sc_core::sc_join *> joinWaiters;
183};
184
185} // namespace sc_gem5
186
187#endif //__SYSTEMC_CORE_PROCESS_HH__
190
191 std::unique_ptr<::sc_core::sc_report> _lastReport;
192
193 std::vector<::sc_core::sc_join *> joinWaiters;
194};
195
196} // namespace sc_gem5
197
198#endif //__SYSTEMC_CORE_PROCESS_HH__