mem-ruby: Fix a bug in MessageBuffer randomization

In the previous implementation, messages are randomly inserted with
delays only if both RubySystem and MessageBuffer randomization flags
are set true.  However, to find race conditions and cover more slicc
transitions, ruby random testers rely on setting RubySystem flag to
turn on randomization on all message buffers.
As a fix, this patch enables a message buffer to have randomization
when either RubySystem or its own flag is set.

Change-Id: I1e076908ff07e5846ebad4f4fc1c8f28d40bbfd4
Reviewed-on: https://gem5-review.googlesource.com/12784
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
Xianwei Zhang
2018-09-19 19:14:40 -04:00
parent 7bfb7f3a43
commit 9556aa3232
3 changed files with 10 additions and 3 deletions

View File

@@ -156,7 +156,9 @@ MessageBuffer::enqueue(MsgPtr message, Tick current_time, Tick delta)
assert(delta > 0);
Tick arrival_time = 0;
if (!RubySystem::getRandomization() || !m_randomization) {
// 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) {
// No randomization
arrival_time = current_time + delta;
} else {

View File

@@ -37,7 +37,10 @@ class MessageBuffer(SimObject):
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, "")
randomization = Param.Bool(False, "Insert random delays on message \
enqueue times (enforced to have \
random delays if RubySystem \
randomization flag is True)")
master = MasterPort("Master port to MessageBuffer receiver")
slave = SlavePort("Slave port from MessageBuffer sender")

View File

@@ -35,7 +35,9 @@ class RubySystem(ClockedObject):
type = 'RubySystem'
cxx_header = "mem/ruby/system/RubySystem.hh"
randomization = Param.Bool(False,
"insert random delays on message enqueue times");
"insert random delays on message enqueue times (if True, all message \
buffers are enforced to have randomization; otherwise, a message \
buffer set its own flag to enable/disable randomization)");
block_size_bytes = Param.UInt32(64,
"default cache block size; must be a power of two");
memory_size_bits = Param.UInt32(64,