summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/network')
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc2
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc2
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.cc6
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.hh14
-rw-r--r--src/mem/ruby/network/simple/Switch.cc8
-rw-r--r--src/mem/ruby/network/simple/Switch.hh14
-rw-r--r--src/mem/ruby/network/simple/Topology.cc7
-rw-r--r--src/mem/ruby/network/simple/Topology.hh21
8 files changed, 44 insertions, 30 deletions
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
index 26399e68e..6c61cef26 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
@@ -28,6 +28,8 @@
* Authors: Niket Agarwal
*/
+#include <cmath>
+
#include "mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh"
#include "mem/ruby/buffers/MessageBuffer.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
index 5f48d2f5e..71c433aff 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
@@ -28,6 +28,8 @@
* Authors: Niket Agarwal
*/
+#include <cmath>
+
#include "mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh"
#include "mem/ruby/buffers/MessageBuffer.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh"
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc b/src/mem/ruby/network/simple/PerfectSwitch.cc
index fab699ea4..d60c5332c 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.cc
+++ b/src/mem/ruby/network/simple/PerfectSwitch.cc
@@ -295,7 +295,7 @@ void PerfectSwitch::wakeup()
}
}
-void PerfectSwitch::printStats(ostream& out) const
+void PerfectSwitch::printStats(std::ostream& out) const
{
out << "PerfectSwitch printStats" << endl;
}
@@ -304,11 +304,11 @@ void PerfectSwitch::clearStats()
{
}
-void PerfectSwitch::printConfig(ostream& out) const
+void PerfectSwitch::printConfig(std::ostream& out) const
{
}
-void PerfectSwitch::print(ostream& out) const
+void PerfectSwitch::print(std::ostream& out) const
{
out << "[PerfectSwitch " << m_switch_id << "]";
}
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.hh b/src/mem/ruby/network/simple/PerfectSwitch.hh
index 9cc28fff8..2956e261a 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.hh
+++ b/src/mem/ruby/network/simple/PerfectSwitch.hh
@@ -41,6 +41,8 @@
#ifndef PerfectSwitch_H
#define PerfectSwitch_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Consumer.hh"
@@ -76,11 +78,11 @@ public:
// Public Methods
void wakeup();
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
void clearStats();
- void printConfig(ostream& out) const;
+ void printConfig(std::ostream& out) const;
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private copy constructor and assignment operator
@@ -102,16 +104,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const PerfectSwitch& obj);
+std::ostream& operator<<(std::ostream& out, const PerfectSwitch& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const PerfectSwitch& obj)
+std::ostream& operator<<(std::ostream& out, const PerfectSwitch& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc
index 87021471f..88695250c 100644
--- a/src/mem/ruby/network/simple/Switch.cc
+++ b/src/mem/ruby/network/simple/Switch.cc
@@ -129,8 +129,10 @@ const Vector<Throttle*>* Switch::getThrottles() const
return &m_throttles;
}
-void Switch::printStats(ostream& out) const
+void Switch::printStats(std::ostream& out) const
{
+ using namespace std;
+
out << "switch_" << m_switch_id << "_inlinks: " << m_perfect_switch_ptr->getInLinks() << endl;
out << "switch_" << m_switch_id << "_outlinks: " << m_perfect_switch_ptr->getOutLinks() << endl;
@@ -188,7 +190,7 @@ void Switch::clearStats()
}
}
-void Switch::printConfig(ostream& out) const
+void Switch::printConfig(std::ostream& out) const
{
m_perfect_switch_ptr->printConfig(out);
for (int i=0; i<m_throttles.size(); i++) {
@@ -198,7 +200,7 @@ void Switch::printConfig(ostream& out) const
}
}
-void Switch::print(ostream& out) const
+void Switch::print(std::ostream& out) const
{
// FIXME printing
out << "[Switch]";
diff --git a/src/mem/ruby/network/simple/Switch.hh b/src/mem/ruby/network/simple/Switch.hh
index 193898928..aa719d555 100644
--- a/src/mem/ruby/network/simple/Switch.hh
+++ b/src/mem/ruby/network/simple/Switch.hh
@@ -44,6 +44,8 @@
#ifndef Switch_H
#define Switch_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/Vector.hh"
@@ -68,14 +70,14 @@ public:
void clearBuffers();
void reconfigureOutPort(const NetDest& routing_table_entry);
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
void clearStats();
- void printConfig(ostream& out) const;
+ void printConfig(std::ostream& out) const;
// Destructor
~Switch();
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private copy constructor and assignment operator
@@ -91,16 +93,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const Switch& obj);
+std::ostream& operator<<(std::ostream& out, const Switch& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const Switch& obj)
+std::ostream& operator<<(std::ostream& out, const Switch& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/network/simple/Topology.cc b/src/mem/ruby/network/simple/Topology.cc
index e7fbe1ce3..a8ce4db84 100644
--- a/src/mem/ruby/network/simple/Topology.cc
+++ b/src/mem/ruby/network/simple/Topology.cc
@@ -45,7 +45,6 @@
#include "mem/protocol/MachineType.hh"
#include "mem/protocol/Protocol.hh"
#include "mem/ruby/system/System.hh"
-#include <string>
static const int INFINITE_LATENCY = 10000; // Yes, this is a big hack
static const int DEFAULT_BW_MULTIPLIER = 1; // Just to be consistent with above :)
@@ -238,7 +237,7 @@ void Topology::makeLink(Network *net, SwitchID src, SwitchID dest, const NetDest
}
}
-void Topology::printStats(ostream& out) const
+void Topology::printStats(std::ostream& out) const
{
for (int cntrl = 0; cntrl < m_controller_vector.size(); cntrl++) {
m_controller_vector[cntrl]->printStats(out);
@@ -252,8 +251,10 @@ void Topology::clearStats()
}
}
-void Topology::printConfig(ostream& out) const
+void Topology::printConfig(std::ostream& out) const
{
+ using namespace std;
+
if (m_print_config == false) return;
assert(m_component_latencies.size() > 0);
diff --git a/src/mem/ruby/network/simple/Topology.hh b/src/mem/ruby/network/simple/Topology.hh
index c274ed330..7202c4446 100644
--- a/src/mem/ruby/network/simple/Topology.hh
+++ b/src/mem/ruby/network/simple/Topology.hh
@@ -47,6 +47,9 @@
#ifndef TOPOLOGY_H
#define TOPOLOGY_H
+#include <iostream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/Vector.hh"
#include "mem/ruby/system/NodeID.hh"
@@ -101,11 +104,11 @@ public:
void initNetworkPtr(Network* net_ptr);
- const string getName() { return m_name; }
- void printStats(ostream& out) const;
+ const std::string getName() { return m_name; }
+ void printStats(std::ostream& out) const;
void clearStats();
- void printConfig(ostream& out) const;
- void print(ostream& out) const { out << "[Topology]"; }
+ void printConfig(std::ostream& out) const;
+ void print(std::ostream& out) const { out << "[Topology]"; }
protected:
// Private Methods
@@ -117,13 +120,13 @@ protected:
// void makeSwitchesPerChip(Vector< Vector < SwitchID > > &nodePairs, Vector<int> &latencies, Vector<int> &bw_multis, int numberOfChips);
- string getDesignStr();
+ std::string getDesignStr();
// Private copy constructor and assignment operator
Topology(const Topology& obj);
Topology& operator=(const Topology& obj);
// Data Members (m_ prefix)
- string m_name;
+ std::string m_name;
bool m_print_config;
NodeID m_nodes;
int m_number_of_switches;
@@ -141,16 +144,16 @@ protected:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const Topology& obj);
+std::ostream& operator<<(std::ostream& out, const Topology& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const Topology& obj)
+std::ostream& operator<<(std::ostream& out, const Topology& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}