diff options
author | Gabe Black <gabeblack@google.com> | 2018-08-15 23:35:38 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-20 01:50:03 +0000 |
commit | f9298649bb4d1f20b244a6e0930bb82be5ec7397 (patch) | |
tree | 28a7d86e1e7b26313f674407993b56e7306364fc /src/systemc/core/kernel.cc | |
parent | 82958266d412e82c910b2ce35ac2a72e6c9fe358 (diff) | |
download | gem5-f9298649bb4d1f20b244a6e0930bb82be5ec7397.tar.xz |
systemc: Track exports and prim channels, and call their callbacks.
Also call the callbacks on the ports which were already being tracked.
Change-Id: I5ba8ea366e87fc48b58712f35b93c27bccf92cb3
Reviewed-on: https://gem5-review.googlesource.com/12210
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/kernel.cc')
-rw-r--r-- | src/systemc/core/kernel.cc | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/systemc/core/kernel.cc b/src/systemc/core/kernel.cc index 65a444536..84bdfd13f 100644 --- a/src/systemc/core/kernel.cc +++ b/src/systemc/core/kernel.cc @@ -30,6 +30,7 @@ #include "systemc/core/kernel.hh" #include "base/logging.hh" +#include "systemc/core/channel.hh" #include "systemc/core/module.hh" #include "systemc/core/scheduler.hh" @@ -67,8 +68,14 @@ Kernel::init() for (auto m: sc_gem5::allModules) { callbackModule(m); m->sc_mod()->before_end_of_elaboration(); + for (auto p: m->ports) + p->before_end_of_elaboration(); + for (auto e: m->exports) + e->before_end_of_elaboration(); } callbackModule(nullptr); + for (auto c: sc_gem5::allChannels) + c->sc_chan()->before_end_of_elaboration(); if (stopAfterCallbacks) stopWork(); @@ -82,8 +89,15 @@ Kernel::regStats() p->_gem5Finalize(); status(::sc_core::SC_END_OF_ELABORATION); - for (auto m: sc_gem5::allModules) + for (auto m: sc_gem5::allModules) { m->sc_mod()->end_of_elaboration(); + for (auto p: m->ports) + p->end_of_elaboration(); + for (auto e: m->exports) + e->end_of_elaboration(); + } + for (auto c: sc_gem5::allChannels) + c->sc_chan()->end_of_elaboration(); if (stopAfterCallbacks) stopWork(); @@ -93,8 +107,15 @@ void Kernel::startup() { status(::sc_core::SC_START_OF_SIMULATION); - for (auto m: sc_gem5::allModules) + for (auto m: sc_gem5::allModules) { m->sc_mod()->start_of_simulation(); + for (auto p: m->ports) + p->start_of_simulation(); + for (auto e: m->exports) + e->start_of_simulation(); + } + for (auto c: sc_gem5::allChannels) + c->sc_chan()->start_of_simulation(); startComplete = true; @@ -121,8 +142,15 @@ void Kernel::stopWork() { status(::sc_core::SC_END_OF_SIMULATION); - for (auto m: sc_gem5::allModules) + for (auto m: sc_gem5::allModules) { m->sc_mod()->end_of_simulation(); + for (auto p: m->ports) + p->end_of_simulation(); + for (auto e: m->exports) + e->end_of_simulation(); + } + for (auto c: sc_gem5::allChannels) + c->sc_chan()->end_of_simulation(); endComplete = true; |