summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/MessageBuffer.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/network/MessageBuffer.hh')
-rw-r--r--src/mem/ruby/network/MessageBuffer.hh28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mem/ruby/network/MessageBuffer.hh b/src/mem/ruby/network/MessageBuffer.hh
index 2a82887cd..b1d04ab9a 100644
--- a/src/mem/ruby/network/MessageBuffer.hh
+++ b/src/mem/ruby/network/MessageBuffer.hh
@@ -137,9 +137,37 @@ class MessageBuffer : public SimObject
// sorted and ensures a well-defined iteration order
typedef std::map<Addr, std::list<MsgPtr> > StallMsgMapType;
+ /**
+ * A map from line addresses to lists of stalled messages for that line.
+ * If this buffer allows the receiver to stall messages, on a stall
+ * request, the stalled message is removed from the m_prio_heap and placed
+ * in the m_stall_msg_map. Messages are held there until the receiver
+ * requests they be reanalyzed, at which point they are moved back to
+ * m_prio_heap.
+ *
+ * NOTE: The stall map holds messages in the order in which they were
+ * initially received, and when a line is unblocked, the messages are
+ * moved back to the m_prio_heap in the same order. This prevents starving
+ * older requests with younger ones.
+ */
StallMsgMapType m_stall_msg_map;
+ /**
+ * Current size of the stall map.
+ * Track the number of messages held in stall map lists. This is used to
+ * ensure that if the buffer is finite-sized, it blocks further requests
+ * when the m_prio_heap and m_stall_msg_map contain m_max_size messages.
+ */
+ int m_stall_map_size;
+
+ /**
+ * The maximum capacity. For finite-sized buffers, m_max_size stores a
+ * number greater than 0 to indicate the maximum allowed number of messages
+ * in the buffer at any time. To get infinitely-sized buffers, set buffer
+ * size: m_max_size = 0
+ */
const unsigned int m_max_size;
+
Tick m_time_last_time_size_checked;
unsigned int m_size_last_time_size_checked;