From 00e038c2154a1d43f0bfaa583060d3f4c50189f9 Mon Sep 17 00:00:00 2001 From: Naoya Niwa Date: Mon, 24 Jan 2022 15:50:45 +0900 Subject: [PATCH] Add latency control parameters. --- configs/network/Network.py | 12 ++++++++++++ src/mem/ruby/network/garnet/GarnetLink.cc | 2 ++ src/mem/ruby/network/garnet/GarnetLink.py | 3 +++ src/mem/ruby/network/garnet/NetworkLink.hh | 6 +++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/configs/network/Network.py b/configs/network/Network.py index 91f00766e56..11b94d1b845 100644 --- a/configs/network/Network.py +++ b/configs/network/Network.py @@ -80,6 +80,18 @@ def define_options(parser): "--garnet-deadlock-threshold", action="store", type=int, default=50000, help="network-level deadlock threshold.") + parser.add_argument( + "--control-msg-size", action="store", type=int, + default=16, + help="The size of control messages in bytes.") + parser.add_argument( + "--injection-extlink-latency", action="store", type=int, + default=1, + help="Latency of Injection ExtLink in clocks") + parser.add_argument( + "--ejection-extlink-latency", action="store", type=int, + default=1, + help="Latency of Ejection ExtLink in clocks") def create_network(options, ruby): diff --git a/src/mem/ruby/network/garnet/GarnetLink.cc b/src/mem/ruby/network/garnet/GarnetLink.cc index a22bc34cc65..b0f0e89b158 100644 --- a/src/mem/ruby/network/garnet/GarnetLink.cc +++ b/src/mem/ruby/network/garnet/GarnetLink.cc @@ -102,10 +102,12 @@ GarnetExtLink::GarnetExtLink(const Params &p) // In m_network_links[0] = p.network_links[0]; + m_network_links[0]->setLatency(p.injection_link_latency); m_credit_links[0] = p.credit_links[0]; // Out m_network_links[1] = p.network_links[1]; + m_network_links[1]->setLatency(p.ejection_link_latency); m_credit_links[1] = p.credit_links[1]; diff --git a/src/mem/ruby/network/garnet/GarnetLink.py b/src/mem/ruby/network/garnet/GarnetLink.py index f9baa891008..bd571e17833 100644 --- a/src/mem/ruby/network/garnet/GarnetLink.py +++ b/src/mem/ruby/network/garnet/GarnetLink.py @@ -111,6 +111,9 @@ class GarnetExtLink(BasicExtLink): cxx_header = "mem/ruby/network/garnet/GarnetLink.hh" cxx_class = 'gem5::ruby::garnet::GarnetExtLink' + injection_link_latency = Param.Cycles("injection link latency") + ejection_link_latency = Param.Cycles("ejection link latency") + # The external link is bi-directional. # It includes two forward links (for flits) # and two backward flow-control links (for credits), diff --git a/src/mem/ruby/network/garnet/NetworkLink.hh b/src/mem/ruby/network/garnet/NetworkLink.hh index 449d2bc029e..7d36fb09847 100644 --- a/src/mem/ruby/network/garnet/NetworkLink.hh +++ b/src/mem/ruby/network/garnet/NetworkLink.hh @@ -77,6 +77,10 @@ class NetworkLink : public ClockedObject, public Consumer { return linkBuffer.isReady(curTime); } + inline void setLatency(Cycles latency) + { + m_latency = latency; + } inline flit* peekLink() { return linkBuffer.peekTopFlit(); } inline flit* consumeLink() { return linkBuffer.getTopFlit(); } @@ -90,7 +94,7 @@ class NetworkLink : public ClockedObject, public Consumer private: const int m_id; link_type m_type; - const Cycles m_latency; + Cycles m_latency; ClockedObject *src_object;