mem,scons: Changed assert to panic_if in MessageBuffer
authorBobby R. Bruce <bbruce@ucdavis.edu>
Tue, 27 Oct 2020 22:47:01 +0000 (15:47 -0700)
committerBobby R. Bruce <bbruce@ucdavis.edu>
Fri, 6 Nov 2020 01:40:00 +0000 (01:40 +0000)
The variable 'm_allow_zero_latency' was only used in an assert message in
`src/mem/ruby/network/MessageBuffer.cc`. This assert is stripped when
compiling to gem5.fast, resulting in the compilation failing with an
unused variable error.

This assert is better as a panic_if, which will not be stripped out
during the .fast compilation.

Change-Id: I5de74982fa42b3291899ddcf73f7140079e1ec3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36697
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
src/mem/ruby/network/MessageBuffer.cc

index fad1fcaa0096908eb7e21e244903c6dc05e80f42..2eec1107b2029fe58d61ab85c88a00ba961fd2fa 100644 (file)
@@ -173,7 +173,8 @@ MessageBuffer::enqueue(MsgPtr message, Tick current_time, Tick delta)
 
     // Calculate the arrival time of the message, that is, the first
     // cycle the message can be dequeued.
-    assert((delta > 0) || m_allow_zero_latency);
+    panic_if((delta == 0) && !m_allow_zero_latency,
+           "Delta equals zero and allow_zero_latency is false during enqueue");
     Tick arrival_time = 0;
 
     // random delays are inserted if the RubySystem level randomization flag