From 904c578049f2831f4f170fe4bf18161559052974 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tiago=20M=C3=BCck?= Date: Thu, 5 Sep 2019 17:53:40 -0500 Subject: [PATCH] mem-ruby: Network can use custom data msg size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The size for network data messages can be set using a configuration parameter. This is necessary so line transfers may be split in multiple messages at the protocol level. Change-Id: I86a272de597b04a898071db412b921cbe1651ef0 Signed-off-by: Tiago Mück Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31256 Reviewed-by: Jason Lowe-Power Reviewed-by: Srikant Bharadwaj Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/mem/ruby/network/Network.cc | 10 ++++------ src/mem/ruby/network/Network.hh | 1 - src/mem/ruby/network/Network.py | 6 ++++++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/mem/ruby/network/Network.cc b/src/mem/ruby/network/Network.cc index cda99b196..a676a3827 100644 --- a/src/mem/ruby/network/Network.cc +++ b/src/mem/ruby/network/Network.cc @@ -55,6 +55,10 @@ Network::Network(const Params *p) m_virtual_networks = p->number_of_virtual_networks; m_control_msg_size = p->control_msg_size; + fatal_if(p->data_msg_size > p->ruby_system->getBlockSizeBytes(), + "%s: data message size > cache line size", name()); + m_data_msg_size = p->data_msg_size + m_control_msg_size; + params()->ruby_system->registerNetwork(this); // Populate localNodeVersions with the version of each MachineType in @@ -150,12 +154,6 @@ Network::~Network() delete m_topology_ptr; } -void -Network::init() -{ - m_data_msg_size = RubySystem::getBlockSizeBytes() + m_control_msg_size; -} - uint32_t Network::MessageSizeType_to_int(MessageSizeType size_type) { diff --git a/src/mem/ruby/network/Network.hh b/src/mem/ruby/network/Network.hh index f151aed94..371ceb8bb 100644 --- a/src/mem/ruby/network/Network.hh +++ b/src/mem/ruby/network/Network.hh @@ -82,7 +82,6 @@ class Network : public ClockedObject { return dynamic_cast(_params); } virtual ~Network(); - void init() override; static uint32_t getNumberOfVirtualNetworks() { return m_virtual_networks; } int getNumNodes() const { return m_nodes; } diff --git a/src/mem/ruby/network/Network.py b/src/mem/ruby/network/Network.py index 8999ff1cd..5febaad29 100644 --- a/src/mem/ruby/network/Network.py +++ b/src/mem/ruby/network/Network.py @@ -25,6 +25,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from m5.params import * +from m5.proxy import * from m5.objects.ClockedObject import ClockedObject from m5.objects.BasicLink import BasicLink @@ -53,3 +54,8 @@ class RubyNetwork(ClockedObject): slave = DeprecatedParam(in_port, '`slave` is now called `in_port`') out_port = VectorRequestPort("CPU output port") master = DeprecatedParam(out_port, '`master` is now called `out_port`') + + data_msg_size = Param.Int(Parent.block_size_bytes, + "Size of data messages. Defaults to the parent " + "RubySystem cache line size.") + -- 2.30.2