kernel.cc (12990:19d91b53e04e) kernel.cc (13042:8c1fb556547e)
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

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

49
50bool Kernel::startOfSimulationComplete() { return startComplete; }
51bool Kernel::endOfSimulationComplete() { return endComplete; }
52
53sc_core::sc_status Kernel::status() { return _status; }
54void Kernel::status(sc_core::sc_status s) { _status = s; }
55
56Kernel::Kernel(Params *params) :
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

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

49
50bool Kernel::startOfSimulationComplete() { return startComplete; }
51bool Kernel::endOfSimulationComplete() { return endComplete; }
52
53sc_core::sc_status Kernel::status() { return _status; }
54void Kernel::status(sc_core::sc_status s) { _status = s; }
55
56Kernel::Kernel(Params *params) :
57 SimObject(params), t0Event(this, false, EventBase::Default_Pri - 1) {}
57 SimObject(params), t0Event(this, false, EventBase::Default_Pri - 1)
58{
59 // Install ourselves as the scheduler's event manager.
60 ::sc_gem5::scheduler.setEventQueue(eventQueue());
61}
58
59void
60Kernel::init()
61{
62 status(::sc_core::SC_BEFORE_END_OF_ELABORATION);
63 for (auto m: sc_gem5::allModules)
64 m->sc_mod()->before_end_of_elaboration();
65

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

88 startComplete = true;
89
90 if (stopAfterCallbacks)
91 stopWork();
92
93 kernel->status(::sc_core::SC_RUNNING);
94
95 schedule(t0Event, curTick());
62
63void
64Kernel::init()
65{
66 status(::sc_core::SC_BEFORE_END_OF_ELABORATION);
67 for (auto m: sc_gem5::allModules)
68 m->sc_mod()->before_end_of_elaboration();
69

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

92 startComplete = true;
93
94 if (stopAfterCallbacks)
95 stopWork();
96
97 kernel->status(::sc_core::SC_RUNNING);
98
99 schedule(t0Event, curTick());
96 // Install ourselves as the scheduler's event manager.
97 ::sc_gem5::scheduler.setEventQueue(eventQueue());
98 // Run update once before the event queue starts.
99 ::sc_gem5::scheduler.update();
100}
101
102void
103Kernel::stop()
104{
105 if (status() < ::sc_core::SC_RUNNING)

--- 47 unchanged lines hidden ---
100 // Run update once before the event queue starts.
101 ::sc_gem5::scheduler.update();
102}
103
104void
105Kernel::stop()
106{
107 if (status() < ::sc_core::SC_RUNNING)

--- 47 unchanged lines hidden ---