summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/simple
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/network/simple')
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.cc4
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.hh2
-rw-r--r--src/mem/ruby/network/simple/Switch.cc4
-rw-r--r--src/mem/ruby/network/simple/Throttle.cc13
-rw-r--r--src/mem/ruby/network/simple/Throttle.hh9
5 files changed, 19 insertions, 13 deletions
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc b/src/mem/ruby/network/simple/PerfectSwitch.cc
index b38b6d539..37035f95f 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.cc
+++ b/src/mem/ruby/network/simple/PerfectSwitch.cc
@@ -68,7 +68,7 @@ PerfectSwitch::init(SimpleNetwork *network_ptr)
}
void
-PerfectSwitch::addInPort(const vector<MessageBuffer*>& in)
+PerfectSwitch::addInPort(const vector<MessageBuffer*>& in, Switch *sw)
{
assert(in.size() == m_virtual_networks);
NodeID port = m_in.size();
@@ -76,6 +76,8 @@ PerfectSwitch::addInPort(const vector<MessageBuffer*>& in)
for (int j = 0; j < m_virtual_networks; j++) {
m_in[port][j]->setConsumer(this);
+ m_in[port][j]->setClockObj(sw);
+
string desc = csprintf("[Queue from port %s %s %s to PerfectSwitch]",
to_string(m_switch_id), to_string(port), to_string(j));
m_in[port][j]->setDescription(desc);
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.hh b/src/mem/ruby/network/simple/PerfectSwitch.hh
index 695c848bc..ffd1f84ba 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.hh
+++ b/src/mem/ruby/network/simple/PerfectSwitch.hh
@@ -63,7 +63,7 @@ class PerfectSwitch : public Consumer
{ return csprintf("PerfectSwitch-%i", m_switch_id); }
void init(SimpleNetwork *);
- void addInPort(const std::vector<MessageBuffer*>& in);
+ void addInPort(const std::vector<MessageBuffer*>& in, Switch *);
void addOutPort(const std::vector<MessageBuffer*>& out,
const NetDest& routing_table_entry);
void clearRoutingTables();
diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc
index 1bb944f91..d9abc4cc7 100644
--- a/src/mem/ruby/network/simple/Switch.cc
+++ b/src/mem/ruby/network/simple/Switch.cc
@@ -67,7 +67,7 @@ Switch::init()
void
Switch::addInPort(const vector<MessageBuffer*>& in)
{
- m_perfect_switch_ptr->addInPort(in);
+ m_perfect_switch_ptr->addInPort(in, this);
}
void
@@ -97,7 +97,7 @@ Switch::addOutPort(const vector<MessageBuffer*>& out,
m_perfect_switch_ptr->addOutPort(intermediateBuffers, routing_table_entry);
// Hook the queues to the Throttle
- throttle_ptr->addLinks(intermediateBuffers, out);
+ throttle_ptr->addLinks(intermediateBuffers, out, this);
}
void
diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc
index 653791c29..b591cc81b 100644
--- a/src/mem/ruby/network/simple/Throttle.cc
+++ b/src/mem/ruby/network/simple/Throttle.cc
@@ -50,7 +50,7 @@ static int network_message_to_size(NetworkMessage* net_msg_ptr);
Throttle::Throttle(int sID, NodeID node, int link_latency,
int link_bandwidth_multiplier, int endpoint_bandwidth,
- EventManager *em)
+ ClockedObject *em)
: Consumer(em)
{
init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth);
@@ -59,7 +59,7 @@ Throttle::Throttle(int sID, NodeID node, int link_latency,
Throttle::Throttle(NodeID node, int link_latency,
int link_bandwidth_multiplier, int endpoint_bandwidth,
- EventManager *em)
+ ClockedObject *em)
: Consumer(em)
{
init(node, link_latency, link_bandwidth_multiplier, endpoint_bandwidth);
@@ -93,11 +93,11 @@ Throttle::clear()
void
Throttle::addLinks(const std::vector<MessageBuffer*>& in_vec,
- const std::vector<MessageBuffer*>& out_vec)
+ const std::vector<MessageBuffer*>& out_vec, ClockedObject *em)
{
assert(in_vec.size() == out_vec.size());
for (int i=0; i<in_vec.size(); i++) {
- addVirtualNetwork(in_vec[i], out_vec[i]);
+ addVirtualNetwork(in_vec[i], out_vec[i], em);
}
m_message_counters.resize(MessageSizeType_NUM);
@@ -110,7 +110,8 @@ Throttle::addLinks(const std::vector<MessageBuffer*>& in_vec,
}
void
-Throttle::addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr)
+Throttle::addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr,
+ ClockedObject *em)
{
m_units_remaining.push_back(0);
m_in.push_back(in_ptr);
@@ -118,6 +119,8 @@ Throttle::addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr)
// Set consumer and description
m_in[m_vnets]->setConsumer(this);
+ m_in[m_vnets]->setClockObj(em);
+
string desc = "[Queue to Throttle " + to_string(m_sID) + " " +
to_string(m_node) + "]";
m_in[m_vnets]->setDescription(desc);
diff --git a/src/mem/ruby/network/simple/Throttle.hh b/src/mem/ruby/network/simple/Throttle.hh
index b86a247d2..077382041 100644
--- a/src/mem/ruby/network/simple/Throttle.hh
+++ b/src/mem/ruby/network/simple/Throttle.hh
@@ -54,16 +54,16 @@ class Throttle : public Consumer
public:
Throttle(int sID, NodeID node, int link_latency,
int link_bandwidth_multiplier, int endpoint_bandwidth,
- EventManager *em);
+ ClockedObject *em);
Throttle(NodeID node, int link_latency, int link_bandwidth_multiplier,
- int endpoint_bandwidth, EventManager *em);
+ int endpoint_bandwidth, ClockedObject *em);
~Throttle() {}
std::string name()
{ return csprintf("Throttle-%i", m_sID); }
void addLinks(const std::vector<MessageBuffer*>& in_vec,
- const std::vector<MessageBuffer*>& out_vec);
+ const std::vector<MessageBuffer*>& out_vec, ClockedObject *em);
void wakeup();
void printStats(std::ostream& out) const;
@@ -90,7 +90,8 @@ class Throttle : public Consumer
private:
void init(NodeID node, int link_latency, int link_bandwidth_multiplier,
int endpoint_bandwidth);
- void addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr);
+ void addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr,
+ ClockedObject *em);
void linkUtilized(double ratio) { m_links_utilized += ratio; }
// Private copy constructor and assignment operator