diff options
author | Gabe Black <gabeblack@google.com> | 2019-02-14 01:42:19 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-02-21 22:34:53 +0000 |
commit | e15e12134e1149a358e9ab28b3b8affbb75f53d0 (patch) | |
tree | c809ec5648e68166cf5c35b2a3267d742184c056 /src/systemc/core | |
parent | a0c0ab8c0776902945e03299e14fdca74404cf39 (diff) | |
download | gem5-e15e12134e1149a358e9ab28b3b8affbb75f53d0.tar.xz |
systemc: Init some values in the scheduler for running without sc_main.
When running without sc_main, sc_start won't be called, and therefore
runToTime and maxTick won't be initialized. To avoid the scheduler
getting confused and behaving erratically, those values should be
initialized to something that makes sense in situations where there's
no sc_main.
Change-Id: I6ddd7db9ecb36d716eb5ef75e1c38bb99a386092
Reviewed-on: https://gem5-review.googlesource.com/c/16443
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core')
-rw-r--r-- | src/systemc/core/scheduler.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc index 4b566ca20..da1dd2d03 100644 --- a/src/systemc/core/scheduler.cc +++ b/src/systemc/core/scheduler.cc @@ -50,9 +50,11 @@ Scheduler::Scheduler() : stopEvent(this, false, StopPriority), _throwUp(nullptr), starvationEvent(this, false, StarvationPriority), _elaborationDone(false), _started(false), _stopNow(false), - _status(StatusOther), maxTickEvent(this, false, MaxTickPriority), + _status(StatusOther), maxTick(::MaxTick), + maxTickEvent(this, false, MaxTickPriority), timeAdvancesEvent(this, false, TimeAdvancesPriority), _numCycles(0), - _changeStamp(0), _current(nullptr), initDone(false), runOnce(false) + _changeStamp(0), _current(nullptr), initDone(false), runToTime(true), + runOnce(false) {} Scheduler::~Scheduler() |