process.cc (13207:034ca389a810) process.cc (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

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

231{
232 if (inc_kids)
233 forEachKid([](Process *p) { p->syncResetOff(true); });
234
235 _syncReset = false;
236}
237
238void
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

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

231{
232 if (inc_kids)
233 forEachKid([](Process *p) { p->syncResetOff(true); });
234
235 _syncReset = false;
236}
237
238void
239Process::signalReset(bool set, bool sync)
240{
241 if (set) {
242 waitCount(0);
243 if (sync) {
244 syncResetCount++;
245 } else {
246 asyncResetCount++;
247 cancelTimeout();
248 clearDynamic();
249 scheduler.runNext(this);
250 }
251 } else {
252 if (sync)
253 syncResetCount--;
254 else
255 asyncResetCount--;
256 }
257}
258
259void
239Process::run()
240{
241 bool reset;
242 do {
243 reset = false;
244 try {
245 func->call();
246 } catch(ScHalt) {

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

267 if (dynamicSensitivity) {
268 dynamicSensitivity->clear();
269 delete dynamicSensitivity;
270 }
271 dynamicSensitivity = s;
272}
273
274void
260Process::run()
261{
262 bool reset;
263 do {
264 reset = false;
265 try {
266 func->call();
267 } catch(ScHalt) {

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

288 if (dynamicSensitivity) {
289 dynamicSensitivity->clear();
290 delete dynamicSensitivity;
291 }
292 dynamicSensitivity = s;
293}
294
295void
296Process::addReset(ResetSensitivity *s)
297{
298 resetSensitivities.push_back(s);
299}
300
301void
275Process::cancelTimeout()
276{
277 if (timeoutEvent.scheduled())
278 scheduler.deschedule(&timeoutEvent);
279}
280
281void
282Process::setTimeout(::sc_core::sc_time t)

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

297 return;
298
299 ready();
300}
301
302void
303Process::satisfySensitivity(Sensitivity *s)
304{
302Process::cancelTimeout()
303{
304 if (timeoutEvent.scheduled())
305 scheduler.deschedule(&timeoutEvent);
306}
307
308void
309Process::setTimeout(::sc_core::sc_time t)

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

324 return;
325
326 ready();
327}
328
329void
330Process::satisfySensitivity(Sensitivity *s)
331{
332 if (_waitCount) {
333 _waitCount--;
334 return;
335 }
336
305 // If there's a dynamic sensitivity and this wasn't it, ignore.
306 if ((dynamicSensitivity || timeoutEvent.scheduled()) &&
307 dynamicSensitivity != s) {
308 return;
309 }
310
311 _timedOut = false;
312 // This sensitivity should already be cleared by this point, or the event

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

341
342::sc_core::sc_report *Process::lastReport() const { return _lastReport.get(); }
343
344Process::Process(const char *name, ProcessFuncWrapper *func, bool internal) :
345 ::sc_core::sc_process_b(name), excWrapper(nullptr),
346 timeoutEvent([this]() { this->timeout(); }),
347 func(func), _internal(internal), _timedOut(false), _dontInitialize(false),
348 _needsStart(true), _isUnwinding(false), _terminated(false),
337 // If there's a dynamic sensitivity and this wasn't it, ignore.
338 if ((dynamicSensitivity || timeoutEvent.scheduled()) &&
339 dynamicSensitivity != s) {
340 return;
341 }
342
343 _timedOut = false;
344 // This sensitivity should already be cleared by this point, or the event

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

373
374::sc_core::sc_report *Process::lastReport() const { return _lastReport.get(); }
375
376Process::Process(const char *name, ProcessFuncWrapper *func, bool internal) :
377 ::sc_core::sc_process_b(name), excWrapper(nullptr),
378 timeoutEvent([this]() { this->timeout(); }),
379 func(func), _internal(internal), _timedOut(false), _dontInitialize(false),
380 _needsStart(true), _isUnwinding(false), _terminated(false),
349 _suspended(false), _disabled(false), _syncReset(false), refCount(0),
381 _suspended(false), _disabled(false), _syncReset(false), syncResetCount(0),
382 asyncResetCount(0), _waitCount(0), refCount(0),
350 stackSize(::Fiber::DefaultStackSize), dynamicSensitivity(nullptr)
351{
352 _dynamic =
353 (::sc_core::sc_get_status() >
354 ::sc_core::SC_BEFORE_END_OF_ELABORATION);
355 _newest = this;
356}
357

--- 31 unchanged lines hidden ---
383 stackSize(::Fiber::DefaultStackSize), dynamicSensitivity(nullptr)
384{
385 _dynamic =
386 (::sc_core::sc_get_status() >
387 ::sc_core::SC_BEFORE_END_OF_ELABORATION);
388 _newest = this;
389}
390

--- 31 unchanged lines hidden ---