From: Tiago Muck Date: Wed, 5 Jun 2019 20:34:13 +0000 (-0500) Subject: mem-ruby: MessageBuffer capacity check X-Git-Tag: develop-gem5-snapshot~666 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=52fa2b6f072bb5ecabac0595c78b97f50f30d507;p=gem5.git mem-ruby: MessageBuffer capacity check Trip assert if call enqueue on a full message buffer. Change-Id: I842183d8bf2c681787f1b6ac23c95825095ad05d Signed-off-by: Tiago Mück Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31254 Maintainer: Jason Lowe-Power Tested-by: kokoro Reviewed-by: Jason Lowe-Power Reviewed-by: Matthew Poremba --- diff --git a/src/mem/ruby/network/MessageBuffer.cc b/src/mem/ruby/network/MessageBuffer.cc index 3db8515a3..fb1d734dc 100644 --- a/src/mem/ruby/network/MessageBuffer.cc +++ b/src/mem/ruby/network/MessageBuffer.cc @@ -225,6 +225,9 @@ MessageBuffer::enqueue(MsgPtr message, Tick current_time, Tick delta) // Increment the number of messages statistic m_buf_msgs++; + assert((m_max_size == 0) || + ((m_prio_heap.size() + m_stall_map_size) <= m_max_size)); + DPRINTF(RubyQueue, "Enqueue arrival_time: %lld, Message: %s\n", arrival_time, *(message.get()));