diff options
author | Gabe Black <gabeblack@google.com> | 2018-07-16 16:14:33 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-05 06:06:00 +0000 |
commit | f2ab5e7a9e11783da3b9d7338775cf4b5fe2c29c (patch) | |
tree | c8b08f18270cb3131f37b6e0bfe1e8f2e94da63d /src/systemc/core/event.hh | |
parent | d7755ec828868582e2b409ba14f1c8c920c7f184 (diff) | |
download | gem5-f2ab5e7a9e11783da3b9d7338775cf4b5fe2c29c.tar.xz |
systemc: Implement the sensitivity mechanism.
This change lets processes be sensitive to events, timeouts, etc.
Change-Id: If30a256dfa8a2e92192c1f9c96b48e2aa28ec27e
Reviewed-on: https://gem5-review.googlesource.com/11713
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/event.hh')
-rw-r--r-- | src/systemc/core/event.hh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/systemc/core/event.hh b/src/systemc/core/event.hh index bf9afd40f..a9d318382 100644 --- a/src/systemc/core/event.hh +++ b/src/systemc/core/event.hh @@ -30,9 +30,11 @@ #ifndef __SYSTEMC_CORE_EVENT_HH__ #define __SYSTEMC_CORE_EVENT_HH__ +#include <set> #include <string> #include <vector> +#include "sim/eventq.hh" #include "systemc/core/list.hh" #include "systemc/core/object.hh" #include "systemc/ext/core/sc_prim.hh" @@ -50,6 +52,8 @@ namespace sc_gem5 typedef std::vector<sc_core::sc_event *> Events; +class Sensitivity; + class Event { public: @@ -88,6 +92,9 @@ class Event return e->_gem5_event; } + void addSensitivity(Sensitivity *s) const { sensitivities.insert(s); } + void delSensitivity(Sensitivity *s) const { sensitivities.erase(s); } + private: sc_core::sc_event *_sc_event; @@ -97,6 +104,10 @@ class Event sc_core::sc_object *parent; EventsIt parentIt; + + EventWrapper<Event, &Event::notify> delayedNotify; + + mutable std::set<Sensitivity *> sensitivities; }; extern Events topLevelEvents; |