From 52fa2b6f072bb5ecabac0595c78b97f50f30d507 Mon Sep 17 00:00:00 2001 From: Tiago Muck Date: Wed, 5 Jun 2019 15:34:13 -0500 Subject: [PATCH] mem-ruby: MessageBuffer capacity check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/mem/ruby/network/MessageBuffer.cc | 3 +++ 1 file changed, 3 insertions(+) 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())); -- 2.30.2