From b8aefea27654edb2e37f335914e643c7ae35cd8f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 8 Aug 2018 01:29:27 -0700 Subject: [PATCH] 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 Maintainer: Gabe Black --- src/systemc/core/kernel.cc | 8 +++++--- 1 file 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(); } -- 2.30.2