Tiago Mück has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/31419 )

Change subject: mem-ruby: change MessageBuffer randomization param
......................................................................

mem-ruby: change MessageBuffer randomization param

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.m...@arm.com>
---
M src/mem/ruby/network/MessageBuffer.cc
M src/mem/ruby/network/MessageBuffer.hh
M src/mem/ruby/network/MessageBuffer.py
3 files changed, 27 insertions(+), 9 deletions(-)



diff --git a/src/mem/ruby/network/MessageBuffer.cc b/src/mem/ruby/network/MessageBuffer.cc
index 8fe59ea..a943ea5 100644
--- a/src/mem/ruby/network/MessageBuffer.cc
+++ b/src/mem/ruby/network/MessageBuffer.cc
@@ -174,9 +174,11 @@
     // cycle the message can be dequeued.
     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 {
diff --git a/src/mem/ruby/network/MessageBuffer.hh b/src/mem/ruby/network/MessageBuffer.hh
index f10c834..15e1b65 100644
--- a/src/mem/ruby/network/MessageBuffer.hh
+++ b/src/mem/ruby/network/MessageBuffer.hh
@@ -254,7 +254,7 @@
     uint64_t m_msg_counter;
     int m_priority_rank;
     const bool m_strict_fifo;
-    const bool m_randomization;
+    const MessageRandomization m_randomization;

     int m_input_link_id;
     int m_vnet_id;
diff --git a/src/mem/ruby/network/MessageBuffer.py b/src/mem/ruby/network/MessageBuffer.py
index 689ec62..f477519 100644
--- a/src/mem/ruby/network/MessageBuffer.py
+++ b/src/mem/ruby/network/MessageBuffer.py
@@ -1,3 +1,15 @@
+# Copyright (c) 2020 ARM Limited
+# All rights reserved.
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
 # Copyright (c) 2015 Mark D. Hill and David A. Wood.
 # All rights reserved.
 #
@@ -28,6 +40,13 @@
 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'
@@ -35,10 +54,7 @@
     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")
     master = MasterPort("Master port to MessageBuffer receiver")
     slave = SlavePort("Slave port from MessageBuffer sender")

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31419
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If7520153cc5864897fa42e8911a6f8acbcf01db5
Gerrit-Change-Number: 31419
Gerrit-PatchSet: 1
Gerrit-Owner: Tiago Mück <tiago.m...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to