diff options
author | Matthew Poremba <matthew.poremba@amd.com> | 2016-12-02 11:40:40 -0500 |
---|---|---|
committer | Matthew Poremba <matthew.poremba@amd.com> | 2016-12-02 11:40:40 -0500 |
commit | 80607a2a1d32a15cabf9110e27855acb40a06f23 (patch) | |
tree | e4bb882b9f86dc7b25dff6dab45a6dcb47ad9ac0 /src/mem/ruby/network/MessageBuffer.hh | |
parent | 752033140228c790e51954bd8ccd3728f4dd7e08 (diff) | |
download | gem5-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.hh')
-rw-r--r-- | src/mem/ruby/network/MessageBuffer.hh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mem/ruby/network/MessageBuffer.hh b/src/mem/ruby/network/MessageBuffer.hh index 5c9e1089b..2a82887cd 100644 --- a/src/mem/ruby/network/MessageBuffer.hh +++ b/src/mem/ruby/network/MessageBuffer.hh @@ -116,6 +116,8 @@ class MessageBuffer : public SimObject void setIncomingLink(int link_id) { m_input_link_id = link_id; } void setVnet(int net) { m_vnet_id = net; } + void regStats(); + // Function for figuring out if any of the messages in the buffer need // to be updated with the data from the packet. // Return value indicates the number of messages that were updated. @@ -150,8 +152,8 @@ class MessageBuffer : public SimObject unsigned int m_size_at_cycle_start; unsigned int m_msgs_this_cycle; - int m_not_avail_count; // count the # of times I didn't have N - // slots available + Stats::Scalar m_not_avail_count; // count the # of times I didn't have N + // slots available uint64_t m_msg_counter; int m_priority_rank; const bool m_strict_fifo; |