diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-07 18:25:10 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-09 21:44:00 +0000 |
commit | a4b82a86115649cbe403315bf04231d5c9512015 (patch) | |
tree | 2cd692e0d2f8e179c5b89c3b76ef23415f5d3ac6 /src/systemc/core/module.hh | |
parent | 18ca156d81b7399945fdb11a3a8aee34f05bf92c (diff) | |
download | gem5-a4b82a86115649cbe403315bf04231d5c9512015.tar.xz |
systemc: Centralize module callbacks and report new warnings.
By centralizing module callbacks, the gem5 module class knows when
different stages of the simulation are happening and can do it's own
extra checks. It also compartmentalizes modules more since the kernel
object doesn't have to reach into them to enumerate ports and exports.
Change-Id: I55887284af9c05150fe9d054f5b6147cad6092a1
Reviewed-on: https://gem5-review.googlesource.com/c/12610
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/module.hh')
-rw-r--r-- | src/systemc/core/module.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/systemc/core/module.hh b/src/systemc/core/module.hh index e60018e2b..aa723368a 100644 --- a/src/systemc/core/module.hh +++ b/src/systemc/core/module.hh @@ -74,6 +74,8 @@ class Module const char *_name; sc_core::sc_module *_sc_mod; Object *_obj; + bool _ended; + bool _deprecatedConstructor; UniqueNameGen nameGen; @@ -85,6 +87,8 @@ class Module void finish(Object *this_obj); const char *name() const { return _name; } + void endModule() { _ended = true; } + void deprecatedConstructor() { _deprecatedConstructor = true; } sc_core::sc_module * sc_mod() const @@ -115,6 +119,11 @@ class Module std::vector<::sc_core::sc_port_base *> ports; std::vector<::sc_core::sc_export_base *> exports; + + void beforeEndOfElaboration(); + void endOfElaboration(); + void startOfSimulation(); + void endOfSimulation(); }; Module *currentModule(); |