diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2015-09-12 16:16:03 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2015-09-12 16:16:03 -0500 |
commit | 25cd13dbf1d6f7d306b40c7e2e3d7231b0c5eb04 (patch) | |
tree | 670ae38b6b7e1e70efb9c6b43c66ddd018c0f751 /src/mem/ruby/network/simple/Throttle.cc | |
parent | f611d4f22e913633e884b0d87b4de52def6434f3 (diff) | |
download | gem5-25cd13dbf1d6f7d306b40c7e2e3d7231b0c5eb04.tar.xz |
ruby: simple network: store Switch* in PerfectSwitch and Throttle
There are two reasons for doing so:
a. provide a source of clock to PerfectSwitch. A follow on patch removes sender
and receiver pointers from MessageBuffer means that the object owning the
buffer should have some way of providing timing info.
b. schedule events. A follow on patch removes the consumer class. So the
PerfectSwitch needs some EventManager object to schedule events on its own.
Diffstat (limited to 'src/mem/ruby/network/simple/Throttle.cc')
-rw-r--r-- | src/mem/ruby/network/simple/Throttle.cc | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc index 785e09aa2..c97531e58 100644 --- a/src/mem/ruby/network/simple/Throttle.cc +++ b/src/mem/ruby/network/simple/Throttle.cc @@ -31,6 +31,7 @@ #include "base/cast.hh" #include "base/cprintf.hh" #include "debug/RubyNetwork.hh" +#include "mem/ruby/network/simple/Switch.hh" #include "mem/ruby/network/simple/Throttle.hh" #include "mem/ruby/network/MessageBuffer.hh" #include "mem/ruby/network/Network.hh" @@ -48,27 +49,10 @@ static int network_message_to_size(Message* net_msg_ptr); Throttle::Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency, int link_bandwidth_multiplier, int endpoint_bandwidth, - ClockedObject *em) - : Consumer(em), m_ruby_system(rs) + Switch *em) + : Consumer(em), m_switch_id(sID), m_switch(em), m_node(node), + m_ruby_system(rs) { - init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth); - m_sID = sID; -} - -Throttle::Throttle(RubySystem *rs, NodeID node, Cycles link_latency, - int link_bandwidth_multiplier, int endpoint_bandwidth, - ClockedObject *em) - : Consumer(em), m_ruby_system(rs) -{ - init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth); - m_sID = 0; -} - -void -Throttle::init(NodeID node, Cycles link_latency, - int link_bandwidth_multiplier, int endpoint_bandwidth) -{ - m_node = node; m_vnets = 0; assert(link_bandwidth_multiplier > 0); @@ -98,7 +82,7 @@ Throttle::addLinks(const vector<MessageBuffer*>& in_vec, // Set consumer and description in_ptr->setConsumer(this); - string desc = "[Queue to Throttle " + to_string(m_sID) + " " + + string desc = "[Queue to Throttle " + to_string(m_switch_id) + " " + to_string(m_node) + "]"; } } |