ruby: message buffer: drop dequeue_getDelayCycles()
authorNilay Vaish <nilay@cs.wisc.edu>
Fri, 23 May 2014 11:07:02 +0000 (06:07 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Fri, 23 May 2014 11:07:02 +0000 (06:07 -0500)
The functionality of updating and returning the delay cycles would now be
performed by the dequeue() function itself.

src/mem/protocol/MESI_Three_Level-L0cache.sm
src/mem/protocol/MESI_Three_Level-L1cache.sm
src/mem/protocol/MESI_Two_Level-L1cache.sm
src/mem/protocol/MESI_Two_Level-L2cache.sm
src/mem/protocol/MI_example-cache.sm
src/mem/protocol/RubySlicc_Types.sm
src/mem/ruby/buffers/MessageBuffer.cc
src/mem/ruby/buffers/MessageBuffer.hh
src/mem/ruby/network/simple/PerfectSwitch.cc
src/mem/ruby/network/simple/Throttle.cc
src/mem/slicc/ast/ExprStatementAST.py

index fd1b85e0dcebf3ef3149c185890cfa780b5d9f72..47a41b83abe409e2e1fe50591b307d1a495012a3 100644 (file)
@@ -474,12 +474,12 @@ machine(L0Cache, "MESI Directory L0 Cache")
 
   action(l_popRequestQueue, "l",
          desc="Pop incoming request queue and profile the delay within this virtual network") {
-    profileMsgDelay(2, messgeBuffer_in.dequeue_getDelayCycles());
+    profileMsgDelay(2, messgeBuffer_in.dequeue());
   }
 
   action(o_popIncomingResponseQueue, "o",
          desc="Pop Incoming Response queue and profile the delay within this virtual network") {
-    profileMsgDelay(1, messgeBuffer_in.dequeue_getDelayCycles());
+    profileMsgDelay(1, messgeBuffer_in.dequeue());
   }
 
   action(s_deallocateTBE, "s", desc="Deallocate TBE") {
index 43a9a49cf33a10a69d5fa79c9c9c5768e0da0d4a..36068dbacdd45cece26bac2de94f79656c4b49b1 100644 (file)
@@ -640,12 +640,12 @@ machine(L1Cache, "MESI Directory L1 Cache CMP")
 
   action(l_popL2RequestQueue, "l",
          desc="Pop incoming request queue and profile the delay within this virtual network") {
-    profileMsgDelay(2, requestNetwork_in.dequeue_getDelayCycles());
+    profileMsgDelay(2, requestNetwork_in.dequeue());
   }
 
   action(o_popL2ResponseQueue, "o",
          desc="Pop Incoming Response queue and profile the delay within this virtual network") {
-    profileMsgDelay(1, responseNetwork_in.dequeue_getDelayCycles());
+    profileMsgDelay(1, responseNetwork_in.dequeue());
   }
 
   action(s_deallocateTBE, "s", desc="Deallocate TBE") {
index 5ccd453bf4050d6fa28df9a545f38aed23ec1b56..a202a8debd5a9046d1aeb5050d46417fff3efe82 100644 (file)
@@ -833,12 +833,14 @@ machine(L1Cache, "MESI Directory L1 Cache CMP")
     mandatoryQueue_in.dequeue();
   }
 
-  action(l_popRequestQueue, "l", desc="Pop incoming request queue and profile the delay within this virtual network") {
-    profileMsgDelay(2, requestL1Network_in.dequeue_getDelayCycles());
+  action(l_popRequestQueue, "l",
+    desc="Pop incoming request queue and profile the delay within this virtual network") {
+    profileMsgDelay(2, requestL1Network_in.dequeue());
   }
 
-  action(o_popIncomingResponseQueue, "o", desc="Pop Incoming Response queue and profile the delay within this virtual network") {
-    profileMsgDelay(1, responseL1Network_in.dequeue_getDelayCycles());
+  action(o_popIncomingResponseQueue, "o",
+    desc="Pop Incoming Response queue and profile the delay within this virtual network") {
+    profileMsgDelay(1, responseL1Network_in.dequeue());
   }
 
   action(s_deallocateTBE, "s", desc="Deallocate TBE") {
index 7cd5560fcd60f0464226fc65057fef0e6ae9d646..f69eaa9a9df78012c113d30c25a73c7f00e00b71 100644 (file)
@@ -590,15 +590,15 @@ machine(L2Cache, "MESI Directory L2 Cache CMP")
   }
 
   action(jj_popL1RequestQueue, "\j", desc="Pop incoming L1 request queue") {
-    profileMsgDelay(0, L1RequestL2Network_in.dequeue_getDelayCycles());
+    profileMsgDelay(0, L1RequestL2Network_in.dequeue());
   }
 
   action(k_popUnblockQueue, "k", desc="Pop incoming unblock queue") {
-    profileMsgDelay(0, L1unblockNetwork_in.dequeue_getDelayCycles());
+    profileMsgDelay(0, L1unblockNetwork_in.dequeue());
   }
 
   action(o_popIncomingResponseQueue, "o", desc="Pop Incoming Response queue") {
-    profileMsgDelay(1, responseL2Network_in.dequeue_getDelayCycles());
+    profileMsgDelay(1, responseL2Network_in.dequeue());
   }
 
   action(m_writeDataToCache, "m", desc="Write data from response queue to cache") {
index 29cf8d482f3c3d8b27243ac896465436a727b239..561de239716e42666b943ac835a3f80ac31b4847 100644 (file)
@@ -317,11 +317,11 @@ machine(L1Cache, "MI Example L1 Cache")
   }
 
   action(n_popResponseQueue, "n", desc="Pop the response queue") {
-    profileMsgDelay(1, responseNetwork_in.dequeue_getDelayCycles());
+    profileMsgDelay(1, responseNetwork_in.dequeue());
   }
 
   action(o_popForwardedRequestQueue, "o", desc="Pop the forwarded request queue") {
-    profileMsgDelay(2, forwardRequestNetwork_in.dequeue_getDelayCycles());
+    profileMsgDelay(2, forwardRequestNetwork_in.dequeue());
   }
 
   action(p_profileMiss, "pi", desc="Profile cache miss") {
index a601b2cfc1376ab335ee669c7db647f4a383db4f..789595dbe2297d56832212793be6573d1c556208 100644 (file)
@@ -41,8 +41,7 @@ external_type(Scalar, primitive="yes");
 
 structure(InPort, external = "yes", primitive="yes") {
   bool isReady();
-  void dequeue();
-  Cycles dequeue_getDelayCycles();
+  Cycles dequeue();
   void recycle();
   bool isEmpty();
 }
index 19ad9ee7d1425a9f88008aa6811b129dc2b833aa..298fdb3c3b74905a70b23a8b648126f55f307203 100644 (file)
@@ -220,8 +220,11 @@ MessageBuffer::enqueue(MsgPtr message, Cycles delta)
 }
 
 Cycles
-MessageBuffer::dequeue_getDelayCycles()
+MessageBuffer::dequeue()
 {
+    DPRINTF(RubyQueue, "Popping\n");
+    assert(isReady());
+
     // get MsgPtr of the message about to be dequeued
     MsgPtr message = m_prio_heap.front().m_msgptr;
 
@@ -229,16 +232,6 @@ MessageBuffer::dequeue_getDelayCycles()
     message->updateDelayedTicks(m_receiver->clockEdge());
     Cycles delayCycles =
         m_receiver->ticksToCycles(message->getDelayedTicks());
-    dequeue();
-
-    return delayCycles;
-}
-
-void
-MessageBuffer::dequeue()
-{
-    DPRINTF(RubyQueue, "Popping\n");
-    assert(isReady());
 
     // record previous size and time so the current buffer size isn't
     // adjusted until next cycle
@@ -250,6 +243,8 @@ MessageBuffer::dequeue()
     pop_heap(m_prio_heap.begin(), m_prio_heap.end(),
         greater<MessageBufferNode>());
     m_prio_heap.pop_back();
+
+    return delayCycles;
 }
 
 void
index 6019f3d6ce598af685187bab03a3f26c9e9cbb4b..3b3a69a3e6b4a526599618c9a8bc13f6e0cf0fa2 100644 (file)
@@ -118,11 +118,9 @@ class MessageBuffer
     void enqueue(MsgPtr message) { enqueue(message, Cycles(1)); }
     void enqueue(MsgPtr message, Cycles delta);
 
-    //! Updates the delay cycles of the message at the of the queue,
+    //! Updates the delay cycles of the message at the head of the queue,
     //! removes it from the queue and returns its total delay.
-    Cycles dequeue_getDelayCycles();
-
-    void dequeue();
+    Cycles dequeue();
 
     void recycle();
     bool isEmpty() const { return m_prio_heap.size() == 0; }
index ecd1eb0bebdabcdee3a2076a60f10671b1218cda..cf2430e362ddf10b0e8d8c75002a6ab33f01142d 100644 (file)
@@ -260,6 +260,10 @@ PerfectSwitch::wakeup()
                         unmodified_msg_ptr = msg_ptr->clone();
                     }
 
+                    // Dequeue msg
+                    m_in[incoming][vnet]->dequeue();
+                    m_pending_message_count[vnet]--;
+
                     // Enqueue it - for all outgoing queues
                     for (int i=0; i<output_links.size(); i++) {
                         int outgoing = output_links[i];
@@ -284,10 +288,6 @@ PerfectSwitch::wakeup()
 
                         m_out[outgoing][vnet]->enqueue(msg_ptr);
                     }
-
-                    // Dequeue msg
-                    m_in[incoming][vnet]->dequeue();
-                    m_pending_message_count[vnet]--;
                 }
             }
         }
index 778436c6d96d0dece93ccbd7d875b74388efff53..da7b1732b3b7f292579c740c0a1fca91f65f6926 100644 (file)
@@ -157,8 +157,8 @@ Throttle::wakeup()
                         g_system_ptr->curCycle());
 
                 // Move the message
-                m_out[vnet]->enqueue(m_in[vnet]->peekMsgPtr(), m_link_latency);
                 m_in[vnet]->dequeue();
+                m_out[vnet]->enqueue(msg_ptr, m_link_latency);
 
                 // Count the message
                 m_msg_counts[net_msg_ptr->getMessageSize()][vnet]++;
index 898fccf3deff8a4d5b33219d8c05dbb5acf1f842..acb69f7993f6e7cdb76eee94244307952b283661 100644 (file)
@@ -42,8 +42,8 @@ class ExprStatementAST(StatementAST):
 
         # The return type must be void
         if actual_type != self.symtab.find("void", Type):
-            self.expr.error("Non-void return must not be ignored, " + \
-                            "return type is '%s'", actual_type.ident)
+            self.expr.warning("Non-void return ignored, " + \
+                "return type is '%s'", actual_type.ident)
 
     def findResources(self, resources):
         self.expr.findResources(resources)