mem-ruby: add function to check for stalled msgs of addr
authorTuan Ta <tuan.ta@amd.com>
Mon, 30 Apr 2018 19:42:47 +0000 (15:42 -0400)
committerAnthony Gutierrez <anthony.gutierrez@amd.com>
Thu, 28 May 2020 23:07:08 +0000 (23:07 +0000)
This patch allows a cache controller to check if there
is any stalled message of a specific address in the
stall_map of an input message buffer.

Change-Id: Id2f9bb98a9201a562f2a8cc371e9bb896ac836af
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28133
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/network/MessageBuffer.cc
src/mem/ruby/network/MessageBuffer.hh
src/mem/ruby/protocol/RubySlicc_Types.sm

index 6e14de1766d8a4102feb8f5fe54b0151643c0669..3db8515a37d5800d14b91b43ca38d3e493db3200 100644 (file)
@@ -394,6 +394,12 @@ MessageBuffer::stallMessage(Addr addr, Tick current_time)
     m_stall_count++;
 }
 
+bool
+MessageBuffer::hasStalledMsg(Addr addr) const
+{
+    return (m_stall_msg_map.count(addr) != 0);
+}
+
 void
 MessageBuffer::deferEnqueueingMessage(Addr addr, MsgPtr message)
 {
index 01c0767e2ce8d190d89146f4de78cdd4c6a20811..8abf3bd63659b7de56b823794f9c6777ee45e247 100644 (file)
@@ -74,6 +74,8 @@ class MessageBuffer : public SimObject
     void reanalyzeMessages(Addr addr, Tick current_time);
     void reanalyzeAllMessages(Tick current_time);
     void stallMessage(Addr addr, Tick current_time);
+    // return true if the stall map has a message of this address
+    bool hasStalledMsg(Addr addr) const;
 
     // TRUE if head of queue timestamp <= SystemTime
     bool isReady(Tick current_time) const;
@@ -124,7 +126,6 @@ class MessageBuffer : public SimObject
     // enqueue all previously deferred messages that are associated with the
     // input address
     void enqueueDeferredMessages(Addr addr, Tick curTime, Tick delay);
-
     bool isDeferredMsgMapEmpty(Addr addr) const;
 
     //! Updates the delay cycles of the message at the head of the queue,
index bcadc3dc4d4034383cacef23d7144397c325df52..b59cf97170b67014b0239916216c8fc21a9ec81e 100644 (file)
@@ -63,6 +63,7 @@ structure(InPort, external = "yes", primitive="yes") {
   bool isEmpty();
   bool isStallMapEmpty();
   int getStallMapSize();
+  bool hasStalledMsg(Addr addr);
 }
 
 external_type(NodeID, default="0", primitive="yes");