diff options
author | Gabe Black <gabeblack@google.com> | 2018-08-08 01:29:27 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-20 01:41:44 +0000 |
commit | b8aefea27654edb2e37f335914e643c7ae35cd8f (patch) | |
tree | b405fcf1bada44878aa799092c780aec9d8d8cc2 /src/systemc | |
parent | 0ebd72b420eae39fa222fd6e0fd5ce11e0583633 (diff) | |
download | gem5-b8aefea27654edb2e37f335914e643c7ae35cd8f.tar.xz |
systemc: Set the scheduler's event queue earlier.
The kernel can set the event queue during its own construction which
will ensure that the scheduler can schedule events as early as
possible.
Change-Id: I0e47ca0a667e77d36c97860cd7c6b7577415c801
Reviewed-on: https://gem5-review.googlesource.com/12073
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc')
-rw-r--r-- | src/systemc/core/kernel.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/systemc/core/kernel.cc b/src/systemc/core/kernel.cc index 9eed325ec..3e3bdbdde 100644 --- a/src/systemc/core/kernel.cc +++ b/src/systemc/core/kernel.cc @@ -54,7 +54,11 @@ sc_core::sc_status Kernel::status() { return _status; } void Kernel::status(sc_core::sc_status s) { _status = s; } Kernel::Kernel(Params *params) : - SimObject(params), t0Event(this, false, EventBase::Default_Pri - 1) {} + SimObject(params), t0Event(this, false, EventBase::Default_Pri - 1) +{ + // Install ourselves as the scheduler's event manager. + ::sc_gem5::scheduler.setEventQueue(eventQueue()); +} void Kernel::init() @@ -93,8 +97,6 @@ Kernel::startup() kernel->status(::sc_core::SC_RUNNING); schedule(t0Event, curTick()); - // Install ourselves as the scheduler's event manager. - ::sc_gem5::scheduler.setEventQueue(eventQueue()); // Run update once before the event queue starts. ::sc_gem5::scheduler.update(); } |