summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-03-10 18:33:11 -0800
committerNathan Binkert <nate@binkert.org>2010-03-10 18:33:11 -0800
commit140785d24c27f3afddbe95c9e504e27bf8274290 (patch)
treecc4d27a7d4e417a6cd0f0364cff3db67ca1825b7
parent1badec39a94397397a3c918bfcc75c71efc507ea (diff)
downloadgem5-140785d24c27f3afddbe95c9e504e27bf8274290.tar.xz
ruby: get rid of std-includes.hh
Do not use "using namespace std;" in headers Include header files as needed
-rw-r--r--src/cpu/rubytest/CheckTable.hh10
-rw-r--r--src/mem/gems_common/Map.hh37
-rw-r--r--src/mem/gems_common/PrioHeap.hh12
-rw-r--r--src/mem/gems_common/RefCnt.hh12
-rw-r--r--src/mem/gems_common/Vector.hh18
-rw-r--r--src/mem/gems_common/std-includes.hh57
-rw-r--r--src/mem/gems_common/util.cc6
-rw-r--r--src/mem/gems_common/util.hh12
-rw-r--r--src/mem/ruby/buffers/MessageBuffer.hh23
-rw-r--r--src/mem/ruby/buffers/MessageBufferNode.cc3
-rw-r--r--src/mem/ruby/buffers/MessageBufferNode.hh10
-rw-r--r--src/mem/ruby/common/Address.hh7
-rw-r--r--src/mem/ruby/common/Consumer.hh10
-rw-r--r--src/mem/ruby/common/DataBlock.hh15
-rw-r--r--src/mem/ruby/common/Debug.cc6
-rw-r--r--src/mem/ruby/common/Debug.hh15
-rw-r--r--src/mem/ruby/common/Global.hh1
-rw-r--r--src/mem/ruby/common/Histogram.cc5
-rw-r--r--src/mem/ruby/common/Histogram.hh14
-rw-r--r--src/mem/ruby/eventqueue/RubyEventQueue.hh10
-rw-r--r--src/mem/ruby/eventqueue/RubyEventQueueNode.cc2
-rw-r--r--src/mem/ruby/eventqueue/RubyEventQueueNode.hh10
-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
-rw-r--r--src/mem/ruby/profiler/CacheProfiler.hh17
-rw-r--r--src/mem/ruby/profiler/MemCntrlProfiler.cc2
-rw-r--r--src/mem/ruby/profiler/MemCntrlProfiler.hh17
-rw-r--r--src/mem/ruby/profiler/Profiler.cc7
-rw-r--r--src/mem/ruby/recorder/CacheRecorder.hh16
-rw-r--r--src/mem/ruby/recorder/Tracer.cc6
-rw-r--r--src/mem/ruby/recorder/Tracer.hh15
-rw-r--r--src/mem/ruby/slicc_interface/Message.hh10
-rw-r--r--src/mem/ruby/system/MachineID.hh11
-rw-r--r--src/mem/ruby/system/MemoryNode.cc2
-rw-r--r--src/mem/ruby/system/MemoryNode.hh10
-rw-r--r--src/mem/ruby/system/NodeID.hh4
-rw-r--r--src/mem/ruby/system/PseudoLRUPolicy.hh2
-rw-r--r--src/mem/slicc/symbols/StateMachine.py33
-rw-r--r--src/mem/slicc/symbols/Type.py28
45 files changed, 311 insertions, 238 deletions
diff --git a/src/cpu/rubytest/CheckTable.hh b/src/cpu/rubytest/CheckTable.hh
index 23726d26b..8b05e6541 100644
--- a/src/cpu/rubytest/CheckTable.hh
+++ b/src/cpu/rubytest/CheckTable.hh
@@ -31,6 +31,8 @@
#ifndef CHECKTABLE_H
#define CHECKTABLE_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/Vector.hh"
@@ -57,7 +59,7 @@ public:
// bool isTableFull() const;
// Need a method to select a check or retrieve a check
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
void addCheck(const Address& address);
@@ -75,16 +77,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const CheckTable& obj);
+std::ostream& operator<<(std::ostream& out, const CheckTable& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const CheckTable& obj)
+std::ostream& operator<<(std::ostream& out, const CheckTable& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/gems_common/Map.hh b/src/mem/gems_common/Map.hh
index 6e581d375..7b3c26279 100644
--- a/src/mem/gems_common/Map.hh
+++ b/src/mem/gems_common/Map.hh
@@ -34,12 +34,19 @@
#ifndef MAP_H
#define MAP_H
+#include <iostream>
+
#include "base/hashmap.hh"
#include "mem/gems_common/Vector.hh"
template <class KEY_TYPE, class VALUE_TYPE>
class Map
{
+ private:
+ typedef typename m5::hash_map<KEY_TYPE, VALUE_TYPE> MapType;
+ typedef typename MapType::iterator iterator;
+ typedef typename MapType::const_iterator const_iterator;
+
public:
Map() { /* empty */ }
~Map() { /* empty */ }
@@ -54,7 +61,7 @@ public:
void deleteValues();
VALUE_TYPE& lookup(const KEY_TYPE& key) const;
void clear() { m_map.clear(); }
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
// Synonyms
void remove(const KEY_TYPE& key) { erase(key); }
@@ -73,7 +80,8 @@ private:
};
template <class KEY_TYPE, class VALUE_TYPE>
-ostream& operator<<(ostream& out, const Map<KEY_TYPE, VALUE_TYPE>& map);
+std::ostream&
+operator<<(std::ostream& out, const Map<KEY_TYPE, VALUE_TYPE>& map);
// *********************
@@ -94,7 +102,7 @@ template <class KEY_TYPE, class VALUE_TYPE>
VALUE_TYPE& Map<KEY_TYPE, VALUE_TYPE>::lookup(const KEY_TYPE& key) const
{
if (!exist(key))
- cerr << *this << " is looking for " << key << endl;
+ std::cerr << *this << " is looking for " << key << std::endl;
assert(exist(key));
return m_map[key];
}
@@ -103,7 +111,7 @@ template <class KEY_TYPE, class VALUE_TYPE>
Vector<KEY_TYPE> Map<KEY_TYPE, VALUE_TYPE>::keys() const
{
Vector<KEY_TYPE> keys;
- typename hash_map<KEY_TYPE, VALUE_TYPE>::const_iterator iter;
+ const_iterator iter;
for (iter = m_map.begin(); iter != m_map.end(); iter++) {
keys.insertAtBottom((*iter).first);
}
@@ -114,8 +122,8 @@ template <class KEY_TYPE, class VALUE_TYPE>
Vector<VALUE_TYPE> Map<KEY_TYPE, VALUE_TYPE>::values() const
{
Vector<VALUE_TYPE> values;
- typename hash_map<KEY_TYPE, VALUE_TYPE>::const_iterator iter;
- pair<KEY_TYPE, VALUE_TYPE> p;
+ const_iterator iter;
+ std::pair<KEY_TYPE, VALUE_TYPE> p;
for (iter = m_map.begin(); iter != m_map.end(); iter++) {
p = *iter;
@@ -127,8 +135,8 @@ Vector<VALUE_TYPE> Map<KEY_TYPE, VALUE_TYPE>::values() const
template <class KEY_TYPE, class VALUE_TYPE>
void Map<KEY_TYPE, VALUE_TYPE>::deleteKeys()
{
- typename hash_map<KEY_TYPE, VALUE_TYPE>::const_iterator iter;
- pair<KEY_TYPE, VALUE_TYPE> p;
+ const_iterator iter;
+ std::pair<KEY_TYPE, VALUE_TYPE> p;
for (iter = m_map.begin(); iter != m_map.end(); iter++) {
p = *iter;
@@ -139,8 +147,8 @@ void Map<KEY_TYPE, VALUE_TYPE>::deleteKeys()
template <class KEY_TYPE, class VALUE_TYPE>
void Map<KEY_TYPE, VALUE_TYPE>::deleteValues()
{
- typename hash_map<KEY_TYPE, VALUE_TYPE>::const_iterator iter;
- pair<KEY_TYPE, VALUE_TYPE> p;
+ const_iterator iter;
+ std::pair<KEY_TYPE, VALUE_TYPE> p;
for (iter = m_map.begin(); iter != m_map.end(); iter++) {
p = *iter;
@@ -149,10 +157,10 @@ void Map<KEY_TYPE, VALUE_TYPE>::deleteValues()
}
template <class KEY_TYPE, class VALUE_TYPE>
-void Map<KEY_TYPE, VALUE_TYPE>::print(ostream& out) const
+void Map<KEY_TYPE, VALUE_TYPE>::print(std::ostream& out) const
{
- typename hash_map<KEY_TYPE, VALUE_TYPE>::const_iterator iter;
- pair<KEY_TYPE, VALUE_TYPE> p;
+ const_iterator iter;
+ std::pair<KEY_TYPE, VALUE_TYPE> p;
out << "[";
for (iter = m_map.begin(); iter != m_map.end(); iter++) {
@@ -164,7 +172,8 @@ void Map<KEY_TYPE, VALUE_TYPE>::print(ostream& out) const
}
template <class KEY_TYPE, class VALUE_TYPE>
-ostream& operator<<(ostream& out, const Map<KEY_TYPE, VALUE_TYPE>& map)
+std::ostream&
+operator<<(std::ostream& out, const Map<KEY_TYPE, VALUE_TYPE>& map)
{
map.print(out);
return out;
diff --git a/src/mem/gems_common/PrioHeap.hh b/src/mem/gems_common/PrioHeap.hh
index acdcc0eba..d6183cf40 100644
--- a/src/mem/gems_common/PrioHeap.hh
+++ b/src/mem/gems_common/PrioHeap.hh
@@ -29,6 +29,8 @@
#ifndef PRIOHEAP_H
#define PRIOHEAP_H
+#include <iostream>
+
#include "mem/gems_common/Vector.hh"
typedef unsigned int HeapIndex;
@@ -49,7 +51,7 @@ public:
const TYPE& peekMin() const;
const TYPE& peekElement(int index) const;
TYPE extractMin();
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
bool verifyHeap() const;
@@ -67,7 +69,7 @@ private:
// Output operator declaration
template <class TYPE>
-ostream& operator<<(ostream& out, const PrioHeap<TYPE>& obj);
+std::ostream& operator<<(std::ostream& out, const PrioHeap<TYPE>& obj);
// ******************* Helper Functions *******************
inline
@@ -210,7 +212,7 @@ void PrioHeap<TYPE>::heapify()
}
template <class TYPE>
-void PrioHeap<TYPE>::print(ostream& out) const
+void PrioHeap<TYPE>::print(std::ostream& out) const
{
Vector<TYPE> copyHeap(m_heap);
@@ -239,10 +241,10 @@ void PrioHeap<TYPE>::print(ostream& out) const
// Output operator definition
template <class TYPE>
-ostream& operator<<(ostream& out, const PrioHeap<TYPE>& obj)
+std::ostream& operator<<(std::ostream& out, const PrioHeap<TYPE>& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/gems_common/RefCnt.hh b/src/mem/gems_common/RefCnt.hh
index fc1ddbae9..75160fc80 100644
--- a/src/mem/gems_common/RefCnt.hh
+++ b/src/mem/gems_common/RefCnt.hh
@@ -29,6 +29,8 @@
#ifndef REFCNT_H
#define REFCNT_H
+#include <iostream>
+
template <class TYPE>
class RefCnt {
public:
@@ -44,7 +46,7 @@ public:
TYPE* ref() { return m_data_ptr; }
TYPE* mod_ref() const { return m_data_ptr; }
void freeRef();
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
// Public copy constructor and assignment operator
RefCnt(const RefCnt& obj);
@@ -61,7 +63,7 @@ private:
// Output operator declaration
template <class TYPE>
inline
-ostream& operator<<(ostream& out, const RefCnt<TYPE>& obj);
+std::ostream& operator<<(std::ostream& out, const RefCnt<TYPE>& obj);
// ******************* Definitions *******************
@@ -103,7 +105,7 @@ void RefCnt<TYPE>::freeRef()
template <class TYPE>
inline
-void RefCnt<TYPE>::print(ostream& out) const
+void RefCnt<TYPE>::print(std::ostream& out) const
{
if (m_data_ptr == NULL) {
out << "[RefCnt: Null]";
@@ -150,10 +152,10 @@ RefCnt<TYPE>& RefCnt<TYPE>::operator=(const RefCnt<TYPE>& obj)
// Output operator definition
template <class TYPE>
inline
-ostream& operator<<(ostream& out, const RefCnt<TYPE>& obj)
+std::ostream& operator<<(std::ostream& out, const RefCnt<TYPE>& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/gems_common/Vector.hh b/src/mem/gems_common/Vector.hh
index 7e648e7c9..e10849213 100644
--- a/src/mem/gems_common/Vector.hh
+++ b/src/mem/gems_common/Vector.hh
@@ -38,7 +38,9 @@
#ifndef VECTOR_H
#define VECTOR_H
-#include "mem/gems_common/std-includes.hh"
+#include <cassert>
+#include <iostream>
+#include <vector>
template <class TYPE>
class Vector
@@ -63,7 +65,7 @@ public:
// elements and sets them to NULL, can only
// be used when the TYPE is a pointer type.
void removeFromTop(int num); // removes elements from top
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
// Array Reference operator overloading
@@ -84,7 +86,7 @@ private:
};
template <class TYPE>
-ostream& operator<<(ostream& out, const Vector<TYPE>& vec);
+std::ostream& operator<<(std::ostream& out, const Vector<TYPE>& vec);
// *********************
@@ -139,7 +141,7 @@ void Vector<TYPE>::setSize(int new_size)
{
// FIXME - this should also decrease or shrink the size of the array at some point.
if (new_size > m_max_size) {
- grow(max((m_max_size+1)*2, new_size));
+ grow(std::max((m_max_size+1)*2, new_size));
}
m_size = new_size;
#ifndef NO_VECTOR_BOUNDS_CHECKS
@@ -154,7 +156,7 @@ void Vector<TYPE>::increaseSize(int new_size, const TYPE& reset)
{
assert(new_size >= m_size);
if (new_size >= m_max_size) {
- grow(max((m_max_size+1)*2, new_size));
+ grow(std::max((m_max_size+1)*2, new_size));
}
int old_size = m_size;
m_size = new_size;
@@ -243,7 +245,7 @@ void Vector<TYPE>::deletePointers()
}
template <class TYPE>
-void Vector<TYPE>::print(ostream& out) const
+void Vector<TYPE>::print(std::ostream& out) const
{
out << "[ ";
for(int i=0; i<m_size; i++) {
@@ -253,7 +255,7 @@ void Vector<TYPE>::print(ostream& out) const
out << ref(i);
}
out << " ]";
- out << flush;
+ out << std::flush;
}
// Copy constructor
@@ -325,7 +327,7 @@ void Vector<TYPE>::grow(int new_max_size)
}
template <class TYPE>
-ostream& operator<<(ostream& out, const Vector<TYPE>& vec)
+std::ostream& operator<<(std::ostream& out, const Vector<TYPE>& vec)
{
vec.print(out);
return out;
diff --git a/src/mem/gems_common/std-includes.hh b/src/mem/gems_common/std-includes.hh
deleted file mode 100644
index 0c5201d34..000000000
--- a/src/mem/gems_common/std-includes.hh
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * $Id: std-includes.hh,v 3.7 2003/02/24 21:05:24 xu Exp $
- */
-
-#ifndef INCLUDES_H
-#define INCLUDES_H
-
-#include <cstring>
-#include <iomanip>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <string>
-#include <ext/hash_map>
-#include <stdio.h>
-#include <math.h>
-#include <time.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <cassert>
-
-using namespace std;
-using namespace __gnu_cxx;
-
-typedef unsigned int uint;
-
-#endif //INCLUDES_H
diff --git a/src/mem/gems_common/util.cc b/src/mem/gems_common/util.cc
index d2ca8cb96..d7ce2e893 100644
--- a/src/mem/gems_common/util.cc
+++ b/src/mem/gems_common/util.cc
@@ -31,9 +31,13 @@
*/
#include <cassert>
+#include <iomanip>
+#include <sstream>
#include "mem/gems_common/util.hh"
+using namespace std;
+
// Split a string into a head and tail strings on the specified
// character. Return the head and the string passed in is modified by
// removing the head, leaving just the tail.
@@ -43,7 +47,7 @@ string string_split(string& str, char split_character)
string head = "";
string tail = "";
- uint counter = 0;
+ unsigned counter = 0;
while(counter < str.size()) {
if (str[counter] == split_character) {
counter++;
diff --git a/src/mem/gems_common/util.hh b/src/mem/gems_common/util.hh
index 7afe57a85..f5a86f325 100644
--- a/src/mem/gems_common/util.hh
+++ b/src/mem/gems_common/util.hh
@@ -33,13 +33,13 @@
#ifndef UTIL_H
#define UTIL_H
-#include "mem/gems_common/std-includes.hh"
+#include <string>
-string string_split(string& str, char split_character);
-string bool_to_string(bool value);
-string int_to_string(int n, bool zero_fill = false, int width = 0);
-float string_to_float(string& str);
-bool string_to_bool(const string & str);
+std::string string_split(std::string& str, char split_character);
+std::string bool_to_string(bool value);
+std::string int_to_string(int n, bool zero_fill = false, int width = 0);
+float string_to_float(std::string& str);
+bool string_to_bool(const std::string & str);
int log_int(long long n);
bool is_power_of_2(long long n);
diff --git a/src/mem/ruby/buffers/MessageBuffer.hh b/src/mem/ruby/buffers/MessageBuffer.hh
index 950423ee5..8d5a8de25 100644
--- a/src/mem/ruby/buffers/MessageBuffer.hh
+++ b/src/mem/ruby/buffers/MessageBuffer.hh
@@ -38,6 +38,9 @@
#ifndef MESSAGEBUFFER_H
#define MESSAGEBUFFER_H
+#include <iostream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/buffers/MessageBufferNode.hh"
#include "mem/ruby/common/Consumer.hh"
@@ -49,13 +52,13 @@
class MessageBuffer {
public:
// Constructors
- MessageBuffer(const string &name = "");
+ MessageBuffer(const std::string &name = "");
// ~MessageBuffer()
// Public Methods
- static void printConfig(ostream& out) {}
+ static void printConfig(std::ostream& out) {}
void setRecycleLatency(int recycle_latency) { m_recycle_latency = recycle_latency; }
// TRUE if head of queue timestamp <= SystemTime
@@ -73,8 +76,8 @@ public:
int getPriority() { return m_priority_rank; }
void setPriority(int rank) { m_priority_rank = rank; }
void setConsumer(Consumer* consumer_ptr) { ASSERT(m_consumer_ptr==NULL); m_consumer_ptr = consumer_ptr; }
- void setDescription(const string& name) { m_name = name; }
- string getDescription() { return m_name;}
+ void setDescription(const std::string& name) { m_name = name; }
+ std::string getDescription() { return m_name;}
Consumer* getConsumer() { return m_consumer_ptr; }
@@ -102,8 +105,8 @@ public:
void clear();
- void print(ostream& out) const;
- void printStats(ostream& out);
+ void print(std::ostream& out) const;
+ void printStats(std::ostream& out);
void clearStats() { m_not_avail_count = 0; m_msg_counter = 0; }
private:
@@ -120,7 +123,7 @@ private:
// Data Members (m_ prefix)
Consumer* m_consumer_ptr; // Consumer to signal a wakeup(), can be NULL
PrioHeap<MessageBufferNode> m_prio_heap;
- string m_name;
+ std::string m_name;
int m_max_size;
int m_size;
@@ -145,16 +148,16 @@ private:
// Output operator declaration
//template <class TYPE>
-ostream& operator<<(ostream& out, const MessageBuffer& obj);
+std::ostream& operator<<(std::ostream& out, const MessageBuffer& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MessageBuffer& obj)
+std::ostream& operator<<(std::ostream& out, const MessageBuffer& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/buffers/MessageBufferNode.cc b/src/mem/ruby/buffers/MessageBufferNode.cc
index 22b077363..aec977acd 100644
--- a/src/mem/ruby/buffers/MessageBufferNode.cc
+++ b/src/mem/ruby/buffers/MessageBufferNode.cc
@@ -29,7 +29,8 @@
#include "mem/ruby/buffers/MessageBufferNode.hh"
-void MessageBufferNode::print(ostream& out) const
+void
+MessageBufferNode::print(std::ostream& out) const
{
out << "[";
out << m_time << ", ";
diff --git a/src/mem/ruby/buffers/MessageBufferNode.hh b/src/mem/ruby/buffers/MessageBufferNode.hh
index cb64974d5..747c1d889 100644
--- a/src/mem/ruby/buffers/MessageBufferNode.hh
+++ b/src/mem/ruby/buffers/MessageBufferNode.hh
@@ -30,6 +30,8 @@
#ifndef MESSAGEBUFFERNODE_H
#define MESSAGEBUFFERNODE_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/slicc_interface/Message.hh"
@@ -43,7 +45,7 @@ public:
//~MessageBufferNode();
// Public Methods
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
@@ -59,7 +61,7 @@ public:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const MessageBufferNode& obj);
+std::ostream& operator<<(std::ostream& out, const MessageBufferNode& obj);
// ******************* Definitions *******************
@@ -78,10 +80,10 @@ bool node_less_then_eq(const MessageBufferNode& n1, const MessageBufferNode& n2)
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MessageBufferNode& obj)
+std::ostream& operator<<(std::ostream& out, const MessageBufferNode& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/common/Address.hh b/src/mem/ruby/common/Address.hh
index 88cd2668a..44dff7d83 100644
--- a/src/mem/ruby/common/Address.hh
+++ b/src/mem/ruby/common/Address.hh
@@ -35,6 +35,8 @@
#define ADDRESS_H
#include <iomanip>
+
+#include "base/hashmap.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/System.hh"
#include "mem/ruby/system/NodeID.hh"
@@ -223,11 +225,12 @@ ADDRESS_WIDTH MEMORY_SIZE_BITS PAGE_SIZE_BITS DATA_BLOCK_BITS
inline
void Address::print(ostream& out) const
{
- out << "[" << hex << "0x" << m_address << "," << " line 0x" << maskLowOrderBits(RubySystem::getBlockSizeBits()) << dec << "]" << flush;
+ using namespace std;
+ out << "[" << hex << "0x" << m_address << "," << " line 0x" << maskLowOrderBits(RubySystem::getBlockSizeBits()) << dec << "]" << flush;
}
class Address;
-namespace __gnu_cxx {
+namespace __hash_namespace {
template <> struct hash<Address>
{
size_t operator()(const Address &s) const { return (size_t) s.getAddress(); }
diff --git a/src/mem/ruby/common/Consumer.hh b/src/mem/ruby/common/Consumer.hh
index beb50a891..955c1ffa9 100644
--- a/src/mem/ruby/common/Consumer.hh
+++ b/src/mem/ruby/common/Consumer.hh
@@ -39,6 +39,8 @@
#ifndef CONSUMER_H
#define CONSUMER_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/eventqueue/RubyEventQueue.hh"
@@ -56,7 +58,7 @@ public:
// void triggerWakeup() { Time time = g_eventQueue_ptr->getTime(); if (m_last_wakeup != time) { wakeup(); m_last_wakeup = time; }}
void triggerWakeup(RubyEventQueue * eventQueue) { Time time = eventQueue->getTime(); if (m_last_wakeup != time) { wakeup(); m_last_wakeup = time; }}
virtual void wakeup() = 0;
- virtual void print(ostream& out) const = 0;
+ virtual void print(std::ostream& out) const = 0;
const Time& getLastScheduledWakeup() const { return m_last_scheduled_wakeup; }
void setLastScheduledWakeup(const Time& time) { m_last_scheduled_wakeup = time; }
@@ -70,16 +72,16 @@ private:
// Output operator declaration
inline extern
-ostream& operator<<(ostream& out, const Consumer& obj);
+std::ostream& operator<<(std::ostream& out, const Consumer& obj);
// ******************* Definitions *******************
// Output operator definition
inline extern
-ostream& operator<<(ostream& out, const Consumer& obj)
+std::ostream& operator<<(std::ostream& out, const Consumer& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh
index d62efc72b..5407033bf 100644
--- a/src/mem/ruby/common/DataBlock.hh
+++ b/src/mem/ruby/common/DataBlock.hh
@@ -30,6 +30,9 @@
#ifndef DATABLOCK_H
#define DATABLOCK_H
+#include <iomanip>
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/System.hh"
#include "mem/gems_common/Vector.hh"
@@ -63,7 +66,7 @@ class DataBlock {
void setData(uint8* data, int offset, int len);
void copyPartial(const DataBlock & dblk, int offset, int len);
bool equal(const DataBlock& obj) const;
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
void alloc();
@@ -73,7 +76,7 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const DataBlock& obj);
+std::ostream& operator<<(std::ostream& out, const DataBlock& obj);
bool operator==(const DataBlock& obj1, const DataBlock& obj2);
@@ -110,8 +113,10 @@ bool DataBlock::equal(const DataBlock& obj) const
}
inline
-void DataBlock::print(ostream& out) const
+void DataBlock::print(std::ostream& out) const
{
+ using namespace std;
+
int size = RubySystem::getBlockSizeBytes();
out << "[ ";
for (int i = 0; i < size; i++) {
@@ -157,10 +162,10 @@ void DataBlock::copyPartial(const DataBlock & dblk, int offset, int len)
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const DataBlock& obj)
+std::ostream& operator<<(std::ostream& out, const DataBlock& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/common/Debug.cc b/src/mem/ruby/common/Debug.cc
index 68ab2448b..e67dc68ba 100644
--- a/src/mem/ruby/common/Debug.cc
+++ b/src/mem/ruby/common/Debug.cc
@@ -41,9 +41,11 @@
#include "mem/gems_common/util.hh"
#include "base/misc.hh"
+using namespace std;
+
class Debug;
extern Debug* g_debug_ptr;
-std::ostream * debug_cout_ptr;
+ostream *debug_cout_ptr;
bool Debug::m_protocol_trace = false;
struct DebugComponentData
@@ -328,7 +330,7 @@ void Debug::setDebugOutputFile (const char * filename)
if (m_fout.is_open() ) {
m_fout.close ();
}
- m_fout.open (filename, std::ios::out);
+ m_fout.open (filename, ios::out);
if (! m_fout.is_open() ) {
cerr << "setDebugOutputFile: can't open file " << filename << endl;
}
diff --git a/src/mem/ruby/common/Debug.hh b/src/mem/ruby/common/Debug.hh
index 5fb4d412f..a7b1a15d1 100644
--- a/src/mem/ruby/common/Debug.hh
+++ b/src/mem/ruby/common/Debug.hh
@@ -35,6 +35,8 @@
#define __MEM_RUBY_DEBUG_HH__
#include <unistd.h>
+
+#include <fstream>
#include <iostream>
#include <string>
#include <vector>
@@ -133,7 +135,7 @@ extern inline
std::ostream& operator<<(std::ostream& out, const Debug& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
@@ -151,6 +153,7 @@ const bool ASSERT_FLAG = true;
#undef ASSERT
#define ASSERT(EXPR)\
{\
+ using namespace std;\
if (ASSERT_FLAG) {\
if (!(EXPR)) {\
cerr << "failed assertion '"\
@@ -179,6 +182,7 @@ const bool ASSERT_FLAG = true;
#define BREAK(X)\
{\
+ using namespace std;\
cerr << "breakpoint '"\
<< #X << "' reached at fn "\
<< __PRETTY_FUNCTION__ << " in "\
@@ -195,6 +199,7 @@ const bool ASSERT_FLAG = true;
#define ERROR_MSG(MESSAGE)\
{\
+ using namespace std;\
if (ERROR_MESSAGE_FLAG) {\
cerr << "Fatal Error: in fn "\
<< __PRETTY_FUNCTION__ << " in "\
@@ -212,6 +217,7 @@ const bool ASSERT_FLAG = true;
#define WARN_MSG(MESSAGE)\
{\
+ using namespace std;\
if (WARNING_MESSAGE_FLAG) {\
cerr << "Warning: in fn "\
<< __PRETTY_FUNCTION__ << " in "\
@@ -228,6 +234,7 @@ const bool ASSERT_FLAG = true;
#define WARN_EXPR(EXPR)\
{\
+ using namespace std;\
if (WARNING_MESSAGE_FLAG) {\
cerr << "Warning: in fn "\
<< __PRETTY_FUNCTION__ << " in "\
@@ -246,6 +253,7 @@ const bool ASSERT_FLAG = true;
#define DEBUG_MSG(module, priority, MESSAGE)\
{\
+ using namespace std;\
if (RUBY_DEBUG) {\
if (g_debug_ptr->validDebug(module, priority)) {\
(* debug_cout_ptr) << "Debug: in fn "\
@@ -259,6 +267,7 @@ const bool ASSERT_FLAG = true;
#define DEBUG_EXPR(module, priority, EXPR)\
{\
+ using namespace std;\
if (RUBY_DEBUG) {\
if (g_debug_ptr->validDebug(module, priority)) {\
(* debug_cout_ptr) << "Debug: in fn "\
@@ -273,6 +282,7 @@ const bool ASSERT_FLAG = true;
#define DEBUG_NEWLINE(module, priority)\
{\
+ using namespace std;\
if (RUBY_DEBUG) {\
if (g_debug_ptr->validDebug(module, priority)) {\
(* debug_cout_ptr) << endl << flush;\
@@ -282,6 +292,7 @@ const bool ASSERT_FLAG = true;
#define DEBUG_SLICC(priority, LINE, MESSAGE)\
{\
+ using namespace std;\
if (RUBY_DEBUG) {\
if (g_debug_ptr->validDebug(SLICC_COMP, priority)) {\
(* debug_cout_ptr) << (LINE) << (MESSAGE) << endl << flush;\
@@ -291,6 +302,7 @@ const bool ASSERT_FLAG = true;
#define DEBUG_OUT( rest... ) \
{\
+ using namespace std;\
if (RUBY_DEBUG) {\
cout << "Debug: in fn "\
<< __PRETTY_FUNCTION__\
@@ -302,6 +314,7 @@ const bool ASSERT_FLAG = true;
#define ERROR_OUT( rest... ) \
{\
+ using namespace std;\
if (ERROR_MESSAGE_FLAG) {\
cout << "error: in fn "\
<< __PRETTY_FUNCTION__ << " in "\
diff --git a/src/mem/ruby/common/Global.hh b/src/mem/ruby/common/Global.hh
index 591ffed1e..16465656d 100644
--- a/src/mem/ruby/common/Global.hh
+++ b/src/mem/ruby/common/Global.hh
@@ -66,7 +66,6 @@ const bool TWO_LEVEL_CACHE = true;
// external includes for all classes
#include "mem/ruby/common/TypeDefines.hh"
-#include "mem/gems_common/std-includes.hh"
#include "mem/ruby/common/Debug.hh"
// simple type declarations
diff --git a/src/mem/ruby/common/Histogram.cc b/src/mem/ruby/common/Histogram.cc
index 7f9a7027e..2a25cfeb1 100644
--- a/src/mem/ruby/common/Histogram.cc
+++ b/src/mem/ruby/common/Histogram.cc
@@ -32,8 +32,13 @@
*
*/
+#include <cmath>
+#include <iomanip>
+
#include "mem/ruby/common/Histogram.hh"
+using namespace std;
+
Histogram::Histogram(int binsize, int bins)
{
m_binsize = binsize;
diff --git a/src/mem/ruby/common/Histogram.hh b/src/mem/ruby/common/Histogram.hh
index 59afde867..64247d64a 100644
--- a/src/mem/ruby/common/Histogram.hh
+++ b/src/mem/ruby/common/Histogram.hh
@@ -37,6 +37,8 @@
#ifndef HISTOGRAM_H
#define HISTOGRAM_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/Vector.hh"
@@ -61,9 +63,9 @@ public:
int64 getTotal() const { return m_sumSamples; }
int64 getData(int index) const { return m_data[index]; }
- void printWithMultiplier(ostream& out, double multiplier) const;
- void printPercent(ostream& out) const;
- void print(ostream& out) const;
+ void printWithMultiplier(std::ostream& out, double multiplier) const;
+ void printPercent(std::ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
@@ -88,16 +90,16 @@ private:
bool node_less_then_eq(const Histogram* n1, const Histogram* n2);
// Output operator declaration
-ostream& operator<<(ostream& out, const Histogram& obj);
+std::ostream& operator<<(std::ostream& out, const Histogram& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const Histogram& obj)
+std::ostream& operator<<(std::ostream& out, const Histogram& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/eventqueue/RubyEventQueue.hh b/src/mem/ruby/eventqueue/RubyEventQueue.hh
index f9b4aa060..468b21edb 100644
--- a/src/mem/ruby/eventqueue/RubyEventQueue.hh
+++ b/src/mem/ruby/eventqueue/RubyEventQueue.hh
@@ -59,6 +59,8 @@
#ifndef RUBYEVENTQUEUE_H
#define RUBYEVENTQUEUE_H
+#include <iostream>
+
#include "config/no_vector_bounds_checks.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/Vector.hh"
@@ -82,7 +84,7 @@ public:
Tick getClock() const { return m_clock; }
void scheduleEvent(Consumer* consumer, Time timeDelta);
void scheduleEventAbsolute(Consumer* consumer, Time timeAbs);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
void triggerEvents(Time t) { assert(0); }
void triggerAllEvents() { assert(0); }
@@ -99,16 +101,16 @@ private:
// Output operator declaration
inline extern
-ostream& operator<<(ostream& out, const RubyEventQueue& obj);
+std::ostream& operator<<(std::ostream& out, const RubyEventQueue& obj);
// ******************* Definitions *******************
// Output operator definition
inline extern
-ostream& operator<<(ostream& out, const RubyEventQueue& obj)
+std::ostream& operator<<(std::ostream& out, const RubyEventQueue& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/eventqueue/RubyEventQueueNode.cc b/src/mem/ruby/eventqueue/RubyEventQueueNode.cc
index 5034069cc..31aa2088a 100644
--- a/src/mem/ruby/eventqueue/RubyEventQueueNode.cc
+++ b/src/mem/ruby/eventqueue/RubyEventQueueNode.cc
@@ -34,7 +34,7 @@
#include "mem/ruby/eventqueue/RubyEventQueueNode.hh"
-void RubyEventQueueNode::print(ostream& out) const
+void RubyEventQueueNode::print(std::ostream& out) const
{
out << "[";
if (m_consumer_ptr != NULL) {
diff --git a/src/mem/ruby/eventqueue/RubyEventQueueNode.hh b/src/mem/ruby/eventqueue/RubyEventQueueNode.hh
index 3b0c23162..dc2fc92e7 100644
--- a/src/mem/ruby/eventqueue/RubyEventQueueNode.hh
+++ b/src/mem/ruby/eventqueue/RubyEventQueueNode.hh
@@ -35,6 +35,8 @@
#ifndef RUBYEVENTQUEUENODE_H
#define RUBYEVENTQUEUENODE_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "sim/eventq.hh"
#include "mem/ruby/common/Consumer.hh"
@@ -53,7 +55,7 @@ public:
//~RubyEventQueueNode();
// Public Methods
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
virtual void process() { m_consumer_ptr->wakeup(); }
virtual const char *description() const { return "Ruby Event"; }
@@ -68,16 +70,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const RubyEventQueueNode& obj);
+std::ostream& operator<<(std::ostream& out, const RubyEventQueueNode& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const RubyEventQueueNode& obj)
+std::ostream& operator<<(std::ostream& out, const RubyEventQueueNode& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
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;
}
diff --git a/src/mem/ruby/profiler/CacheProfiler.hh b/src/mem/ruby/profiler/CacheProfiler.hh
index 6c5fbb988..11f189148 100644
--- a/src/mem/ruby/profiler/CacheProfiler.hh
+++ b/src/mem/ruby/profiler/CacheProfiler.hh
@@ -39,6 +39,9 @@
#ifndef CACHEPROFILER_H
#define CACHEPROFILER_H
+#include <iostream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
#include "mem/ruby/common/Histogram.hh"
@@ -51,18 +54,18 @@ template <class TYPE> class Vector;
class CacheProfiler {
public:
// Constructors
- CacheProfiler(const string& description);
+ CacheProfiler(const std::string& description);
// Destructor
~CacheProfiler();
// Public Methods
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
void clearStats();
void addStatSample(CacheRequestType requestType, AccessModeType type, int msgSize, PrefetchBit pfBit);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
@@ -71,7 +74,7 @@ private:
CacheProfiler& operator=(const CacheProfiler& obj);
// Data Members (m_ prefix)
- string m_description;
+ std::string m_description;
Histogram m_requestSize;
int64 m_misses;
int64 m_demand_misses;
@@ -84,16 +87,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const CacheProfiler& obj);
+std::ostream& operator<<(std::ostream& out, const CacheProfiler& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const CacheProfiler& obj)
+std::ostream& operator<<(std::ostream& out, const CacheProfiler& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/profiler/MemCntrlProfiler.cc b/src/mem/ruby/profiler/MemCntrlProfiler.cc
index 693d43dc7..b41d7de78 100644
--- a/src/mem/ruby/profiler/MemCntrlProfiler.cc
+++ b/src/mem/ruby/profiler/MemCntrlProfiler.cc
@@ -29,6 +29,8 @@
#include "mem/ruby/profiler/MemCntrlProfiler.hh"
+using namespace std;
+
MemCntrlProfiler::MemCntrlProfiler(const string& description,
int banks_per_rank,
int ranks_per_dimm,
diff --git a/src/mem/ruby/profiler/MemCntrlProfiler.hh b/src/mem/ruby/profiler/MemCntrlProfiler.hh
index 5343fac1b..ebedd5185 100644
--- a/src/mem/ruby/profiler/MemCntrlProfiler.hh
+++ b/src/mem/ruby/profiler/MemCntrlProfiler.hh
@@ -39,6 +39,9 @@
#ifndef MEM_CNTRL_PROFILER_H
#define MEM_CNTRL_PROFILER_H
+#include <iostream>
+#include <string>
+
#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Global.hh"
@@ -47,7 +50,7 @@ template <class TYPE> class Vector;
class MemCntrlProfiler {
public:
// Constructors
- MemCntrlProfiler(const string& description,
+ MemCntrlProfiler(const std::string& description,
int banks_per_rank,
int ranks_per_dimm,
int dimms_per_channel);
@@ -56,7 +59,7 @@ public:
~MemCntrlProfiler();
// Public Methods
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
void clearStats();
void profileMemReq(int bank);
@@ -75,7 +78,7 @@ public:
void profileMemRandBusy();
void profileMemNotOld();
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
@@ -84,7 +87,7 @@ private:
MemCntrlProfiler& operator=(const MemCntrlProfiler& obj);
// Data Members (m_ prefix)
- string m_description;
+ std::string m_description;
uint64 m_memReq;
uint64 m_memBankBusy;
uint64 m_memBusBusy;
@@ -107,16 +110,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const MemCntrlProfiler& obj);
+std::ostream& operator<<(std::ostream& out, const MemCntrlProfiler& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MemCntrlProfiler& obj)
+std::ostream& operator<<(std::ostream& out, const MemCntrlProfiler& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index f09b93216..33425371f 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -51,6 +51,10 @@
*
*/
+// Allows use of times() library call, which determines virtual runtime
+#include <sys/resource.h>
+#include <sys/times.h>
+
#include "mem/ruby/profiler/Profiler.hh"
#include "mem/ruby/profiler/AddressProfiler.hh"
#include "mem/ruby/system/System.hh"
@@ -65,9 +69,6 @@
#include "mem/ruby/system/System.hh"
-// Allows use of times() library call, which determines virtual runtime
-#include <sys/times.h>
-
extern std::ostream * debug_cout_ptr;
static double process_memory_total();
diff --git a/src/mem/ruby/recorder/CacheRecorder.hh b/src/mem/ruby/recorder/CacheRecorder.hh
index 88cc5eaca..2616f73ae 100644
--- a/src/mem/ruby/recorder/CacheRecorder.hh
+++ b/src/mem/ruby/recorder/CacheRecorder.hh
@@ -38,11 +38,13 @@
#ifndef CACHERECORDER_H
#define CACHERECORDER_H
-#include "mem/ruby/libruby_internal.hh"
+#include <iostream>
+#include <string>
+#include "mem/protocol/CacheRequestType.hh"
#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/libruby_internal.hh"
#include "mem/ruby/system/NodeID.hh"
-#include "mem/protocol/CacheRequestType.hh"
template <class TYPE> class PrioHeap;
class Address;
@@ -63,9 +65,9 @@ public:
const Address& pc_addr,
RubyRequestType type,
Time time);
- int dumpRecords(string filename);
+ int dumpRecords(std::string filename);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
@@ -78,16 +80,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const CacheRecorder& obj);
+std::ostream& operator<<(std::ostream& out, const CacheRecorder& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const CacheRecorder& obj)
+std::ostream& operator<<(std::ostream& out, const CacheRecorder& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/recorder/Tracer.cc b/src/mem/ruby/recorder/Tracer.cc
index b58fa1eb6..5a20c2b02 100644
--- a/src/mem/ruby/recorder/Tracer.cc
+++ b/src/mem/ruby/recorder/Tracer.cc
@@ -62,7 +62,7 @@ void Tracer::init()
{
}
-void Tracer::startTrace(string filename)
+void Tracer::startTrace(std::string filename)
{
if (m_enabled) {
stopTrace();
@@ -101,7 +101,7 @@ void Tracer::traceRequest(Sequencer* sequencer,
}
// Class method
-int Tracer::playbackTrace(string filename)
+int Tracer::playbackTrace(std::string filename)
{
igzstream in(filename.c_str());
if (in.fail()) {
@@ -147,7 +147,7 @@ int Tracer::playbackTrace(string filename)
return counter;
}
-void Tracer::print(ostream& out) const
+void Tracer::print(std::ostream& out) const
{
}
diff --git a/src/mem/ruby/recorder/Tracer.hh b/src/mem/ruby/recorder/Tracer.hh
index 16432f5fc..a068c32eb 100644
--- a/src/mem/ruby/recorder/Tracer.hh
+++ b/src/mem/ruby/recorder/Tracer.hh
@@ -38,6 +38,9 @@
#ifndef TRACER_H
#define TRACER_H
+#include <iostream>
+#include <string>
+
#include "mem/ruby/libruby_internal.hh"
#include "mem/ruby/common/Global.hh"
@@ -65,7 +68,7 @@ public:
~Tracer();
// Public Methods
- void startTrace(string filename);
+ void startTrace(std::string filename);
void stopTrace();
bool traceEnabled() { return m_enabled; }
void traceRequest(Sequencer* sequencer,
@@ -74,10 +77,10 @@ public:
RubyRequestType type,
Time time);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
// Public Class Methods
- int playbackTrace(string filename);
+ int playbackTrace(std::string filename);
void init();
private:
// Private Methods
@@ -95,16 +98,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const Tracer& obj);
+std::ostream& operator<<(std::ostream& out, const Tracer& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const Tracer& obj)
+std::ostream& operator<<(std::ostream& out, const Tracer& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/slicc_interface/Message.hh b/src/mem/ruby/slicc_interface/Message.hh
index c8917795b..fef4bdf59 100644
--- a/src/mem/ruby/slicc_interface/Message.hh
+++ b/src/mem/ruby/slicc_interface/Message.hh
@@ -34,6 +34,8 @@
#ifndef MESSAGE_H
#define MESSAGE_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/RefCnt.hh"
#include "mem/gems_common/RefCountable.hh"
@@ -53,7 +55,7 @@ public:
// Public Methods
virtual Message* clone() const = 0;
virtual void destroy() = 0;
- virtual void print(ostream& out) const = 0;
+ virtual void print(std::ostream& out) const = 0;
void setDelayedCycles(const int& cycles) { m_DelayedCycles = cycles; }
const int& getDelayedCycles() const {return m_DelayedCycles;}
@@ -75,16 +77,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const Message& obj);
+std::ostream& operator<<(std::ostream& out, const Message& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const Message& obj)
+std::ostream& operator<<(std::ostream& out, const Message& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/system/MachineID.hh b/src/mem/ruby/system/MachineID.hh
index 5bfa1584c..9da71f349 100644
--- a/src/mem/ruby/system/MachineID.hh
+++ b/src/mem/ruby/system/MachineID.hh
@@ -39,6 +39,9 @@
#ifndef MACHINEID_H
#define MACHINEID_H
+#include <iostream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/util.hh"
#include "mem/protocol/MachineType.hh"
@@ -49,7 +52,7 @@ struct MachineID {
};
extern inline
-string MachineIDToString (MachineID machine) {
+std::string MachineIDToString (MachineID machine) {
return MachineType_to_string(machine.type)+"_"+int_to_string(machine.num);
}
@@ -66,13 +69,13 @@ bool operator!=(const MachineID & obj1, const MachineID & obj2)
}
// Output operator declaration
-ostream& operator<<(ostream& out, const MachineID& obj);
+std::ostream& operator<<(std::ostream& out, const MachineID& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MachineID& obj)
+std::ostream& operator<<(std::ostream& out, const MachineID& obj)
{
if ((obj.type < MachineType_NUM) && (obj.type >= MachineType_FIRST)) {
out << MachineType_to_string(obj.type);
@@ -81,7 +84,7 @@ ostream& operator<<(ostream& out, const MachineID& obj)
}
out << "-";
out << obj.num;
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/system/MemoryNode.cc b/src/mem/ruby/system/MemoryNode.cc
index 3ab3d05ef..5b74f497a 100644
--- a/src/mem/ruby/system/MemoryNode.cc
+++ b/src/mem/ruby/system/MemoryNode.cc
@@ -28,6 +28,8 @@
#include "mem/ruby/system/MemoryNode.hh"
+using namespace std;
+
void MemoryNode::print(ostream& out) const
{
out << "[";
diff --git a/src/mem/ruby/system/MemoryNode.hh b/src/mem/ruby/system/MemoryNode.hh
index 95d4227f9..d56057dee 100644
--- a/src/mem/ruby/system/MemoryNode.hh
+++ b/src/mem/ruby/system/MemoryNode.hh
@@ -28,6 +28,8 @@
#ifndef MEMORYNODE_H
#define MEMORYNODE_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/slicc_interface/Message.hh"
#include "mem/protocol/MemoryRequestType.hh"
@@ -61,7 +63,7 @@ public:
~MemoryNode() {};
// Public Methods
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
// Data Members (m_ prefix) (all public -- this is really more a struct)
@@ -74,16 +76,16 @@ public:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const MemoryNode& obj);
+std::ostream& operator<<(std::ostream& out, const MemoryNode& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MemoryNode& obj)
+std::ostream& operator<<(std::ostream& out, const MemoryNode& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/system/NodeID.hh b/src/mem/ruby/system/NodeID.hh
index e5d5f4d98..6191ad489 100644
--- a/src/mem/ruby/system/NodeID.hh
+++ b/src/mem/ruby/system/NodeID.hh
@@ -39,12 +39,14 @@
#ifndef NODEID_H
#define NODEID_H
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/util.hh"
typedef int NodeID;
extern inline
-string NodeIDToString (NodeID node) { return int_to_string(node); }
+std::string NodeIDToString (NodeID node) { return int_to_string(node); }
#endif //NODEID_H
diff --git a/src/mem/ruby/system/PseudoLRUPolicy.hh b/src/mem/ruby/system/PseudoLRUPolicy.hh
index 57a0b40e9..fbbe5191a 100644
--- a/src/mem/ruby/system/PseudoLRUPolicy.hh
+++ b/src/mem/ruby/system/PseudoLRUPolicy.hh
@@ -2,6 +2,8 @@
#ifndef PSEUDOLRUPOLICY_H
#define PSEUDOLRUPOLICY_H
+#include <cmath>
+
#include "mem/ruby/system/AbstractReplacementPolicy.hh"
/**
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index 5da42a6d5..e86b4245a 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -196,6 +196,10 @@ class $py_ident(RubyController):
#ifndef ${ident}_CONTROLLER_H
#define ${ident}_CONTROLLER_H
+#include <iostream>
+#include <sstream>
+#include <string>
+
#include "params/$c_ident.hh"
#include "mem/ruby/common/Global.hh"
@@ -214,7 +218,7 @@ class $py_ident(RubyController):
# for adding information to the protocol debug trace
code('''
-extern stringstream ${ident}_transitionComment;
+extern std::stringstream ${ident}_transitionComment;
class $c_ident : public AbstractController {
#ifdef CHECK_COHERENCE
@@ -226,14 +230,14 @@ public:
void init();
MessageBuffer* getMandatoryQueue() const;
const int & getVersion() const;
- const string toString() const;
- const string getName() const;
+ const std::string toString() const;
+ const std::string getName() const;
const MachineType getMachineType() const;
void initNetworkPtr(Network* net_ptr) { m_net_ptr = net_ptr; }
- void print(ostream& out) const;
- void printConfig(ostream& out) const;
+ void print(std::ostream& out) const;
+ void printConfig(std::ostream& out) const;
void wakeup();
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
void clearStats();
void blockOnQueue(Address addr, MessageBuffer* port);
void unblock(Address addr);
@@ -253,11 +257,11 @@ int m_number_of_TBEs;
TransitionResult doTransition(${ident}_Event event, ${ident}_State state, const Address& addr); // in ${ident}_Transitions.cc
TransitionResult doTransitionWorker(${ident}_Event event, ${ident}_State state, ${ident}_State& next_state, const Address& addr); // in ${ident}_Transitions.cc
-string m_name;
+std::string m_name;
int m_transitions_per_cycle;
int m_buffer_size;
int m_recycle_latency;
-map< string, string > m_cfg;
+map<std::string, std::string> m_cfg;
NodeID m_version;
Network* m_net_ptr;
MachineID m_machineID;
@@ -312,6 +316,9 @@ static int m_num_controllers;
* Created by slicc definition of Module "${{self.short}}"
*/
+#include <sstream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/slicc_interface/RubySlicc_includes.hh"
#include "mem/protocol/${ident}_Controller.hh"
@@ -319,6 +326,8 @@ static int m_num_controllers;
#include "mem/protocol/${ident}_Event.hh"
#include "mem/protocol/Types.hh"
#include "mem/ruby/system/System.hh"
+
+using namespace std;
''')
# include object classes
@@ -863,6 +872,8 @@ if (!%s.areNSlotsAvailable(%s)) {
#ifndef ${ident}_PROFILER_H
#define ${ident}_PROFILER_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/protocol/${ident}_State.hh"
#include "mem/protocol/${ident}_Event.hh"
@@ -873,7 +884,7 @@ class ${ident}_Profiler {
void setVersion(int version);
void countTransition(${ident}_State state, ${ident}_Event event);
void possibleTransition(${ident}_State state, ${ident}_Event event);
- void dumpStats(ostream& out) const;
+ void dumpStats(std::ostream& out) const;
void clearStats();
private:
@@ -935,8 +946,10 @@ void ${ident}_Profiler::possibleTransition(${ident}_State state, ${ident}_Event
{
m_possible[state][event] = true;
}
-void ${ident}_Profiler::dumpStats(ostream& out) const
+void ${ident}_Profiler::dumpStats(std::ostream& out) const
{
+ using namespace std;
+
out << " --- ${ident} " << m_version << " ---" << endl;
out << " - Event Counts -" << endl;
for (int event = 0; event < ${ident}_Event_NUM; event++) {
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py
index 3f39ec208..a13cc2385 100644
--- a/src/mem/slicc/symbols/Type.py
+++ b/src/mem/slicc/symbols/Type.py
@@ -202,6 +202,8 @@ class Type(Symbol):
#ifndef ${{self.c_ident}}_H
#define ${{self.c_ident}}_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/Allocator.hh"
''')
@@ -323,7 +325,7 @@ ${{dm.type.c_ident}}& get${{dm.ident}}() { return m_${{dm.ident}}; }
void set${{dm.ident}}(const ${{dm.type.c_ident}}& local_${{dm.ident}}) { m_${{dm.ident}} = local_${{dm.ident}}; }
''')
- code('void print(ostream& out) const;')
+ code('void print(std::ostream& out) const;')
code.dedent()
code(' //private:')
code.indent()
@@ -358,14 +360,14 @@ void set${{dm.ident}}(const ${{dm.type.c_ident}}& local_${{dm.ident}}) { m_${{dm
code('''
// Output operator declaration
-ostream& operator<<(ostream& out, const ${{self.c_ident}}& obj);
+std::ostream& operator<<(std::ostream& out, const ${{self.c_ident}}& obj);
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const ${{self.c_ident}}& obj)
+std::ostream& operator<<(std::ostream& out, const ${{self.c_ident}}& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
@@ -383,7 +385,11 @@ ostream& operator<<(ostream& out, const ${{self.c_ident}}& obj)
* Auto generated C++ code started by $__file__:$__line__
*/
+#include <iostream>
+
#include "mem/protocol/${{self.c_ident}}.hh"
+
+using namespace std;
''')
if self.isMessage:
@@ -421,6 +427,9 @@ void ${{self.c_ident}}::print(ostream& out) const
#ifndef ${{self.c_ident}}_H
#define ${{self.c_ident}}_H
+#include <iostream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
/** \\enum ${{self.c_ident}}
@@ -443,8 +452,8 @@ enum ${{self.c_ident}} {
code('''
${{self.c_ident}}_NUM
};
-${{self.c_ident}} string_to_${{self.c_ident}}(const string& str);
-string ${{self.c_ident}}_to_string(const ${{self.c_ident}}& obj);
+${{self.c_ident}} string_to_${{self.c_ident}}(const std::string& str);
+std::string ${{self.c_ident}}_to_string(const ${{self.c_ident}}& obj);
${{self.c_ident}} &operator++(${{self.c_ident}} &e);
''')
@@ -462,7 +471,7 @@ int ${{self.c_ident}}_base_count(const ${{self.c_ident}}& obj);
# Trailer
code('''
-ostream& operator<<(ostream& out, const ${{self.c_ident}}& obj);
+std::ostream& operator<<(std::ostream& out, const ${{self.c_ident}}& obj);
#endif // ${{self.c_ident}}_H
''')
@@ -477,8 +486,13 @@ ostream& operator<<(ostream& out, const ${{self.c_ident}}& obj);
* Auto generated C++ code started by $__file__:$__line__
*/
+#include <iostream>
+#include <string>
+
#include "mem/protocol/${{self.c_ident}}.hh"
+using namespace std;
+
''')
if self.isMachineType: