diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2010-01-29 20:29:19 -0800 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2010-01-29 20:29:19 -0800 |
commit | e15abd17f92db574dfcbf3798f6352712f897ebc (patch) | |
tree | 67fe9c3b3c470c4c27837d7cfcc16e03be8f6015 /src/mem/ruby/eventqueue/RubyEventQueueNode.hh | |
parent | 63a60cc81ecd94d1a5ea4edb2a1c90de0e9eda80 (diff) | |
download | gem5-e15abd17f92db574dfcbf3798f6352712f897ebc.tar.xz |
ruby: Wrapped ruby events into m5 events
Wrapped ruby events using the m5 event object. Removed the prio_heap
from ruby's event queue and instead schedule ruby events on the m5 event
queue.
Diffstat (limited to 'src/mem/ruby/eventqueue/RubyEventQueueNode.hh')
-rw-r--r-- | src/mem/ruby/eventqueue/RubyEventQueueNode.hh | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/src/mem/ruby/eventqueue/RubyEventQueueNode.hh b/src/mem/ruby/eventqueue/RubyEventQueueNode.hh index fa66ab9a6..3b0c23162 100644 --- a/src/mem/ruby/eventqueue/RubyEventQueueNode.hh +++ b/src/mem/ruby/eventqueue/RubyEventQueueNode.hh @@ -36,31 +36,27 @@ #define RUBYEVENTQUEUENODE_H #include "mem/ruby/common/Global.hh" -class Consumer; +#include "sim/eventq.hh" +#include "mem/ruby/common/Consumer.hh" +//class Consumer; -class RubyEventQueueNode { +class RubyEventQueueNode : public Event { public: // Constructors - RubyEventQueueNode() { m_time = 0; m_consumer_ptr = NULL; } + RubyEventQueueNode(Consumer* _consumer) + : m_consumer_ptr(_consumer) + { + setFlags(AutoDelete); + } // Destructor //~RubyEventQueueNode(); // Public Methods void print(ostream& out) const; + virtual void process() { m_consumer_ptr->wakeup(); } + virtual const char *description() const { return "Ruby Event"; } - // Assignment operator and copy constructor since the default - // constructors confuse purify when long longs are present. - RubyEventQueueNode& operator=(const RubyEventQueueNode& obj) { - m_time = obj.m_time; - m_consumer_ptr = obj.m_consumer_ptr; - return *this; - } - - RubyEventQueueNode(const RubyEventQueueNode& obj) { - m_time = obj.m_time; - m_consumer_ptr = obj.m_consumer_ptr; - } private: // Private Methods @@ -68,8 +64,6 @@ private: // RubyEventQueueNode(const RubyEventQueueNode& obj); // Data Members (m_ prefix) -public: - Time m_time; Consumer* m_consumer_ptr; }; @@ -78,14 +72,6 @@ ostream& operator<<(ostream& out, const RubyEventQueueNode& obj); // ******************* Definitions ******************* -inline extern bool node_less_then_eq(const RubyEventQueueNode& n1, const RubyEventQueueNode& n2); - -inline extern -bool node_less_then_eq(const RubyEventQueueNode& n1, const RubyEventQueueNode& n2) -{ - return (n1.m_time <= n2.m_time); -} - // Output operator definition extern inline ostream& operator<<(ostream& out, const RubyEventQueueNode& obj) |