summaryrefslogtreecommitdiff
path: root/src/systemc/core/kernel.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/core/kernel.cc')
-rw-r--r--src/systemc/core/kernel.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/systemc/core/kernel.cc b/src/systemc/core/kernel.cc
index 82281c085..e93236541 100644
--- a/src/systemc/core/kernel.cc
+++ b/src/systemc/core/kernel.cc
@@ -33,18 +33,30 @@
namespace SystemC
{
-Kernel::Kernel(Params *params) : SimObject(params), t0Event(this) {}
+Kernel::Kernel(Params *params) :
+ SimObject(params), t0Event(this, false, EventBase::Default_Pri - 1) {}
void
Kernel::startup()
{
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();
}
void
Kernel::t0Handler()
{
- ::sc_gem5::scheduler.initialize();
+ // Now that the event queue has started, mark all the processes that
+ // need to be initialized as ready to run.
+ //
+ // This event has greater priority than delta notifications and so will
+ // happen before them, honoring the ordering for the initialization phase
+ // in the spec. The delta phase will happen at normal priority, and then
+ // the event which runs the processes which is at a lower priority.
+ ::sc_gem5::scheduler.initToReady();
}
} // namespace SystemC