From 9190940511b5783811bc6288dd4f22f8d18c9d26 Mon Sep 17 00:00:00 2001
From: Nilay Vaish <nilay@cs.wisc.edu>
Date: Mon, 27 Aug 2012 01:00:55 -0500
Subject: Ruby: Remove RubyEventQueue This patch removes RubyEventQueue.
 Consumer objects now rely on RubySystem or themselves for scheduling events.

---
 src/mem/slicc/ast/AST.py              |  2 +-
 src/mem/slicc/ast/FuncCallExprAST.py  |  4 ++--
 src/mem/slicc/symbols/StateMachine.py | 12 ++++--------
 src/mem/slicc/symbols/Type.py         |  2 +-
 4 files changed, 8 insertions(+), 12 deletions(-)

(limited to 'src/mem/slicc')

diff --git a/src/mem/slicc/ast/AST.py b/src/mem/slicc/ast/AST.py
index b74867114..b99451019 100644
--- a/src/mem/slicc/ast/AST.py
+++ b/src/mem/slicc/ast/AST.py
@@ -56,7 +56,7 @@ class AST(PairContainer):
         code('''
 char c;
 cerr << "Runtime Error at ${{self.location}}, Ruby Time: "
-     << g_eventQueue_ptr->getTime() << ": "
+     << g_system_ptr->getTime() << ": "
      << $message
      << ", PID: " << getpid() << endl
      << "press return to continue." << endl;
diff --git a/src/mem/slicc/ast/FuncCallExprAST.py b/src/mem/slicc/ast/FuncCallExprAST.py
index 3747d0dfd..ab6261de2 100644
--- a/src/mem/slicc/ast/FuncCallExprAST.py
+++ b/src/mem/slicc/ast/FuncCallExprAST.py
@@ -142,7 +142,7 @@ class FuncCallExprAST(ExprAST):
     }
 
     if (result == TransitionResult_ResourceStall) {
-        g_eventQueue_ptr->scheduleEvent(this, 1);
+        scheduleEvent(this, 1);
 
         // Cannot do anything with this transition, go check next doable transition (mostly likely of next port)
     }
@@ -173,7 +173,7 @@ class FuncCallExprAST(ExprAST):
     }
 
     if (result1 == TransitionResult_ResourceStall) {
-        g_eventQueue_ptr->scheduleEvent(this, 1);
+        scheduleEvent(this, 1);
         // Cannot do anything with this transition, go check next
         // doable transition (mostly likely of next port)
     }
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index 39f3a4b43..83ad88e8b 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -1037,7 +1037,7 @@ ${ident}_Controller::wakeup()
             g_system_ptr->getProfiler()->controllerBusy(m_machineID);
 
             // Wakeup in another cycle and try again
-            g_eventQueue_ptr->scheduleEvent(this, 1);
+            scheduleEvent(this, 1);
             break;
         }
 ''')
@@ -1064,7 +1064,6 @@ ${ident}_Controller::wakeup()
         code('''
         break;  // If we got this far, we have nothing left todo
     }
-    // g_eventQueue_ptr->scheduleEvent(this, 1);
 }
 ''')
 
@@ -1126,11 +1125,8 @@ ${ident}_Controller::doTransition(${ident}_Event event,
     ${ident}_State next_state = state;
 
     DPRINTF(RubyGenerated, "%s, Time: %lld, state: %s, event: %s, addr: %s\\n",
-            *this,
-            g_eventQueue_ptr->getTime(),
-            ${ident}_State_to_string(state),
-            ${ident}_Event_to_string(event),
-            addr);
+            *this, g_system_ptr->getTime(), ${ident}_State_to_string(state),
+            ${ident}_Event_to_string(event), addr);
 
     TransitionResult result =
 ''')
@@ -1302,7 +1298,7 @@ if (!checkResourceAvailable(%s_RequestType_%s, addr)) {
       default:
         fatal("Invalid transition\\n"
               "%s time: %d addr: %s event: %s state: %s\\n",
-              name(), g_eventQueue_ptr->getTime(), addr, event, state);
+              name(), g_system_ptr->getTime(), addr, event, state);
     }
     return TransitionResult_Valid;
 }
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py
index ad00f2ac1..42ee8894a 100644
--- a/src/mem/slicc/symbols/Type.py
+++ b/src/mem/slicc/symbols/Type.py
@@ -415,7 +415,7 @@ ${{self.c_ident}}::print(ostream& out) const
             code('out << "${{dm.ident}} = " << m_${{dm.ident}} << " ";''')
 
         if self.isMessage:
-            code('out << "Time = " << getTime() * g_eventQueue_ptr->getClock() << " ";')
+            code('out << "Time = " << getTime() * g_system_ptr->getClock() << " ";')
         code.dedent()
 
         # Trailer
-- 
cgit v1.2.3