There are cases in which we need to prevent randomization for a
specific buffer when enabled at the RubySystem level (e.g. a internal
trigger queue that requires zero latency enqueue, while other buffers
can be randomized).
This changes the randomization parameter to support enabling and
disabling randomization regardless of the RubySystem setting.
Change-Id: If7520153cc5864897fa42e8911a6f8acbcf01db5
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31419
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
assert((delta > 0) || m_allow_zero_latency);
Tick arrival_time = 0;
assert((delta > 0) || m_allow_zero_latency);
Tick arrival_time = 0;
- // random delays are inserted if either RubySystem level randomization flag
- // is turned on, or the buffer level randomization is set
- if (!RubySystem::getRandomization() && !m_randomization) {
+ // random delays are inserted if the RubySystem level randomization flag
+ // is turned on and this buffer allows it
+ if ((m_randomization == MessageRandomization::disabled) ||
+ ((m_randomization == MessageRandomization::ruby_system) &&
+ !RubySystem::getRandomization())) {
// No randomization
arrival_time = current_time + delta;
} else {
// No randomization
arrival_time = current_time + delta;
} else {
uint64_t m_msg_counter;
int m_priority_rank;
const bool m_strict_fifo;
uint64_t m_msg_counter;
int m_priority_rank;
const bool m_strict_fifo;
- const bool m_randomization;
+ const MessageRandomization m_randomization;
const bool m_allow_zero_latency;
int m_input_link_id;
const bool m_allow_zero_latency;
int m_input_link_id;
from m5.proxy import *
from m5.SimObject import SimObject
from m5.proxy import *
from m5.SimObject import SimObject
+# A MessageBuffer inserts random delays to enqueued messages when the
+# randomization param is set to 'enabled' or when globally enabled for the
+# RubySystem and the param is set to 'ruby_system' (default). 'disabled'
+# completely prevents randomization.
+class MessageRandomization(ScopedEnum):
+ vals = ['disabled', 'enabled', 'ruby_system']
+
class MessageBuffer(SimObject):
type = 'MessageBuffer'
cxx_class = 'MessageBuffer'
class MessageBuffer(SimObject):
type = 'MessageBuffer'
cxx_class = 'MessageBuffer'
ordered = Param.Bool(False, "Whether the buffer is ordered")
buffer_size = Param.Unsigned(0, "Maximum number of entries to buffer \
(0 allows infinite entries)")
ordered = Param.Bool(False, "Whether the buffer is ordered")
buffer_size = Param.Unsigned(0, "Maximum number of entries to buffer \
(0 allows infinite entries)")
- randomization = Param.Bool(False, "Insert random delays on message \
- enqueue times (enforced to have \
- random delays if RubySystem \
- randomization flag is True)")
+ randomization = Param.MessageRandomization('ruby_system',
+ "Randomization parameter")
allow_zero_latency = Param.Bool(False, "Allows messages to be enqueued \
with zero latency. This is useful \
for internall trigger queues and \
allow_zero_latency = Param.Bool(False, "Allows messages to be enqueued \
with zero latency. This is useful \
for internall trigger queues and \