summaryrefslogtreecommitdiff
path: root/src/mem/ruby/eventqueue/RubyEventQueueNode.hh
diff options
context:
space:
mode:
authorTushar Krishna <tushar@csail.mit.edu>2010-03-21 21:22:21 -0700
committerTushar Krishna <tushar@csail.mit.edu>2010-03-21 21:22:21 -0700
commit7c20d5511a7c22b360529f2f8452b7d4d5a9785d (patch)
tree2b70ee38429ab0f95021a29c32a68249486c541a /src/mem/ruby/eventqueue/RubyEventQueueNode.hh
parent103f5a2c94bcf84146d8b373890679a2d8816ae7 (diff)
downloadgem5-7c20d5511a7c22b360529f2f8452b7d4d5a9785d.tar.xz
ruby: Fix multiple wakeups in Ruby Eventqueue
Fix bug in Ruby Event queue to avoid multiple wakeups of same consumer in same cycle
Diffstat (limited to 'src/mem/ruby/eventqueue/RubyEventQueueNode.hh')
-rw-r--r--src/mem/ruby/eventqueue/RubyEventQueueNode.hh11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mem/ruby/eventqueue/RubyEventQueueNode.hh b/src/mem/ruby/eventqueue/RubyEventQueueNode.hh
index dc2fc92e7..46d8b317c 100644
--- a/src/mem/ruby/eventqueue/RubyEventQueueNode.hh
+++ b/src/mem/ruby/eventqueue/RubyEventQueueNode.hh
@@ -45,8 +45,8 @@
class RubyEventQueueNode : public Event {
public:
// Constructors
- RubyEventQueueNode(Consumer* _consumer)
- : m_consumer_ptr(_consumer)
+ RubyEventQueueNode(Consumer* _consumer, RubyEventQueue* _eventq)
+ : m_consumer_ptr(_consumer), m_eventq_ptr(_eventq)
{
setFlags(AutoDelete);
}
@@ -56,7 +56,11 @@ public:
// Public Methods
void print(std::ostream& out) const;
- virtual void process() { m_consumer_ptr->wakeup(); }
+ virtual void process()
+ {
+ m_consumer_ptr->wakeup();
+ m_consumer_ptr->removeScheduledWakeupTime(m_eventq_ptr->getTime());
+ }
virtual const char *description() const { return "Ruby Event"; }
private:
@@ -67,6 +71,7 @@ private:
// Data Members (m_ prefix)
Consumer* m_consumer_ptr;
+ RubyEventQueue* m_eventq_ptr;
};
// Output operator declaration