Skip to content

Commit

Permalink
Add latency control parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mine02C4 committed Jan 24, 2022
1 parent f554b1a commit 00e038c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
12 changes: 12 additions & 0 deletions configs/network/Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
2 changes: 2 additions & 0 deletions src/mem/ruby/network/garnet/GarnetLink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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];


Expand Down
3 changes: 3 additions & 0 deletions src/mem/ruby/network/garnet/GarnetLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 5 additions & 1 deletion src/mem/ruby/network/garnet/NetworkLink.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand All @@ -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;

Expand Down

0 comments on commit 00e038c

Please sign in to comment.