changeset 3137c3d41107 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=3137c3d41107
description:
        ruby: Converted the sequencer deadlock event to m5 eventq

diffstat:

3 files changed, 18 insertions(+), 8 deletions(-)
src/mem/ruby/eventqueue/RubyEventQueue.hh |    1 +
src/mem/ruby/system/Sequencer.cc          |   13 +++++--------
src/mem/ruby/system/Sequencer.hh          |   12 ++++++++++++

diffs (76 lines):

diff -r e07489ad819f -r 3137c3d41107 src/mem/ruby/eventqueue/RubyEventQueue.hh
--- a/src/mem/ruby/eventqueue/RubyEventQueue.hh Fri Jan 29 20:29:19 2010 -0800
+++ b/src/mem/ruby/eventqueue/RubyEventQueue.hh Fri Jan 29 20:29:19 2010 -0800
@@ -79,6 +79,7 @@
   // Public Methods
 
   Time getTime() const { return curTick/m_clock; }
+  Tick getClock() const { return m_clock; }
   void scheduleEvent(Consumer* consumer, Time timeDelta);
   void scheduleEventAbsolute(Consumer* consumer, Time timeAbs);
   void print(ostream& out) const;
diff -r e07489ad819f -r 3137c3d41107 src/mem/ruby/system/Sequencer.cc
--- a/src/mem/ruby/system/Sequencer.cc  Fri Jan 29 20:29:19 2010 -0800
+++ b/src/mem/ruby/system/Sequencer.cc  Fri Jan 29 20:29:19 2010 -0800
@@ -56,14 +56,13 @@
 }
  
 Sequencer::Sequencer(const Params *p)
-    : RubyPort(p)
+    : RubyPort(p), deadlockCheckEvent(this)
 {
     m_store_waiting_on_load_cycles = 0;
     m_store_waiting_on_store_cycles = 0;
     m_load_waiting_on_store_cycles = 0;
     m_load_waiting_on_load_cycles = 0;
     
-    m_deadlock_check_scheduled = false;
     m_outstanding_count = 0;
 
     m_max_outstanding_requests = 0;
@@ -128,9 +127,8 @@
   assert(m_outstanding_count == total_outstanding);
 
   if (m_outstanding_count > 0) { // If there are still outstanding requests, 
keep checking
-    g_eventQueue_ptr->scheduleEvent(this, m_deadlock_threshold);
-  } else {
-    m_deadlock_check_scheduled = false;
+    schedule(deadlockCheckEvent, 
+             (m_deadlock_threshold * g_eventQueue_ptr->getClock()) + curTick);
   }
 }
 
@@ -198,9 +196,8 @@
   assert(m_outstanding_count == total_outstanding);
 
   // See if we should schedule a deadlock check
-  if (m_deadlock_check_scheduled == false) {
-    g_eventQueue_ptr->scheduleEvent(this, m_deadlock_threshold);
-    m_deadlock_check_scheduled = true;
+  if (deadlockCheckEvent.scheduled() == false) {
+    schedule(deadlockCheckEvent, m_deadlock_threshold);
   }
 
   Address line_addr(request->ruby_request.paddr);
diff -r e07489ad819f -r 3137c3d41107 src/mem/ruby/system/Sequencer.hh
--- a/src/mem/ruby/system/Sequencer.hh  Fri Jan 29 20:29:19 2010 -0800
+++ b/src/mem/ruby/system/Sequencer.hh  Fri Jan 29 20:29:19 2010 -0800
@@ -128,6 +128,18 @@
   int m_store_waiting_on_store_cycles;
   int m_load_waiting_on_store_cycles;
   int m_load_waiting_on_load_cycles;
+
+  class SequencerWakeupEvent : public Event
+  {
+      Sequencer *m_sequencer_ptr;
+
+    public:
+      SequencerWakeupEvent(Sequencer *_seq) : m_sequencer_ptr(_seq) {}
+      void process() { m_sequencer_ptr->wakeup(); }
+      const char *description() const { return "Sequencer deadlock check"; }
+  };
+
+  SequencerWakeupEvent deadlockCheckEvent;
 };
 
 // Output operator declaration
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to