#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"
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);
// 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) + "]";
}
}
#include "mem/ruby/system/System.hh"
class MessageBuffer;
+class Switch;
class Throttle : public Consumer
{
public:
Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency,
int link_bandwidth_multiplier, int endpoint_bandwidth,
- ClockedObject *em);
- Throttle(RubySystem *rs, NodeID node, Cycles link_latency,
- int link_bandwidth_multiplier, int endpoint_bandwidth,
- ClockedObject *em);
+ Switch *em);
~Throttle() {}
std::string name()
- { return csprintf("Throttle-%i", m_sID); }
+ { return csprintf("Throttle-%i", m_switch_id); }
void addLinks(const std::vector<MessageBuffer*>& in_vec,
const std::vector<MessageBuffer*>& out_vec);
unsigned int m_vnets;
std::vector<int> m_units_remaining;
- int m_sID;
+ const int m_switch_id;
+ Switch *m_switch;
NodeID m_node;
+
int m_link_bandwidth_multiplier;
Cycles m_link_latency;
int m_wakeups_wo_switch;