summaryrefslogtreecommitdiff
path: root/src/systemc/ext
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-09-25 23:59:32 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:34:41 +0000
commitfc752d3f3c967557e28f42664b86c18e027e8eec (patch)
treea524f68308f65859c3180adfb0b2356ef74ceffc /src/systemc/ext
parent028e1c56b62b9cab90cbd98dbcb1b5698024b936 (diff)
downloadgem5-fc752d3f3c967557e28f42664b86c18e027e8eec.tar.xz
systemc: Implement sc_event_queue.
Change-Id: I58fd72b8c64ee82eb478d810f7114bab7a31cbfa Reviewed-on: https://gem5-review.googlesource.com/c/13184 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/ext')
-rw-r--r--src/systemc/ext/channel/sc_event_queue.hh14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/systemc/ext/channel/sc_event_queue.hh b/src/systemc/ext/channel/sc_event_queue.hh
index 1cd3c01ab..93a6e258e 100644
--- a/src/systemc/ext/channel/sc_event_queue.hh
+++ b/src/systemc/ext/channel/sc_event_queue.hh
@@ -30,6 +30,9 @@
#ifndef __SYSTEMC_EXT_CHANNEL_SC_EVENT_QUEUE_HH__
#define __SYSTEMC_EXT_CHANNEL_SC_EVENT_QUEUE_HH__
+#include <queue>
+
+#include "../core/sc_event.hh"
#include "../core/sc_interface.hh"
#include "../core/sc_module.hh" // for sc_gen_unique_name
#include "../core/sc_module_name.hh"
@@ -53,17 +56,26 @@ class sc_event_queue_if : public virtual sc_interface
class sc_event_queue : public sc_event_queue_if, public sc_module
{
public:
+ SC_HAS_PROCESS(sc_event_queue);
+
sc_event_queue(sc_module_name name=
sc_module_name(sc_gen_unique_name("event_queue")));
~sc_event_queue();
- virtual const char *kind() const;
+ virtual const char *kind() const { return "sc_event_queue"; }
virtual void notify(double, sc_time_unit);
virtual void notify(const sc_time &);
virtual void cancel_all();
virtual const sc_event &default_event() const;
+
+ private:
+ void _trigger();
+
+ sc_event _defaultEvent;
+ std::priority_queue<
+ sc_time, std::vector<sc_time>, std::greater<sc_time> > _times;
};
// Nonstandard