summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/MessageBuffer.cc
diff options
context:
space:
mode:
authorMatthew Poremba <matthew.poremba@amd.com>2016-12-02 11:40:40 -0500
committerMatthew Poremba <matthew.poremba@amd.com>2016-12-02 11:40:40 -0500
commit80607a2a1d32a15cabf9110e27855acb40a06f23 (patch)
treee4bb882b9f86dc7b25dff6dab45a6dcb47ad9ac0 /src/mem/ruby/network/MessageBuffer.cc
parent752033140228c790e51954bd8ccd3728f4dd7e08 (diff)
downloadgem5-80607a2a1d32a15cabf9110e27855acb40a06f23.tar.xz
ruby: Fix overflow reported by ASAN in MessageBuffer.
In MessageBuffer the m_not_avail_count member is incremented but not used. This causes an overflow reported by ASAN. This patch changes from an int to Stats::Scalar, since the count is useful in debugging finite MessageBuffers.
Diffstat (limited to 'src/mem/ruby/network/MessageBuffer.cc')
-rw-r--r--src/mem/ruby/network/MessageBuffer.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mem/ruby/network/MessageBuffer.cc b/src/mem/ruby/network/MessageBuffer.cc
index b78e9aad0..557e0e80e 100644
--- a/src/mem/ruby/network/MessageBuffer.cc
+++ b/src/mem/ruby/network/MessageBuffer.cc
@@ -51,7 +51,6 @@ MessageBuffer::MessageBuffer(const Params *p)
m_size_last_time_size_checked = 0;
m_size_at_cycle_start = 0;
m_msgs_this_cycle = 0;
- m_not_avail_count = 0;
m_priority_rank = 0;
m_stall_msg_map.clear();
@@ -350,6 +349,15 @@ MessageBuffer::isReady(Tick current_time) const
(m_prio_heap.front()->getLastEnqueueTime() <= current_time));
}
+void
+MessageBuffer::regStats()
+{
+ m_not_avail_count
+ .name(name() + ".not_avail_count")
+ .desc("Number of times this buffer did not have N slots available")
+ .flags(Stats::nozero);
+}
+
uint32_t
MessageBuffer::functionalWrite(Packet *pkt)
{