ruby: get "using namespace" out of headers
authorNathan Binkert <nate@binkert.org>
Fri, 2 Apr 2010 18:20:32 +0000 (11:20 -0700)
committerNathan Binkert <nate@binkert.org>
Fri, 2 Apr 2010 18:20:32 +0000 (11:20 -0700)
In addition to obvious changes, this required a slight change to the slicc
grammar to allow types with :: in them.  Otherwise slicc barfs on std::string
which we need for the headers that slicc generates.

131 files changed:
src/cpu/rubytest/Check.cc
src/cpu/rubytest/Check.hh
src/cpu/rubytest/CheckTable.cc
src/cpu/rubytest/RubyTester.cc
src/cpu/rubytest/RubyTester.hh
src/mem/gems_common/Vector.hh
src/mem/protocol/MESI_CMP_directory-L2cache.sm
src/mem/protocol/MESI_SCMP_bankdirectory-L2cache.sm
src/mem/protocol/MOESI_CMP_directory-L2cache.sm
src/mem/protocol/MOESI_CMP_token-L2cache.sm
src/mem/protocol/MSI_MOSI_CMP_directory-L1cache.sm
src/mem/protocol/MSI_MOSI_CMP_directory-L2cache.sm
src/mem/protocol/MSI_MOSI_CMP_directory-dir.sm
src/mem/protocol/MSI_MOSI_CMP_directory-msg.sm
src/mem/protocol/RubySlicc_Exports.sm
src/mem/protocol/RubySlicc_Profiler.sm
src/mem/protocol/RubySlicc_Util.sm
src/mem/ruby/buffers/MessageBuffer.cc
src/mem/ruby/common/Address.cc
src/mem/ruby/common/Address.hh
src/mem/ruby/common/Driver.hh
src/mem/ruby/common/NetDest.cc
src/mem/ruby/common/NetDest.hh
src/mem/ruby/common/Set.cc
src/mem/ruby/common/Set.hh
src/mem/ruby/common/SubBlock.cc
src/mem/ruby/common/SubBlock.hh
src/mem/ruby/eventqueue/RubyEventQueue.cc
src/mem/ruby/filters/AbstractBloomFilter.hh
src/mem/ruby/filters/BlockBloomFilter.cc
src/mem/ruby/filters/BlockBloomFilter.hh
src/mem/ruby/filters/BulkBloomFilter.cc
src/mem/ruby/filters/BulkBloomFilter.hh
src/mem/ruby/filters/GenericBloomFilter.cc
src/mem/ruby/filters/GenericBloomFilter.hh
src/mem/ruby/filters/H3BloomFilter.cc
src/mem/ruby/filters/H3BloomFilter.hh
src/mem/ruby/filters/LSB_CountingBloomFilter.cc
src/mem/ruby/filters/LSB_CountingBloomFilter.hh
src/mem/ruby/filters/MultiBitSelBloomFilter.cc
src/mem/ruby/filters/MultiBitSelBloomFilter.hh
src/mem/ruby/filters/MultiGrainBloomFilter.cc
src/mem/ruby/filters/MultiGrainBloomFilter.hh
src/mem/ruby/filters/NonCountingBloomFilter.cc
src/mem/ruby/filters/NonCountingBloomFilter.hh
src/mem/ruby/libruby.cc
src/mem/ruby/network/Network.hh
src/mem/ruby/network/garnet/NetworkHeader.hh
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/flit_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/flit_d.hh
src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh
src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh
src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh
src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
src/mem/ruby/network/garnet/flexible-pipeline/Router.hh
src/mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh
src/mem/ruby/network/garnet/flexible-pipeline/flit.cc
src/mem/ruby/network/garnet/flexible-pipeline/flit.hh
src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.cc
src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh
src/mem/ruby/network/simple/PerfectSwitch.cc
src/mem/ruby/network/simple/SimpleNetwork.cc
src/mem/ruby/network/simple/SimpleNetwork.hh
src/mem/ruby/network/simple/Switch.cc
src/mem/ruby/network/simple/Throttle.cc
src/mem/ruby/network/simple/Throttle.hh
src/mem/ruby/network/simple/Topology.cc
src/mem/ruby/profiler/AccessTraceForAddress.cc
src/mem/ruby/profiler/AccessTraceForAddress.hh
src/mem/ruby/profiler/AddressProfiler.cc
src/mem/ruby/profiler/AddressProfiler.hh
src/mem/ruby/profiler/CacheProfiler.cc
src/mem/ruby/profiler/Profiler.cc
src/mem/ruby/profiler/Profiler.hh
src/mem/ruby/profiler/StoreTrace.cc
src/mem/ruby/profiler/StoreTrace.hh
src/mem/ruby/recorder/CacheRecorder.cc
src/mem/ruby/recorder/TraceRecord.cc
src/mem/ruby/recorder/TraceRecord.hh
src/mem/ruby/recorder/Tracer.cc
src/mem/ruby/slicc_interface/AbstractCacheEntry.hh
src/mem/ruby/slicc_interface/AbstractController.hh
src/mem/ruby/slicc_interface/AbstractEntry.hh
src/mem/ruby/slicc_interface/NetworkMessage.hh
src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc
src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh
src/mem/ruby/system/CacheMemory.cc
src/mem/ruby/system/CacheMemory.hh
src/mem/ruby/system/DMASequencer.cc
src/mem/ruby/system/DirectoryMemory.cc
src/mem/ruby/system/DirectoryMemory.hh
src/mem/ruby/system/MemoryControl.cc
src/mem/ruby/system/MemoryControl.hh
src/mem/ruby/system/PerfectCacheMemory.hh
src/mem/ruby/system/PersistentTable.cc
src/mem/ruby/system/PersistentTable.hh
src/mem/ruby/system/RubyPort.hh
src/mem/ruby/system/Sequencer.cc
src/mem/ruby/system/Sequencer.hh
src/mem/ruby/system/SparseMemory.cc
src/mem/ruby/system/SparseMemory.hh
src/mem/ruby/system/System.cc
src/mem/ruby/system/System.hh
src/mem/ruby/system/TBETable.hh
src/mem/ruby/system/TimerTable.cc
src/mem/ruby/system/TimerTable.hh
src/mem/slicc/ast/EnumDeclAST.py
src/mem/slicc/ast/LiteralExprAST.py
src/mem/slicc/parser.py
src/mem/slicc/symbols/Func.py
src/mem/slicc/symbols/StateMachine.py
src/mem/slicc/symbols/Type.py

index ca7ca8457653322b9a3ce6f4175c71572362a7fb..867e755a83ab06a87f7541c25bb29cd0532e979e 100644 (file)
@@ -334,7 +334,7 @@ Check::pickInitiatingNode()
 }
 
 void
-Check::print(ostream& out) const
+Check::print(std::ostream& out) const
 {
     out << "["
         << m_address << ", value: "
@@ -342,7 +342,7 @@ Check::print(ostream& out) const
         << m_status << ", initiating node: "
         << m_initiatingNode << ", store_count: "
         << m_store_count
-        << "]" << flush;
+        << "]" << std::flush;
 }
 
 void
index 5f621a0182c4429a021776d66b8fdd883f58bcc2..6d41dfc5912d20fe67fc7a3c3d351b37e08d8ce1 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef __CPU_RUBYTEST_CHECK_HH__
 #define __CPU_RUBYTEST_CHECK_HH__
 
+#include <iostream>
+
 #include "cpu/rubytest/RubyTester.hh"
 #include "mem/protocol/AccessModeType.hh"
 #include "mem/protocol/TesterStatus.hh"
@@ -53,7 +55,7 @@ class Check
     const Address& getAddress() { return m_address; }
     void changeAddress(const Address& address);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     void initiatePrefetch();
@@ -76,11 +78,11 @@ class Check
     RubyTester* m_tester_ptr;
 };
 
-inline ostream&
-operator<<(ostream& out, const Check& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Check& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 875b4b31e74c6be2a0576d2f9d94329ede4e429e..1674ca234185f02c4fa7a2175c305be097c9ff6d 100644 (file)
@@ -126,6 +126,6 @@ CheckTable::getCheck(const Address& address)
 }
 
 void
-CheckTable::print(ostream& out) const
+CheckTable::print(std::ostream& out) const
 {
 }
index b2af22a6e646380ea94b8fa4abee9df0fa1e8b1d..3ad977b42906d16d009e096a155dba6254cbe0b3 100644 (file)
@@ -183,9 +183,9 @@ RubyTester::checkForDeadlock()
 }
 
 void
-RubyTester::print(ostream& out) const
+RubyTester::print(std::ostream& out) const
 {
-    out << "[RubyTester]" << endl;
+    out << "[RubyTester]" << std::endl;
 }
 
 RubyTester *
index f4cf4a04d1b76264cadcdef4665e94d64083d694..634e61f88947c6244e4c135c16e76f6ae224c0fb 100644 (file)
@@ -30,6 +30,9 @@
 #ifndef __CPU_RUBYTEST_RUBYTESTER_HH__
 #define __CPU_RUBYTEST_RUBYTESTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "cpu/rubytest/CheckTable.hh"
 #include "mem/mem_object.hh"
 #include "mem/packet.hh"
@@ -91,11 +94,11 @@ class RubyTester : public MemObject
 
     void incrementCheckCompletions() { m_checks_completed++; }
 
-    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;
 
   protected:
     class CheckStartEvent : public Event
@@ -133,11 +136,11 @@ class RubyTester : public MemObject
     int m_wakeup_frequency;
 };
 
-inline ostream&
-operator<<(ostream& out, const RubyTester& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const RubyTester& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index e10849213bec436d339cf21edf72ebe3259d762f..ddba7a2fc42c7f6a1c46f3e9d9a3f5c1ab9d5acb 100644 (file)
@@ -38,6 +38,7 @@
 #ifndef VECTOR_H
 #define VECTOR_H
 
+#include <algorithm>
 #include <cassert>
 #include <iostream>
 #include <vector>
@@ -184,7 +185,7 @@ template <class TYPE>
 inline
 void Vector<TYPE>::sortVector()
 {
-  sort(&m_vec[0], &m_vec[m_size]);
+  std::sort(&m_vec[0], &m_vec[m_size]);
 }
 
 template <class TYPE>
index e7877211a7501c89ae378def834afb58d70c9f9f..4739451b1b0f635c72eec3c35c89dc581f4ef499 100644 (file)
@@ -166,7 +166,7 @@ machine(L2Cache, "MESI Directory L2 Cache CMP")
     }
   }
 
-  string getCoherenceRequestTypeStr(CoherenceRequestType type) {
+  std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
     return CoherenceRequestType_to_string(type);
   }
 
@@ -203,7 +203,7 @@ machine(L2Cache, "MESI Directory L2 Cache CMP")
     return State:NP;
   }
 
-  string getStateStr(Address addr) {
+  std::string getStateStr(Address addr) {
     return L2Cache_State_to_string(getState(addr));
   }
 
index 0bd9c2b14c57fdeb60d31b39fd658487b16ab8e5..8d3c2126f04ffca7b14d9d6d061bab2260145c30 100644 (file)
@@ -171,7 +171,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
     }
   }
 
-  string getCoherenceRequestTypeStr(CoherenceRequestType type) {
+  std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
     return CoherenceRequestType_to_string(type);
   }
 
@@ -209,7 +209,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
     return State:NP;
   }
 
-  string getStateStr(Address addr) {
+  std::string getStateStr(Address addr) {
     return L2Cache_State_to_string(getState(addr));
   }
 
index dff1dab270b6f3a1e7e3b72e3b108d02495d1470..0316e231016deed971ce1fd6d2a9ea06277e2f33 100644 (file)
@@ -457,11 +457,11 @@ machine(L2Cache, "Token protocol")
     }
   }
 
-  string getStateStr(Address addr) {
+  std::string getStateStr(Address addr) {
     return L2Cache_State_to_string(getState(addr));
   }
 
-  string getCoherenceRequestTypeStr(CoherenceRequestType type) {
+  std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
     return CoherenceRequestType_to_string(type);
   }
 
index d3e11349d02d35242c519a40733e44b8959861a9..789a2b5cd0142aadf35262debfe933123e8026bd 100644 (file)
@@ -183,7 +183,7 @@ machine(L2Cache, "Token protocol")
     }
   }
 
-  string getStateStr(Address addr) {
+  std::string getStateStr(Address addr) {
     return L2Cache_State_to_string(getState(addr));
   }
 
index c16a2fe80bae9d53cb646c054163d13014c6a08e..6ca749ac7acaac2ea4b0a23ab6da628d16a95db5 100644 (file)
@@ -187,7 +187,7 @@ machine(L1Cache, "MSI Directory L1 Cache CMP") {
     return State:NP;
   }
 
-  string getStateStr(Address addr) {
+  std::string getStateStr(Address addr) {
     return L1Cache_State_to_string(getState(addr));
   }
 
index 9f85e3a8f69d1e9fb777c2a80c13991587c4adf5..8dbe5b8dbc648d8131d68151cb159b6c2324915a 100644 (file)
@@ -222,7 +222,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
     }
   }
 
-  string getCoherenceRequestTypeStr(CoherenceRequestType type) {
+  std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
     return CoherenceRequestType_to_string(type);
   }
 
@@ -260,7 +260,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
     return State:L2_NP;
   }
 
-  string getStateStr(Address addr) {
+  std::string getStateStr(Address addr) {
     return L2Cache_State_to_string(getState(addr));
   }
 
index 435bf0effc2a2003e8214810e0d9c4732d13bc6c..e806b333c2ed046f7f4981af0167155754562d86 100644 (file)
@@ -100,11 +100,11 @@ machine(Directory, "MOSI Directory Optimized") {
     return State:NP;
   }
 
-  string getDirStateStr(Address addr) {
+  std::string getDirStateStr(Address addr) {
     return Directory_State_to_string(getState(addr));
   }
 
-  string getRequestTypeStr(CoherenceRequestType type) {
+  std::string getRequestTypeStr(CoherenceRequestType type) {
     return CoherenceRequestType_to_string(type);
   }
 
index 80ab0f24666df9d1a2033aa2d514b59ade859bef..fc653983a7761debdf6f1ce7b8d8267fb58b2ca4 100644 (file)
@@ -69,8 +69,8 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
   DataBlock DataBlk,            desc="Data for the cache line (if PUTX)";
   int NumPendingExtAcks,        desc="Number of acks to wait for"; // Needed for forwarded responses only
   MessageSizeType MessageSize,  desc="size category of the message";
-  string L1CacheStateStr,       desc="describes L1 cache block state";
-  string L2CacheStateStr,       desc="describes L2 cache block state";
+  std::string L1CacheStateStr,  desc="describes L1 cache block state";
+  std::string L2CacheStateStr,  desc="describes L2 cache block state";
   PrefetchBit Prefetch,         desc="Is this a prefetch request";
 }
 
index 8f1e5a6eb51a248c1764de4759ffecd462ff9415..599e895dbcab321a59c87ddf0c17506c363d2790 100644 (file)
@@ -35,7 +35,7 @@
 // defines
 external_type(int, primitive="yes", default="0");
 external_type(bool, primitive="yes", default="false");
-external_type(string, primitive="yes");
+external_type(std::string, primitive="yes");
 external_type(uint64, primitive="yes");
 external_type(Time, primitive="yes", default="0");
 external_type(Address);
index d360af160378e682049cd9760783d3854215a69d..ce1183e22ff77f1cac51f4da7dbea439b4369133 100644 (file)
@@ -41,7 +41,8 @@ void profile_L1Cache_miss(CacheMsg msg, NodeID l1cacheID);
 
 // used by CMP protocols
 void profile_L2Cache_miss(GenericRequestType requestType, AccessModeType type, int msgSize, PrefetchBit pfBit, NodeID l2cacheID);
-void profile_request(string L1CacheStateStr, string L2CacheStateStr, string directoryStateStr, string requestTypeStr);
+void profile_request(std::string L1CacheStateStr, std::string L2CacheStateStr,
+    std::string directoryStateStr, std::string requestTypeStr);
 void profileMessageReordering(bool wasReordered);
 void profileMessageReorderingByNetwork(int vnet, bool wasReordered);
 void profile_token_retry(Address addr, AccessType type, int count);
index e1771448fa6c4976c8feb9942583aadf31de593d..d4232650f8048e0a06556db6afca511c112e4cc3 100644 (file)
@@ -29,7 +29,7 @@
 
 // Miscallaneous Functions
 
-void error(string msg);
+void error(std::string msg);
 void assert(bool condition);
 int random(int number);
 Time get_time();
index 83bb34dadda904feb8ef499ce0b615774aec515c..086f92ab78f823a90bd114fcaaafa6cce4c313cc 100644 (file)
@@ -29,6 +29,8 @@
 #include "mem/ruby/buffers/MessageBuffer.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 MessageBuffer::MessageBuffer(const string &name)
 {
     m_msg_counter = 0;
index e74bdb47b0e13394deaada8298e487309e275466..2d895cc3360dc2fdfc333998bab52903bfbd18b8 100644 (file)
 #include "mem/ruby/common/Address.hh"
 
 void
-Address::output(ostream& out) const
+Address::output(std::ostream& out) const
 {
     // Note: this outputs addresses in the form "ffff", not "0xffff".
     // This code should always be able to write out addresses in a
     // format that can be read in by the below input() method.  Please
     // don't change this without talking to Milo first.
-    out << hex << m_address << dec;
+    out << std::hex << m_address << std::dec;
 }
 
 void
-Address::input(istream& in)
+Address::input(std::istream& in)
 {
     // Note: this only works with addresses in the form "ffff", not
     // "0xffff".  This code should always be able to read in addresses
     // written out by the above output() method.  Please don't change
     // this without talking to Milo first.
-    in >> hex >> m_address >> dec;
+    in >> std::hex >> m_address >> std::dec;
 }
 
 Address::Address(const Address& obj)
index c495f8d861dc2367b0d136717cfc53f7f07c0362..dc58d012f036b1170cee721d32d8c83460384ffb 100644 (file)
@@ -98,9 +98,9 @@ class Address
 
     Index memoryModuleIndex() const;
 
-    void print(ostream& out) const;
-    void output(ostream& out) const;
-    void input(istream& in);
+    void print(std::ostream& out) const;
+    void output(std::ostream& out) const;
+    void input(std::istream& in);
 
     void
     setOffset(int offset)
@@ -128,11 +128,11 @@ operator<(const Address& obj1, const Address& obj2)
     return obj1.getAddress() < obj2.getAddress();
 }
 
-inline ostream&
-operator<<(ostream& out, const Address& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Address& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
@@ -259,7 +259,7 @@ ADDRESS_WIDTH    MEMORY_SIZE_BITS        PAGE_SIZE_BITS  DATA_BLOCK_BITS
 }
 
 inline void
-Address::print(ostream& out) const
+Address::print(std::ostream& out) const
 {
     using namespace std;
     out << "[" << hex << "0x" << m_address << "," << " line 0x"
index f5f2f9c5826fe6f6002e21523769ba2db2921a9c..8d687ef4fb43818d3ec687d0b1f58b8da9b7e0ab 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_COMMON_DRIVER_HH__
 #define __MEM_RUBY_COMMON_DRIVER_HH__
 
+#include <iostream>
+
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/common/Global.hh"
@@ -51,10 +53,10 @@ class Driver
                                      int conflict_thread) const;
     virtual void printDebug(); //called by Sequencer
 
-    virtual void printStats(ostream& out) const = 0;
+    virtual void printStats(std::ostream& out) const = 0;
     virtual void clearStats() = 0;
 
-    virtual void printConfig(ostream& out) const = 0;
+    virtual void printConfig(std::ostream& out) const = 0;
 
     virtual integer_t readPhysicalMemory(int procID, physical_address_t addr,
                                          int len);
index 1edf6d1a6e382bbd67a2160ae28cc57e86bfddcf..f694af99bafa3fdc1e3a39653915d8f81725ae81 100644 (file)
@@ -260,7 +260,7 @@ NetDest::setSize()
 }
 
 void
-NetDest::print(ostream& out) const
+NetDest::print(std::ostream& out) const
 {
     out << "[NetDest (" << m_bits.size() << ") ";
 
index 7592ad9b592b2c9efc9064ae0da52e8dfef4913d..a8d0009d725fed815b0ed80424a064fcb5f122bc 100644 (file)
 #ifndef __MEM_RUBY_COMMON_NETDEST_HH__
 #define __MEM_RUBY_COMMON_NETDEST_HH__
 
-#include "mem/ruby/common/Global.hh"
+#include <iostream>
+
 #include "mem/gems_common/Vector.hh"
-#include "mem/ruby/system/NodeID.hh"
-#include "mem/ruby/system/MachineID.hh"
-#include "mem/ruby/common/Set.hh"
 #include "mem/protocol/MachineType.hh"
+#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/common/Set.hh"
+#include "mem/ruby/system/MachineID.hh"
+#include "mem/ruby/system/NodeID.hh"
 
 class NetDest
 {
@@ -98,7 +100,7 @@ class NetDest
     // get element for a index
     NodeID elementAt(MachineID index);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     // returns a value >= MachineType_base_level("this machine")
@@ -120,11 +122,11 @@ class NetDest
     Vector <Set> m_bits;  // a Vector of bit vectors - i.e. Sets
 };
 
-inline ostream&
-operator<<(ostream& out, const NetDest& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const NetDest& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 55648043c35bfda8bce95c3c65ae3b4d31951167..a9ced00788c9dc322940436c022d2e754fb5dbd6 100644 (file)
@@ -557,7 +557,7 @@ Set& Set::operator=(const Set& obj) {
   return *this;
 }
 
-void Set::print(ostream& out) const
+void Set::print(std::ostream& out) const
 {
   if(m_p_nArray==NULL) {
     out << "[Set {Empty}]";
index a22da914c0b9569ee6e939e983c96b8ec09af145..d0660c6e6f0d6e648d45278da19ca6a1944870d3 100644 (file)
@@ -45,6 +45,8 @@
 #ifndef SET_H
 #define SET_H
 
+#include <iostream>
+
 #include "mem/ruby/system/System.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/gems_common/Vector.hh"
@@ -164,7 +166,7 @@ public:
   void setBroadcast() { broadcast(); }   // Deprecated
   bool presentInSet(NodeID element) const { return isElement(element); }  // Deprecated
 
-  void print(ostream& out) const;
+  void print(std::ostream& out) const;
 private:
   // Private Methods
 
@@ -185,16 +187,16 @@ private:
 };
 
 // Output operator declaration
-ostream& operator<<(ostream& out, const Set& obj);
+std::ostream& operator<<(std::ostream& out, const Set& obj);
 
 // ******************* Definitions *******************
 
 // Output operator definition
 extern inline
-ostream& operator<<(ostream& out, const Set& obj)
+std::ostream& operator<<(std::ostream& out, const Set& obj)
 {
   obj.print(out);
-  out << flush;
+  out << std::flush;
   return out;
 }
 
index 533aefbe76d4b017bc4347db3e92277d8a9794db..5a42a415d58d593fbc18a2ad2493e9c2f6b9eba3 100644 (file)
@@ -61,7 +61,7 @@ SubBlock::internalMergeTo(DataBlock& data) const
 }
 
 void
-SubBlock::print(ostream& out) const
+SubBlock::print(std::ostream& out) const
 {
     out << "[" << m_address << ", " << getSize() << ", " << m_data << "]";
 }
index ab286dd0e643c50900d762b18083a4468622e29e..571d45b5728916d6e23e5437a90c807e04631b40 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_COMMON_SUBBLOCK_HH__
 #define __MEM_RUBY_COMMON_SUBBLOCK_HH__
 
+#include <iostream>
+
 #include "mem/gems_common/Vector.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/DataBlock.hh"
@@ -58,7 +60,7 @@ class SubBlock
     void mergeTo(DataBlock& data) const { internalMergeTo(data); }
     void mergeFrom(const DataBlock& data) { internalMergeFrom(data); }
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     void internalMergeTo(DataBlock& data) const;
@@ -69,11 +71,11 @@ class SubBlock
     Vector<uint8_t> m_data;
 };
 
-inline ostream&
-operator<<(ostream& out, const SubBlock& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const SubBlock& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index eaa22ff1e2528f1f8a1cbdeb112684995b78298a..eb1f2d32b62beb469cee77a12d0b4e3f121fb889 100644 (file)
@@ -61,7 +61,7 @@ RubyEventQueue::scheduleEventAbsolute(Consumer* consumer, Time timeAbs)
 }
 
 void
-RubyEventQueue::print(ostream& out) const
+RubyEventQueue::print(std::ostream& out) const
 {
     out << "[Event Queue:]";
 }
index de11b4499d47e15f39577f53ec4790e627504bb8..cf8476c8dff524a9861178ed23818919fa6e340f 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
 
+#include <iostream>
+
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
 
@@ -47,7 +49,7 @@ class AbstractBloomFilter
     virtual int getCount(const Address& addr) = 0;
     virtual int getTotalCount() = 0;
 
-    virtual void print(ostream& out) const = 0;
+    virtual void print(std::ostream& out) const = 0;
 
     virtual int getIndex(const Address& addr) = 0;
     virtual int readBit(const int index) = 0;
index 74b14593ed2ebf7a72025abdbb4abb0192fcf7ec..21d7921c647ccd17a8ddb67d92a4f31a2cb8f3a1 100644 (file)
@@ -30,6 +30,8 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/filters/BlockBloomFilter.hh"
 
+using namespace std;
+
 BlockBloomFilter::BlockBloomFilter(string str)
 {
     string tail(str);
index 14f064975c5606dec91d97b707681493e4a63957..be31b025fa2f48157ec93500a55b35cb28b90b44 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -37,7 +40,7 @@
 class BlockBloomFilter : public AbstractBloomFilter
 {
   public:
-    BlockBloomFilter(string config);
+    BlockBloomFilter(std::string config);
     ~BlockBloomFilter();
 
     void clear();
@@ -54,7 +57,7 @@ class BlockBloomFilter : public AbstractBloomFilter
     int readBit(const int index);
     void writeBit(const int index, const int value);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     int get_index(const Address& addr);
index 1788c03917ae79143aee9cf872bca945eec4bec3..47cc386cdde72ba28ea3ccffb6532e80de013f86 100644 (file)
@@ -30,6 +30,8 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/filters/BulkBloomFilter.hh"
 
+using namespace std;
+
 BulkBloomFilter::BulkBloomFilter(string str)
 {
     string tail(str);
index 53a913dc3e1f7b47b646e7e597aa0e755073ceb3..5a3117a6096f78f094f592b474c7a2f0843b3125 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -37,7 +40,7 @@
 class BulkBloomFilter : public AbstractBloomFilter
 {
   public:
-    BulkBloomFilter(string config);
+    BulkBloomFilter(std::string config);
     ~BulkBloomFilter();
 
     void clear();
@@ -54,7 +57,7 @@ class BulkBloomFilter : public AbstractBloomFilter
     int readBit(const int index);
     void writeBit(const int index, const int value);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     int get_index(const Address& addr);
index a31e97f1f8b6536336957fc817100906ce9d0385..8d6b18e9e372690127a03b71625636cfd6af3c27 100644 (file)
@@ -37,6 +37,8 @@
 #include "mem/ruby/filters/MultiGrainBloomFilter.hh"
 #include "mem/ruby/filters/NonCountingBloomFilter.hh"
 
+using namespace std;
+
 GenericBloomFilter::GenericBloomFilter(string config)
 {
     string tail(config);
index b7bd56d04723539607c0defc46bcdc989981582d..606f55d4f192633f3db6cd3577741b2c3a201986 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_FILTERS_GENERICBLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_GENERICBLOOMFILTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/filters/AbstractBloomFilter.hh"
@@ -36,7 +39,7 @@
 class GenericBloomFilter
 {
   public:
-    GenericBloomFilter(string config);
+    GenericBloomFilter(std::string config);
     ~GenericBloomFilter();
 
     void clear();
@@ -61,18 +64,22 @@ class GenericBloomFilter
     int readBit(const int index);
     void writeBit(const int index, const int value);
 
-    void print(ostream& out) const;
-    void printConfig(ostream& out) { out << "GenericBloomFilter" << endl; }
+    void print(std::ostream& out) const;
+    void
+    printConfig(std::ostream& out)
+    {
+        out << "GenericBloomFilter" << std::endl;
+    }
 
   private:
     AbstractBloomFilter* m_filter;
 };
 
-inline ostream&
-operator<<(ostream& out, const GenericBloomFilter& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const GenericBloomFilter& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index c73a29a8452c023920d56bbd125d98a781dee24b..8018c7e3891b1bc23e7ee4b233056c7d889ef1eb 100644 (file)
@@ -30,6 +30,8 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/filters/H3BloomFilter.hh"
 
+using namespace std;
+
 static int H3[64][16] = {
     { 33268410,   395488709,  311024285,  456111753,
       181495008,  119997521,  220697869,  433891432,
index 6c18508ebec807942257e67d26619baddfd6f975..babd8665725da5c7d3e706cea046f240e2543700 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -39,7 +42,7 @@
 class H3BloomFilter : public AbstractBloomFilter
 {
   public:
-    H3BloomFilter(string config);
+    H3BloomFilter(std::string config);
     ~H3BloomFilter();
 
     void clear();
@@ -52,7 +55,7 @@ class H3BloomFilter : public AbstractBloomFilter
     bool isSet(const Address& addr);
     int getCount(const Address& addr);
     int getTotalCount();
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
     int getIndex(const Address& addr);
     int readBit(const int index);
index b64c3e75a2cf42caaeff39791ad16e56831474a4..7ec927d6c992abf709dc208e3d9c8206f5cc3b05 100644 (file)
@@ -30,6 +30,8 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/filters/LSB_CountingBloomFilter.hh"
 
+using namespace std;
+
 LSB_CountingBloomFilter::LSB_CountingBloomFilter(string str)
 {
     string tail(str);
index 0d74c524aaafb5e0e3656b530a3f2253ffb278fb..1ce65edcf2a9412b3ff82b5092ea21135f4be5d4 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_FILTERS_LSBCOUNTINGBLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_LSBCOUNTINGBLOOMFILTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -37,7 +40,7 @@
 class LSB_CountingBloomFilter : public AbstractBloomFilter
 {
   public:
-    LSB_CountingBloomFilter(string config);
+    LSB_CountingBloomFilter(std::string config);
     ~LSB_CountingBloomFilter();
 
     void clear();
@@ -54,7 +57,7 @@ class LSB_CountingBloomFilter : public AbstractBloomFilter
     int readBit(const int index);
     void writeBit(const int index, const int value);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     int get_index(const Address& addr);
index 1fe3168005a035d2e2e262a770bc12531f8fc5e6..90f299fb416dc1b8cb8e2b20514f4a8c02654074 100644 (file)
@@ -30,6 +30,8 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/filters/MultiBitSelBloomFilter.hh"
 
+using namespace std;
+
 MultiBitSelBloomFilter::MultiBitSelBloomFilter(string str)
 {
     string tail(str);
index c3b441c201528b3c9a8798c3c7f6a5c271f1f1f7..f53b2595a424b74653b5b5984b04db3e97c3954a 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -39,7 +42,7 @@
 class MultiBitSelBloomFilter : public AbstractBloomFilter
 {
   public:
-    MultiBitSelBloomFilter(string config);
+    MultiBitSelBloomFilter(std::string config);
     ~MultiBitSelBloomFilter();
 
     void clear();
@@ -52,7 +55,7 @@ class MultiBitSelBloomFilter : public AbstractBloomFilter
     bool isSet(const Address& addr);
     int getCount(const Address& addr);
     int getTotalCount();
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
     int getIndex(const Address& addr);
     int readBit(const int index);
index 543c4312a42352b48a52ea2a0206d25b30ee5688..24fcd7ead90e4a0fe418de262f41a168a3844c96 100644 (file)
@@ -30,6 +30,8 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/filters/MultiGrainBloomFilter.hh"
 
+using namespace std;
+
 MultiGrainBloomFilter::MultiGrainBloomFilter(string str)
 {
     string tail(str);
index 4681e280636debd4937e5f9a24be53903d5f5046..8be226c025398a84df0da23ba92d5435fe66c58d 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -37,7 +40,7 @@
 class MultiGrainBloomFilter : public AbstractBloomFilter
 {
   public:
-    MultiGrainBloomFilter(string str);
+    MultiGrainBloomFilter(std::string str);
     ~MultiGrainBloomFilter();
 
     void clear();
@@ -54,7 +57,7 @@ class MultiGrainBloomFilter : public AbstractBloomFilter
     int readBit(const int index);
     void writeBit(const int index, const int value);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     int get_block_index(const Address& addr);
index 06c069c7e882ff8688ecbebc9834acc6f09f8910..2b39659278ef0b5f7a9e4b2a17b8cb96ad69afc1 100644 (file)
@@ -30,6 +30,8 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/filters/NonCountingBloomFilter.hh"
 
+using namespace std;
+
 NonCountingBloomFilter::NonCountingBloomFilter(string str)
 {
     string tail(str);
index bec645952aa17fae12714ac76ef13ec6e2499869..414de4bc8877b9af077d42349278eeb3050dd218 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_FILTERS_NONCOUNTINGBLOOMFILTER_HH__
 #define __MEM_RUBY_FILTERS_NONCOUNTINGBLOOMFILTER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -37,7 +40,7 @@
 class NonCountingBloomFilter : public AbstractBloomFilter
 {
   public:
-    NonCountingBloomFilter(string config);
+    NonCountingBloomFilter(std::string config);
     ~NonCountingBloomFilter();
 
     void clear();
@@ -55,7 +58,7 @@ class NonCountingBloomFilter : public AbstractBloomFilter
     int readBit(const int index);
     void writeBit(const int index, const int value);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
     int
     operator[](const int index) const
index de120036b26021bce2f9c578e7446e0444dcedcc..2b61ce96c2d386c3e079273cfbb30a7442146de7 100644 (file)
@@ -38,6 +38,8 @@
 #include "mem/ruby/system/RubyPort.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 string
 RubyRequestType_to_string(const RubyRequestType& obj)
 {
@@ -64,7 +66,7 @@ RubyRequestType_to_string(const RubyRequestType& obj)
 }
 
 RubyRequestType
-string_to_RubyRequestType(std::string str)
+string_to_RubyRequestType(string str)
 {
     if (str == "IFETCH")
         return RubyRequestType_IFETCH;
@@ -94,7 +96,7 @@ operator<<(ostream& out, const RubyRequestType& obj)
 }
 
 ostream&
-operator<<(std::ostream& out, const RubyRequest& obj)
+operator<<(ostream& out, const RubyRequest& obj)
 {
     out << hex << "0x" << obj.paddr << " data: 0x" << flush;
     for (int i = 0; i < obj.len; i++) {
@@ -147,8 +149,8 @@ libruby_init(const char* cfg_filename)
         assert(tokens.size() >= 2);
         vector<string> argv;
         for (size_t i=2; i<tokens.size(); i++) {
-            std::replace(tokens[i].begin(), tokens[i].end(), '%', ' ');
-            std::replace(tokens[i].begin(), tokens[i].end(), '#', '\n');
+            replace(tokens[i].begin(), tokens[i].end(), '%', ' ');
+            replace(tokens[i].begin(), tokens[i].end(), '#', '\n');
             argv.push_back(tokens[i]);
         }
         sys_conf->push_back(RubyObjConf(tokens[0], tokens[1], argv));
@@ -224,13 +226,13 @@ libruby_last_error()
 }
 
 void
-libruby_print_config(std::ostream & out)
+libruby_print_config(ostream & out)
 {
     RubySystem::printConfig(out);
 }
 
 void
-libruby_print_stats(std::ostream & out)
+libruby_print_stats(ostream & out)
 {
     RubySystem::printStats(out);
 }
index b79c6407e1f7e8732a56f562687d4c37cd04f5d1..fb56904dbf2bc83879271e02432962e064cac3de 100644 (file)
@@ -40,6 +40,9 @@
 #ifndef __MEM_RUBY_NETWORK_NETWORK_HH__
 #define __MEM_RUBY_NETWORK_NETWORK_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/protocol/MessageSizeType.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/system/NodeID.hh"
@@ -88,10 +91,10 @@ class Network : public SimObject
 
     virtual void reset() = 0;
 
-    virtual void printStats(ostream& out) const = 0;
+    virtual void printStats(std::ostream& out) const = 0;
     virtual void clearStats() = 0;
-    virtual void printConfig(ostream& out) const = 0;
-    virtual void print(ostream& out) const = 0;
+    virtual void printConfig(std::ostream& out) const = 0;
+    virtual void print(std::ostream& out) const = 0;
 
   protected:
     // Private copy constructor and assignment operator
@@ -99,7 +102,7 @@ class Network : public SimObject
     Network& operator=(const Network& obj);
 
   protected:
-    const string m_name;
+    const std::string m_name;
     int m_nodes;
     int m_virtual_networks;
     int m_buffer_size;
@@ -111,11 +114,11 @@ class Network : public SimObject
     int m_data_msg_size;
 };
 
-inline ostream&
-operator<<(ostream& out, const Network& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Network& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 1922df5ead892a782c84e4682250dcc9a1befe29..98c8024fa9c41b19ba5f9fa0fb1884d73f7b274c 100644 (file)
@@ -34,9 +34,6 @@
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/system/NodeID.hh"
 
-using namespace std;
-using namespace __gnu_cxx;
-
 enum flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
 enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
 enum flit_stage {I_, VA_, SA_, ST_, LT_, NUM_FLIT_STAGE_};
index 7e9fe0762783fd463e1d607200fafa41e63b019f..8bdea4894b51d9f5a98000a0f9e8159ce792d0c6 100644 (file)
@@ -38,6 +38,8 @@
 #include "mem/ruby/network/garnet/fixed-pipeline/CreditLink_d.hh"
 #include "mem/ruby/common/NetDest.hh"
 
+using namespace std;
+
 GarnetNetwork_d::GarnetNetwork_d(const Params *p)
   : BaseGarnetNetwork(p)
 {
index 8a36c1572069339889e405d52fcfc216bab01e8c..7cb87b21afed18ca872deedf5a94e7c53564ff44 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef GARNETNETWORK_D_H
 #define GARNETNETWORK_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/gems_common/Vector.hh"
 #include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
@@ -61,9 +63,9 @@ public:
         MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
 
         void clearStats();
-        void printStats(ostream& out) const;
-        void printConfig(ostream& out) const;
-        void print(ostream& out) const;
+        void printStats(std::ostream& out) const;
+        void printConfig(std::ostream& out) const;
+        void print(std::ostream& out) const;
 
         inline void increment_injected_flits()
         {
@@ -125,17 +127,12 @@ private:
         Time m_ruby_start;
 };
 
-// Output operator declaration
-ostream& operator<<(ostream& out, const GarnetNetwork_d& obj);
-
-// ******************* Definitions *******************
-// Output operator definition
-extern inline
-ostream& operator<<(ostream& out, const GarnetNetwork_d& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const GarnetNetwork_d& obj)
 {
-        obj.print(out);
-        out << flush;
-        return out;
+    obj.print(out);
+    out << std::flush;
+    return out;
 }
 
 #endif //GARNETNETWORK_D_H
index ce7a0152d26815819f739e4143cbaf345693ac00..ea8f7789beb8a01e4b4c5b9e0f19d8e37391fd63 100644 (file)
@@ -31,6 +31,8 @@
 #include "mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
 
+using namespace std;
+
 InputUnit_d::InputUnit_d(int id, Router_d *router)
 {
         m_id = id;
index bca7b10f0e5726c71ddbfc63d9bebc0404424015..05358bc8ba94c0d3c2fd355ab1578a136b93ded2 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef INPUT_UNIT_D_H
 #define INPUT_UNIT_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
 #include "mem/ruby/common/Consumer.hh"
@@ -47,9 +49,9 @@ public:
         ~InputUnit_d();
 
         void wakeup();
-        void printConfig(ostream& out);
+        void printConfig(std::ostream& out);
         flitBuffer_d* getCreditQueue() { return creditQueue; }
-        void print(ostream& out) const {};
+        void print(std::ostream& out) const {};
 
         inline int get_inlink_id()
         {
index 6c61cef26b408a95cacb675119ce01430bdff3c8..da86c32fa24a715f5a202d6a54f809599637fd8b 100644 (file)
@@ -335,14 +335,14 @@ void NetworkInterface_d::checkReschedule()
         }
 }
 
-void NetworkInterface_d::printConfig(ostream& out) const
+void NetworkInterface_d::printConfig(std::ostream& out) const
 {
         out << "[Network Interface " << m_id << "] - ";
         out << "[inLink " << inNetLink->get_id() << "] - ";
-        out << "[outLink " << outNetLink->get_id() << "]" << endl;
+        out << "[outLink " << outNetLink->get_id() << "]" << std::endl;
 }
 
-void NetworkInterface_d::print(ostream& out) const
+void NetworkInterface_d::print(std::ostream& out) const
 {
         out << "[Network Interface]";
 }
index 1ca4a7a9c73e1d7b616eb2f2722c58f6726e98db..88d8829699f08344accea6c2bb611eacf0a817f2 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef NET_INTERFACE_D_H
 #define NET_INTERFACE_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh"
 #include "mem/gems_common/Vector.hh"
@@ -55,8 +57,8 @@ public:
 
         void wakeup();
         void addNode(Vector<MessageBuffer *> &inNode, Vector<MessageBuffer *> &outNode);
-        void printConfig(ostream& out) const;
-        void print(ostream& out) const;
+        void printConfig(std::ostream& out) const;
+        void print(std::ostream& out) const;
         int get_vnet(int vc);
 
 private:
index b5c58baa2b59703190631eac12ea311aaea36334..c5f9f14d157113757916d2a5d50c97c933f7ad05 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef NETWORK_LINK_D_H
 #define NETWORK_LINK_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
@@ -47,7 +49,7 @@ public:
         NetworkLink_d(int id, int link_latency, GarnetNetwork_d *net_ptr);
         void setLinkConsumer(Consumer *consumer);
         void setSourceQueue(flitBuffer_d *srcQueue);
-        void print(ostream& out) const{}
+        void print(std::ostream& out) const{}
         int getLinkUtilization();
         Vector<int> getVcLoad();
         int get_id(){return m_id;}
index 7934dc9bd837583643c38ba64581e9216fc16361..99475cf690b13417caa65d0980c3bfac29016e8e 100644 (file)
@@ -31,6 +31,8 @@
 #include "mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
 
+using namespace std;
+
 OutputUnit_d::OutputUnit_d(int id, Router_d *router)
 {
         m_id = id;
index 25747a1f8e9a994ff2b1aed2e07f8534de46ceae..93cfd9d1279d262cf4a83da7437aa9b082e100c0 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef OUTPUT_UNIT_D_H
 #define OUTPUT_UNIT_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
@@ -48,9 +50,9 @@ public:
         void set_credit_link(CreditLink_d *credit_link);
         void wakeup();
         flitBuffer_d* getOutQueue();
-        void printConfig(ostream& out);
+        void printConfig(std::ostream& out);
         void update_vc(int vc, int in_port, int in_vc);
-        void print(ostream& out) const {};
+        void print(std::ostream& out) const {};
         int get_credit_cnt(int vc) { return m_outvc_state[vc]->get_credit_count(); }
         void decrement_credit(int out_vc);
 
index 7185249e42257023c5202d180182bbd1da6603e4..428ba3260900f086553143eb92a12fd2b43117dd 100644 (file)
@@ -39,6 +39,8 @@
 #include "mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh"
 
+using namespace std;
+
 Router_d::Router_d(int id, GarnetNetwork_d *network_ptr)
 {
         m_id = id;
index 498a6cae1f415eead9f1b9a90835934e0d8abae8..91f79882cf4ca88b84158aaec43d0a50058ab113 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef ROUTER_D_H
 #define ROUTER_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/gems_common/Vector.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh"
@@ -60,7 +62,7 @@ public:
         int get_vc_per_vnet() {return m_vc_per_vnet; }
         int get_num_inports() { return m_input_unit.size(); }
         int get_num_outports() { return m_output_unit.size(); }
-        void printConfig(ostream& out);
+        void printConfig(std::ostream& out);
         int get_id() { return m_id; }
         GarnetNetwork_d* get_net_ptr() { return m_network_ptr; }
 
index a6c838e8a6419369c64d2a748a036dd839395c9f..95a7dad1cf9616b6afb20a607e5c63451582aa6f 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef SW_ALLOCATOR_D_H
 #define SW_ALLOCATOR_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/common/Consumer.hh"
 
@@ -46,7 +48,7 @@ public:
         void clear_request_vector();
         void check_for_wakeup();
         int get_vnet (int invc);
-        void print(ostream& out) const {};
+        void print(std::ostream& out) const {};
         void arbitrate_inports();
         void arbitrate_outports();
         bool is_candidate_inport(int inport, int invc);
index 0e3c17b3bd6b3e1dd3326116088ae82130ed9ce4..09973b82d43990429130e00855dd0d2989edc811 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef SWITCH_D_H
 #define SWITCH_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
@@ -45,7 +47,7 @@ public:
         void wakeup();
         void init();
         void check_for_wakeup();
-        void print(ostream& out) const {};
+        void print(std::ostream& out) const {};
         inline void update_sw_winner(int inport, flit_d *t_flit)
         {
                 m_switch_buffer[inport]->insert(t_flit);
index c9247c6d0b5ac48e9aed37a1f4ea132a595f5663..c6d06d1ae644626ca808a22e1e42c98d549b5e37 100644 (file)
@@ -31,6 +31,9 @@
 #ifndef VC_ALLOCATOR_D_H
 #define VC_ALLOCATOR_D_H
 
+#include <iostream>
+#include <utility>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/common/Consumer.hh"
 
@@ -46,7 +49,7 @@ public:
         void check_for_wakeup();
         void clear_request_vector();
         int get_vnet(int invc);
-        void print(ostream& out) const {};
+        void print(std::ostream& out) const {};
         void arbitrate_invcs();
         void arbitrate_outvcs();
         bool is_invc_candidate(int inport_iter, int invc_iter);
@@ -69,7 +72,7 @@ private:
 
         Router_d *m_router;
         Vector<Vector <int > > m_round_robin_invc; // First stage of arbitration where all vcs select an output vc to content for
-        Vector<Vector <pair<int, int> > > m_round_robin_outvc; // Arbiter for every output vc
+        Vector<Vector <std::pair<int, int> > > m_round_robin_outvc; // Arbiter for every output vc
         Vector<Vector<Vector<Vector<bool > > > > m_outvc_req; // [outport][outvc][inpotr][invc]. set true in the first phase of allocation
         Vector<Vector<bool > > m_outvc_is_req;
 
index 2b4779038f3f67078d48e749616d4f71ba8cfd99..645506af769d0b0da24c672bf46a1045ceeb68b8 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef VIRTUAL_CHANNEL_D_H
 #define VIRTUAL_CHANNEL_D_H
 
+#include <utility>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
 
@@ -105,7 +107,7 @@ public:
 private:
         int m_id;
         flitBuffer_d *m_input_buffer;
-        pair<VC_state_type, Time> m_vc_state; // I/R/V/A/C
+        std::pair<VC_state_type, Time> m_vc_state; // I/R/V/A/C
         int route;
         Time m_enqueue_time;
         int m_output_vc;
index 9578f0a8f270ecce6a8fd30215a5512f731b73ff..38510c7581b9686eb6f8e4dba6430d0979f543aa 100644 (file)
@@ -67,10 +67,10 @@ bool flitBuffer_d::isReadyForNext()
         return false;
 }
 
-void flitBuffer_d::print(ostream& out) const
+void flitBuffer_d::print(std::ostream& out) const
 {
         out << "[flitBuffer: ";
-        out << m_buffer.size() << "] " << endl;
+        out << m_buffer.size() << "] " << std::endl;
 }
 
 bool flitBuffer_d::isFull()
index 11a3cda9c59b088a6455f97842d6c1c22daf3aae..976fa4053e942c90fb30e1822a43a3c2a7235281 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef FLIT_BUFFER_D_H
 #define FLIT_BUFFER_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/gems_common/PrioHeap.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh"
@@ -43,7 +45,7 @@ public:
         bool isReady();
         bool isReadyForNext();
         bool isEmpty();
-        void print(ostream& out) const;
+        void print(std::ostream& out) const;
         bool isFull();
         void setMaxSize(int maximum);
 
@@ -65,17 +67,12 @@ private:
         int size, max_size;
 };
 
-ostream& operator<<(ostream& out, const flitBuffer_d& obj);
-
-// ******************* Definitions *******************
-
-// Output operator definition
-extern inline
-ostream& operator<<(ostream& out, const flitBuffer_d& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const flitBuffer_d& obj)
 {
-  obj.print(out);
-  out << flush;
-  return out;
+    obj.print(out);
+    out << std::flush;
+    return out;
 }
 
 #endif
index c6a58a8397bb4c6fbb9ab7a9e86f0ee4d86d2fa9..2e73cdc72220f7ef70e7a76b5555c5a144b3c222 100644 (file)
@@ -117,7 +117,7 @@ void flit_d::advance_stage(flit_stage t_stage)
         m_stage.second = g_eventQueue_ptr->getTime() + 1;
 }
 */
-void flit_d::print(ostream& out) const
+void flit_d::print(std::ostream& out) const
 {
         out << "[flit:: ";
         out << "Id=" << m_id << " ";
index 3f9afcdca7a713c0116f4465e112761e7618a844..39bbe011d543ef2ff1f8d579f60a76b2c481165e 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef FLIT_D_H
 #define FLIT_D_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/slicc_interface/Message.hh"
 
@@ -40,7 +42,7 @@ public:
         flit_d(int vc, bool is_free_signal);
         void set_outport(int port) { m_outport = port; }
         int get_outport() {return m_outport; }
-        void print(ostream& out) const;
+        void print(std::ostream& out) const;
         bool is_free_signal()
         {
                 return m_is_free_signal;
@@ -99,7 +101,7 @@ public:
                 m_stage.first = t_stage;
                 m_stage.second = g_eventQueue_ptr->getTime() + 1;
         }
-        inline pair<flit_stage, Time> get_stage()
+        inline std::pair<flit_stage, Time> get_stage()
         {
                 return m_stage;
         }
@@ -126,7 +128,7 @@ private:
         MsgPtr m_msg_ptr;
         int m_outport;
         int src_delay;
-        pair<flit_stage, Time> m_stage;
+        std::pair<flit_stage, Time> m_stage;
 
 };
 
@@ -143,18 +145,12 @@ bool node_less_then_eq(flit_d* n1, flit_d* n2)
   }
 }
 
-// Output operator declaration
-ostream& operator<<(ostream& out, const flit_d& obj);
-
-// ******************* Definitions *******************
-
-// Output operator definition
-extern inline
-ostream& operator<<(ostream& out, const flit_d& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const flit_d& obj)
 {
-  obj.print(out);
-  out << flush;
-  return out;
+    obj.print(out);
+    out << std::flush;
+    return out;
 }
 
 #endif
index 82f664d26a6b67173e5ce2448e449f32a7c68114..e063e6a0e06285abbc1f113ff8fb7ad730ba47e4 100644 (file)
@@ -39,6 +39,8 @@
 #include "mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh"
 #include "mem/ruby/common/NetDest.hh"
 
+using namespace std;
+
 GarnetNetwork::GarnetNetwork(const Params *p)
   : BaseGarnetNetwork(p)
 {
index 3669799faa3c5fe881f17013461a88198c6baa68..c116a324bebc14cff2433264ef5c34f625f5caba 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef GARNET_NETWORK_H
 #define GARNET_NETWORK_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
 #include "mem/gems_common/Vector.hh"
@@ -58,9 +60,9 @@ public:
         MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
 
         void clearStats();
-        void printStats(ostream& out) const;
-        void printConfig(ostream& out) const;
-        void print(ostream& out) const;
+        void printStats(std::ostream& out) const;
+        void printConfig(std::ostream& out) const;
+        void print(std::ostream& out) const;
 
         bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
         bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }
@@ -101,17 +103,12 @@ private:
         Time m_ruby_start;
 };
 
-// Output operator declaration
-ostream& operator<<(ostream& out, const GarnetNetwork& obj);
-
-// ******************* Definitions *******************
-// Output operator definition
-extern inline
-ostream& operator<<(ostream& out, const GarnetNetwork& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const GarnetNetwork& obj)
 {
-        obj.print(out);
-        out << flush;
-        return out;
+    obj.print(out);
+    out << std::flush;
+    return out;
 }
 
 #endif //NETWORK_H
index 71c433afffdb96f269bc8b236d76e900269c79cf..697f954ab706df6c64d24292b459331d8da859c8 100644 (file)
@@ -290,14 +290,14 @@ void NetworkInterface::checkReschedule()
         }
 }
 
-void NetworkInterface::printConfig(ostream& out) const
+void NetworkInterface::printConfig(std::ostream& out) const
 {
         out << "[Network Interface " << m_id << "] - ";
         out << "[inLink " << inNetLink->get_id() << "] - ";
-        out << "[outLink " << outNetLink->get_id() << "]" << endl;
+        out << "[outLink " << outNetLink->get_id() << "]" << std::endl;
 }
 
-void NetworkInterface::print(ostream& out) const
+void NetworkInterface::print(std::ostream& out) const
 {
         out << "[Network Interface]";
 }
index 67bba5f04984859b0be7d63c5cd0ce018a42df0d..bc270112550b0d0c18c49abf4c5ffa81aecd84d6 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef NET_INTERFACE_H
 #define NET_INTERFACE_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
 #include "mem/gems_common/Vector.hh"
@@ -62,8 +64,8 @@ public:
         }
         void request_vc(int in_vc, int in_port, NetDest destination, Time request_time);
 
-        void printConfig(ostream& out) const;
-        void print(ostream& out) const;
+        void printConfig(std::ostream& out) const;
+        void print(std::ostream& out) const;
 
 private:
 /**************Data Members*************/
index e371d9265a1743b674892d110772d6db1b66128d..3f648ae14ac7dbfa3f97fa1235b0010ef3f730a0 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef NETWORK_LINK_H
 #define NETWORK_LINK_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/FlexibleConsumer.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh"
@@ -50,7 +52,7 @@ public:
         flit* peekLink();
         flit* consumeLink();
 
-        void print(ostream& out) const {}
+        void print(std::ostream& out) const {}
 
         bool is_vc_ready(flit *t_flit);
 
index 9963555cb0bd14fb714bdc3efdf588342dd78532..10696f1add0d5c7b9db1117fb189d91837380615 100644 (file)
@@ -34,6 +34,8 @@
 #include "mem/ruby/network/garnet/flexible-pipeline/OutVcState.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh"
 
+using namespace std;
+
 Router::Router(int id, GarnetNetwork *network_ptr)
 {
         m_id = id;
index 5ec7590a63270aa287d252bdbbf4dc7a1031ef7d..5d2610fae333f1d0723b4bb3affe1fcf0da7b99a 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef ROUTER_H
 #define ROUTER_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/FlexibleConsumer.hh"
@@ -58,8 +60,8 @@ public:
         void release_vc(int out_port, int vc, Time release_time);
         void vc_arbitrate();
 
-        void printConfig(ostream& out) const;
-        void print(ostream& out) const;
+        void printConfig(std::ostream& out) const;
+        void print(std::ostream& out) const;
 
 private:
 /***************Data Members******************/
index 6a8c356f1a81020f0eb8e76d24c82757f088f8dd..3f3223f29bd7884d7ad8cab96c38c17353a49e12 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef VC_ARBITER_H
 #define VC_ARBITER_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/common/Consumer.hh"
 
@@ -41,7 +43,7 @@ public:
         VCarbiter(Router *router);
         ~VCarbiter() {}
 
-        void print(ostream& out) const {}
+        void print(std::ostream& out) const {}
         void wakeup();
 
 private:
index e73a8b9b5fdc1307327917b2ebae90457c2f630f..dd05257549077d02b7e04cb275a2b5d84571eee8 100644 (file)
@@ -96,7 +96,7 @@ flit_type flit::get_type()
         return m_type;
 }
 
-void flit::print(ostream& out) const
+void flit::print(std::ostream& out) const
 {
         out << "[flit:: ";
         out << "Id=" << m_id << " ";
index 2cf3eaade4870b4245629eddd6e9ed9fcd9d82fc..1cc8806e9c28c1d372c0d8653a1620b7a004722b 100644 (file)
@@ -28,6 +28,8 @@
  * Authors: Niket Agarwal
  */
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/ruby/slicc_interface/Message.hh"
 
@@ -48,7 +50,7 @@ public:
         void set_vc(int vc);
         MsgPtr& get_msg_ptr();
         flit_type get_type();
-        void print(ostream&out) const;
+        void print(std::ostream& out) const;
 
 private:
 /************Data Members*************/
@@ -75,18 +77,12 @@ bool node_less_then_eq(flit* n1, flit* n2)
   }
 }
 
-// Output operator declaration
-ostream& operator<<(ostream& out, const flit& obj);
-
-// ******************* Definitions *******************
-
-// Output operator definition
-extern inline
-ostream& operator<<(ostream& out, const flit& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const flit& obj)
 {
-  obj.print(out);
-  out << flush;
-  return out;
+    obj.print(out);
+    out << std::flush;
+    return out;
 }
 
 #endif
index d2f9244dea5f801ab92f636fd86eba0b82268deb..7f41d6f8c6a32030e55b497b40e935faedab2973 100644 (file)
@@ -92,8 +92,8 @@ void flitBuffer::insert(flit *flt)
         m_buffer.insert(flt);
 }
 
-void flitBuffer::print(ostream& out) const
+void flitBuffer::print(std::ostream& out) const
 {
         out << "[flitBuffer: ";
-        out << m_buffer.size() << "] " << endl;
+        out << m_buffer.size() << "] " << std::endl;
 }
index f8b34720c36b7389e785d33900908c3269b4bbed..646cd99c7c59cefab844ffb182ea6e47f7e71b13 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef FLIT_BUFFER_H
 #define FLIT_BUFFER_H
 
+#include <iostream>
+
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 #include "mem/gems_common/PrioHeap.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/flit.hh"
@@ -48,7 +50,7 @@ public:
         flit *getTopFlit();
         flit *peekTopFlit();
         void insert(flit *flt);
-        void print(ostream& out) const;
+        void print(std::ostream& out) const;
 
 /**********Data Members*********/
 private:
@@ -56,17 +58,12 @@ private:
         int size, max_size;
 };
 
-ostream& operator<<(ostream& out, const flitBuffer& obj);
-
-// ******************* Definitions *******************
-
-// Output operator definition
-extern inline
-ostream& operator<<(ostream& out, const flitBuffer& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const flitBuffer& obj)
 {
-  obj.print(out);
-  out << flush;
-  return out;
+    obj.print(out);
+    out << std::flush;
+    return out;
 }
 
 #endif
index bddcb84120edb44a2bdb3f120d89e900178da1ae..4555ef2b357a04113b9142effc0c2643e0c2cff1 100644 (file)
@@ -35,6 +35,8 @@
 #include "mem/ruby/slicc_interface/NetworkMessage.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 const int PRIORITY_SWITCH_LIMIT = 128;
 
 // Operator for helper class
index 26924c2e709f88e0a3cff405d483edfd4ecd3869..2940f19a1d8e777e26cb2a7a65558c736a07d4f5 100644 (file)
@@ -38,6 +38,8 @@
 #include "mem/ruby/profiler/Profiler.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 #if 0
 // ***BIG HACK*** - This is actually code that _should_ be in Network.cc
 
index d8ec89d4946e7767bcf41431ee8367f83dc9b413..f9cb22a6a73046c2224a8c32988ff2d0f2cb71ce 100644 (file)
@@ -63,6 +63,8 @@
 #ifndef __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
 #define __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
 
+#include <iostream>
+
 #include "mem/gems_common/Vector.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/network/Network.hh"
@@ -85,9 +87,9 @@ class SimpleNetwork : public Network
 
     void init();
 
-    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 reset();
 
@@ -112,7 +114,7 @@ class SimpleNetwork : public Network
         const NetDest& routing_table_entry, int link_latency, int link_weight,
         int bw_multiplier, bool isReconfiguration);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
@@ -138,11 +140,11 @@ class SimpleNetwork : public Network
     Vector<Switch*> m_endpoint_switches;
 };
 
-inline ostream&
-operator<<(ostream& out, const SimpleNetwork& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const SimpleNetwork& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 30403cd6748ee968dbac44ad91b05edf393e75e4..e88a245053b25a39907034a75ffb36fcb3a77fac 100644 (file)
@@ -34,6 +34,8 @@
 #include "mem/ruby/network/simple/Switch.hh"
 #include "mem/ruby/network/simple/Throttle.hh"
 
+using namespace std;
+
 Switch::Switch(SwitchID sid, SimpleNetwork* network_ptr)
 {
     m_perfect_switch_ptr = new PerfectSwitch(sid, network_ptr);
@@ -129,8 +131,6 @@ Switch::getThrottles() const
 void
 Switch::printStats(std::ostream& out) const
 {
-    using namespace std;
-
     ccprintf(out, "switch_%d_inlinks: %d\n", m_switch_id,
         m_perfect_switch_ptr->getInLinks());
     ccprintf(out, "switch_%d_outlinks: %d\n", m_switch_id,
index f749672e214819b4ae8475909617a5840a64cda4..2d15b1141c3bbb68cc5387591cef418a04e50cfd 100644 (file)
@@ -34,6 +34,8 @@
 #include "mem/ruby/slicc_interface/NetworkMessage.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 const int HIGH_RANGE = 256;
 const int ADJUST_INTERVAL = 50000;
 const int MESSAGE_SIZE_MULTIPLIER = 1000;
@@ -43,7 +45,7 @@ const int PRIORITY_SWITCH_LIMIT = 128;
 
 static int network_message_to_size(NetworkMessage* net_msg_ptr);
 
-extern std::ostream *debug_cout_ptr;
+extern ostream *debug_cout_ptr;
 
 Throttle::Throttle(int sID, NodeID node, int link_latency,
     int link_bandwidth_multiplier)
index 608754190d900d960783fb523368ebfea1410457..74cd7b356eda17743dd7f0eda056314073ed0b2d 100644 (file)
@@ -38,6 +38,8 @@
 #ifndef __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__
 #define __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__
 
+#include <iostream>
+
 #include "mem/gems_common/Vector.hh"
 #include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/common/Global.hh"
@@ -59,9 +61,9 @@ class Throttle : public Consumer
         const Vector<MessageBuffer*>& out_vec);
     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;
     // The average utilization (a percent) since last clearStats()
     double getUtilization() const;
     int
@@ -80,7 +82,7 @@ class Throttle : public Consumer
 
     void clear();
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     void init(NodeID node, int link_latency, int link_bandwidth_multiplier);
@@ -107,11 +109,11 @@ class Throttle : public Consumer
     double m_links_utilized;
 };
 
-inline ostream&
-operator<<(ostream& out, const Throttle& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Throttle& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 3d7aa35d082d1b2c39eb99a18fc56aa25411f7ad..f2112925536b51ef5613a11a2724cb35d4e64b86 100644 (file)
@@ -36,6 +36,8 @@
 #include "mem/ruby/slicc_interface/AbstractController.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 const int INFINITE_LATENCY = 10000; // Yes, this is a big hack
 const int DEFAULT_BW_MULTIPLIER = 1;  // Just to be consistent with above :)
 
@@ -276,8 +278,6 @@ Topology::clearStats()
 void
 Topology::printConfig(std::ostream& out) const
 {
-    using namespace std;
-
     if (m_print_config == false)
         return;
 
index 978b729823ee90729d521fec206ae11036e8c569..79661ed18a83274859bd7a3618ca089aacb41cd0 100644 (file)
@@ -55,7 +55,7 @@ AccessTraceForAddress::~AccessTraceForAddress()
 }
 
 void
-AccessTraceForAddress::print(ostream& out) const
+AccessTraceForAddress::print(std::ostream& out) const
 {
     out << m_addr;
 
index 53b96856e154613b9ffee2e115810704d4310245..7ca875f3f47a59bb80c73b55ee5d0647d3686f51 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_PROFILER_ACCESSTRACEFORADDRESS_HH__
 #define __MEM_RUBY_PROFILER_ACCESSTRACEFORADDRESS_HH__
 
+#include <iostream>
+
 #include "mem/protocol/AccessModeType.hh"
 #include "mem/protocol/CacheRequestType.hh"
 #include "mem/ruby/common/Address.hh"
@@ -53,7 +55,7 @@ class AccessTraceForAddress
     const Address& getAddress() const { return m_addr; }
     void addSample(int value);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     Address m_addr;
@@ -74,11 +76,11 @@ node_less_then_eq(const AccessTraceForAddress* n1,
     return n1->getTotal() > n2->getTotal();
 }
 
-inline ostream&
-operator<<(ostream& out, const AccessTraceForAddress& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const AccessTraceForAddress& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index cebf22fd8bf5629eb41647e4f649c15e320be3d3..d11e74b018ae563a99705f94f72d246c6ad97b03 100644 (file)
@@ -34,6 +34,7 @@
 #include "mem/ruby/profiler/Profiler.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
 typedef AddressProfiler::AddressMap AddressMap;
 
 // Helper functions
index 76dac323f1a112bd0d021e7556f563271d076ef4..dd6cea52b6276ce6527359314298f93b35156eaa 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
 #define __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
 
+#include <iostream>
+
 #include "mem/protocol/AccessType.hh"
 #include "mem/protocol/CacheMsg.hh"
 #include "mem/ruby/common/Address.hh"
@@ -49,7 +51,7 @@ class AddressProfiler
     AddressProfiler(int num_of_sequencers);
     ~AddressProfiler();
 
-    void printStats(ostream& out) const;
+    void printStats(std::ostream& out) const;
     void clearStats();
 
     void addTraceSample(Address data_addr, Address pc_addr,
@@ -61,7 +63,7 @@ class AddressProfiler
     void profileGetS(const Address& datablock, const Address& PC,
                      const Set& owner, const Set& sharers, NodeID requestor);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
     //added by SS
     void setHotLines(bool hot_lines);
@@ -91,11 +93,11 @@ class AddressProfiler
     int m_num_of_sequencers;
 };
 
-inline ostream&
-operator<<(ostream& out, const AddressProfiler& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const AddressProfiler& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 9d12a46abc1d5b0929eddf72e039520248743625..f359314c1a15a76f957d0fe5458fb388b1aa6726 100644 (file)
@@ -33,6 +33,8 @@
 #include "mem/ruby/profiler/Profiler.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 CacheProfiler::CacheProfiler(const string& description)
 {
     m_description = description;
index 559c169005c0f07fb9dec33bed56c9a06746eab1..fc67f0052bf19757e9cc28e0aa2c5e24668540cf 100644 (file)
@@ -59,7 +59,9 @@
 #include "mem/ruby/system/System.hh"
 #include "mem/ruby/system/System.hh"
 
-extern std::ostream* debug_cout_ptr;
+using namespace std;
+
+extern ostream* debug_cout_ptr;
 
 static double process_memory_total();
 static double process_memory_resident();
index bf4bf8a503cc10726744f2bda8fa286db24c04cc..bb21874887f1e1307a528b2bea5fb72a87d817ae 100644 (file)
@@ -45,6 +45,9 @@
 #ifndef __MEM_RUBY_PROFILER_PROFILER_HH__
 #define __MEM_RUBY_PROFILER_PROFILER_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/protocol/AccessModeType.hh"
 #include "mem/protocol/AccessType.hh"
 #include "mem/protocol/CacheRequestType.hh"
@@ -77,22 +80,22 @@ class Profiler : public SimObject, public Consumer
 
     void wakeup();
 
-    void setPeriodicStatsFile(const string& filename);
+    void setPeriodicStatsFile(const std::string& filename);
     void setPeriodicStatsInterval(integer_t period);
 
-    void printStats(ostream& out, bool short_stats=false);
-    void printShortStats(ostream& out) { printStats(out, true); }
-    void printTraceStats(ostream& out) const;
+    void printStats(std::ostream& out, bool short_stats=false);
+    void printShortStats(std::ostream& out) { printStats(out, true); }
+    void printTraceStats(std::ostream& out) const;
     void clearStats();
-    void printConfig(ostream& out) const;
-    void printResourceUsage(ostream& out) const;
+    void printConfig(std::ostream& out) const;
+    void printResourceUsage(std::ostream& out) const;
 
     AddressProfiler* getAddressProfiler() { return m_address_profiler_ptr; }
     AddressProfiler* getInstructionProfiler() { return m_inst_profiler_ptr; }
 
     void addAddressTraceSample(const CacheMsg& msg, NodeID id);
 
-    void profileRequest(const string& requestStr);
+    void profileRequest(const std::string& requestStr);
     void profileSharing(const Address& addr, AccessType type,
                         NodeID requestor, const Set& sharers,
                         const Set& owner);
@@ -134,13 +137,12 @@ class Profiler : public SimObject, public Consumer
                            GenericMachineType respondingMach);
     void sequencerRequests(int num) { m_sequencer_requests.add(num); }
 
-    void profileTransition(const string& component, NodeID version,
-                           Address addr, const string& state,
-                           const string& event, const string& next_state,
-                           const string& note);
+    void profileTransition(const std::string& component, NodeID version,
+        Address addr, const std::string& state, const std::string& event,
+        const std::string& next_state, const std::string& note);
     void profileMsgDelay(int virtualNetwork, int delayCycles);
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
     void rubyWatch(int proc);
     bool watchAddress(Address addr);
@@ -167,7 +169,7 @@ class Profiler : public SimObject, public Consumer
     Vector<int64> m_instructions_executed_at_start;
     Vector<int64> m_cycles_executed_at_start;
 
-    ostream* m_periodic_output_file_ptr;
+    std::ostream* m_periodic_output_file_ptr;
     integer_t m_stats_period;
 
     Time m_ruby_start;
@@ -210,7 +212,7 @@ class Profiler : public SimObject, public Consumer
     Map<Address, int>* m_watch_address_list_ptr;
     // counts all initiated cache request including PUTs
     int m_requests;
-    Map <string, int>* m_requestProfileMap_ptr;
+    Map <std::string, int>* m_requestProfileMap_ptr;
 
     //added by SS
     bool m_hot_lines;
@@ -219,11 +221,11 @@ class Profiler : public SimObject, public Consumer
     int m_num_of_sequencers;
 };
 
-inline ostream&
-operator<<(ostream& out, const Profiler& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Profiler& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index ce42560b6db7100b1fa3234092d29bfe41d787c9..bcd90ab9dccda13bd384550ad94aec9fbf145aec 100644 (file)
@@ -29,6 +29,8 @@
 #include "mem/ruby/eventqueue/RubyEventQueue.hh"
 #include "mem/ruby/profiler/StoreTrace.hh"
 
+using namespace std;
+
 bool StoreTrace::s_init = false; // Total number of store lifetimes of
                                  // all lines
 int64 StoreTrace::s_total_samples = 0; // Total number of store
index 8bddfe6c77332b938c0e4c5b343b82490e8e8f20..9c0945c157f3394419422c4b257c51fd26d17395 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_PROFILER_STORETRACE_HH__
 #define __MEM_RUBY_PROFILER_STORETRACE_HH__
 
+#include <iostream>
+
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/common/Histogram.hh"
@@ -44,10 +46,10 @@ class StoreTrace
     void downgrade(NodeID node);
     int getTotal() const { return m_total_samples; }
     static void initSummary();
-    static void printSummary(ostream& out);
+    static void printSummary(std::ostream& out);
     static void clearSummary();
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     static bool s_init;
@@ -77,11 +79,11 @@ node_less_then_eq(const StoreTrace* n1, const StoreTrace* n2)
     return n1->getTotal() > n2->getTotal();
 }
 
-inline ostream&
-operator<<(ostream& out, const StoreTrace& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const StoreTrace& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 495a38fc8eacdeee9fadbf4a5d5ffee040c7db69..32db211b60e9681ba1ca2c29549ef4b9e6c23811 100644 (file)
@@ -33,6 +33,8 @@
 #include "mem/ruby/recorder/CacheRecorder.hh"
 #include "mem/ruby/recorder/TraceRecord.hh"
 
+using namespace std;
+
 CacheRecorder::CacheRecorder()
 {
     m_records_ptr = new PrioHeap<TraceRecord>;
index 8c8daa0517f1df296d851681aafbdac2e8a0ede8..7f1e963694a76367dca322c0bc65308d329c0626 100644 (file)
@@ -32,6 +32,8 @@
 #include "mem/ruby/system/System.hh"
 #include "sim/sim_object.hh"
 
+using namespace std;
+
 TraceRecord::TraceRecord(Sequencer* _sequencer, const Address& data_addr,
     const Address& pc_addr, RubyRequestType type, Time time)
 {
index c8dae198617a03e729821f2f5e7a69c60fe44f50..98e78b20e7c626750189e45a4cdaded0d7a07fed 100644 (file)
@@ -34,6 +34,8 @@
 #ifndef __MEM_RUBY_RECORDER_TRACERECORD_HH__
 #define __MEM_RUBY_RECORDER_TRACERECORD_HH__
 
+#include <iostream>
+
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/libruby_internal.hh"
@@ -66,9 +68,9 @@ class TraceRecord
 
     void issueRequest() const;
 
-    void print(ostream& out) const;
-    void output(ostream& out) const;
-    bool input(istream& in);
+    void print(std::ostream& out) const;
+    void output(std::ostream& out) const;
+    bool input(std::istream& in);
 
   private:
     Sequencer* m_sequencer_ptr;
@@ -85,7 +87,7 @@ node_less_then_eq(const TraceRecord& n1, const TraceRecord& n2)
 }
 
 inline std::ostream&
-operator<<(ostream& out, const TraceRecord& obj)
+operator<<(std::ostream& out, const TraceRecord& obj)
 {
     obj.print(out);
     out << std::flush;
index e2d216ba342ab62c4f6d7304bcbe9ffa96a05cd0..23dafdb6cb39dc56879537f78f4b44954fefb1cc 100644 (file)
@@ -33,6 +33,8 @@
 #include "mem/ruby/recorder/Tracer.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 Tracer::Tracer(const Params *p)
     : SimObject(p)
 {
@@ -43,7 +45,7 @@ Tracer::Tracer(const Params *p)
 }
 
 void
-Tracer::startTrace(std::string filename)
+Tracer::startTrace(string filename)
 {
     if (m_enabled)
         stopTrace();
@@ -80,7 +82,7 @@ Tracer::traceRequest(Sequencer* sequencer, const Address& data_addr,
 }
 
 int
-Tracer::playbackTrace(std::string filename)
+Tracer::playbackTrace(string filename)
 {
     igzstream in(filename.c_str());
     if (in.fail()) {
@@ -123,7 +125,7 @@ Tracer::playbackTrace(std::string filename)
 }
 
 void
-Tracer::print(std::ostream& out) const
+Tracer::print(ostream& out) const
 {
 }
 
index 223bc6fc8a669162779f25fdbe30a004bb773db5..66cce58a1f1eb526574a62b5889b85259232d572 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCACHEENTRY_HH__
 #define __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCACHEENTRY_HH__
 
+#include <iostream>
+
 #include "mem/protocol/AccessPermission.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -53,11 +55,11 @@ class AbstractCacheEntry : public AbstractEntry
                                    // block, required by CacheMemory
 };
 
-inline ostream&
-operator<<(ostream& out, const AbstractCacheEntry& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const AbstractCacheEntry& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index facaf2adfe5549300e427c7ceaa09af9c9a03fec..44e47c8ca81b760de07b7b595319533e00bfcd9e 100644 (file)
 #ifndef __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
 #define __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
 
-#include "sim/sim_object.hh"
-#include "params/RubyController.hh"
+#include <iostream>
+#include <string>
 
-#include "mem/ruby/common/Consumer.hh"
 #include "mem/protocol/MachineType.hh"
 #include "mem/ruby/common/Address.hh"
+#include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/network/Network.hh"
+#include "params/RubyController.hh"
+#include "sim/sim_object.hh"
 
 class MessageBuffer;
 class Network;
@@ -50,19 +52,19 @@ class AbstractController : public SimObject, public Consumer
     //  virtual int getNumberOfControllers() const = 0;
     virtual MessageBuffer* getMandatoryQueue() const = 0;
     virtual const int & getVersion() const = 0;
-    virtual const string toString() const = 0;  // returns text version of
-                                                // controller type
-    virtual const string getName() const = 0;   // return instance name
+    virtual const std::string toString() const = 0;  // returns text version of
+                                                     // controller type
+    virtual const std::string getName() const = 0;   // return instance name
     virtual const MachineType getMachineType() const = 0;
     virtual void blockOnQueue(Address, MessageBuffer*) = 0;
     virtual void unblock(Address) = 0;
     virtual void initNetworkPtr(Network* net_ptr) = 0;
 
-    virtual void print(ostream & out) const = 0;
-    virtual void printStats(ostream & out) const = 0;
-    virtual void printConfig(ostream & out) const = 0;
+    virtual void print(std::ostream & out) const = 0;
+    virtual void printStats(std::ostream & out) const = 0;
+    virtual void printConfig(std::ostream & out) const = 0;
     virtual void wakeup() = 0;
-    //  virtual void dumpStats(ostream & out) = 0;
+    //  virtual void dumpStats(std::ostream & out) = 0;
     virtual void clearStats() = 0;
 };
 
index eef9a5227a854c44afcde6800013aa444058b308..19852fbe9590b576ccde7cb6dc006583b780db42 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_SLICC_INTERFACE_ABSTRACTENTRY_HH__
 #define __MEM_RUBY_SLICC_INTERFACE_ABSTRACTENTRY_HH__
 
+#include <iostream>
+
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/protocol/AccessPermission.hh"
@@ -45,14 +47,14 @@ class AbstractEntry
     // is absolutely necessary and should all be virtual function.
     virtual DataBlock& getDataBlk() = 0;
 
-    virtual void print(ostream& out) const = 0;
+    virtual void print(std::ostream& out) const = 0;
 };
 
-inline ostream&
-operator<<(ostream& out, const AbstractEntry& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const AbstractEntry& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 8a7c00094a969aa0d98da6db5f5b7b4bf7da190c..41365ff9ed8d3394c3d295d277904a1fe933d616 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_SLICC_INTERFACE_NETWORKMESSAGE_HH__
 #define __MEM_RUBY_SLICC_INTERFACE_NETWORKMESSAGE_HH__
 
+#include <iostream>
+
 #include "mem/gems_common/RefCnt.hh"
 #include "mem/gems_common/RefCountable.hh"
 #include "mem/protocol/MessageSizeType.hh"
@@ -76,18 +78,18 @@ class NetworkMessage : public Message
         return m_internal_dest;
     }
 
-    virtual void print(ostream& out) const = 0;
+    virtual void print(std::ostream& out) const = 0;
 
   private:
     NetDest m_internal_dest;
     bool m_internal_dest_valid;
 };
 
-inline ostream&
-operator<<(ostream& out, const NetworkMessage& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const NetworkMessage& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 6ffc7fdb4b7ce22604cd6a01eab82371efc6e3ee..2385b1cbc28851e497767c57dda224b66ee3097f 100644 (file)
@@ -34,6 +34,8 @@
 #include "mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 void
 profile_request(int cache_state, Directory_State directory_state,
                 GenericRequestType request_type)
index 25495b6fa77f0daaebd2c7c7ac19b2b9a8f7f113..10d1c0e5be517880f32c24110cd5fea07b8cfb88 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef __MEM_RUBY_SLICC_INTERFACE_RUBYSLICC_PROFILER_INTERFACE_HH__
 #define __MEM_RUBY_SLICC_INTERFACE_RUBYSLICC_PROFILER_INTERFACE_HH__
 
+#include <string>
+
 #include "mem/protocol/AccessType.hh"
 #include "mem/protocol/Directory_State.hh"
 #include "mem/protocol/GenericRequestType.hh"
@@ -50,10 +52,10 @@ void profile_outstanding_persistent_request(int outstanding);
 void profile_outstanding_request(int outstanding);
 void profile_sharing(const Address& addr, AccessType type, NodeID requestor,
                      const Set& sharers, const Set& owner);
-void profile_request(const string& L1CacheStateStr,
-                     const string& L2CacheStateStr,
-                     const string& directoryStateStr,
-                     const string& requestTypeStr);
+void profile_request(const std::string& L1CacheStateStr,
+                     const std::string& L2CacheStateStr,
+                     const std::string& directoryStateStr,
+                     const std::string& requestTypeStr);
 void profile_miss(const CacheMsg& msg, NodeID id);
 void profile_L1Cache_miss(const CacheMsg& msg, NodeID id);
 void profile_L2Cache_miss(GenericRequestType requestType, AccessModeType type,
index 10ea8a6fc9a7ba414fec7bd1b144570db1de9d04..1e188fb6006b7edc8c5d5a389f0256e9ce03a413 100644 (file)
@@ -28,6 +28,8 @@
 
 #include "mem/ruby/system/CacheMemory.hh"
 
+using namespace std;
+
 ostream&
 operator<<(ostream& out, const CacheMemory& obj)
 {
index bdf2bb25cb1bd706ef84f6ecbbbb0f44ee157cc2..21756a606b755e7af798b032fef3065c887922de 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_SYSTEM_CACHEMEMORY_HH__
 #define __MEM_RUBY_SYSTEM_CACHEMEMORY_HH__
 
+#include <iostream>
+#include <string>
 #include <vector>
 
 #include "base/hashmap.hh"
@@ -61,7 +63,7 @@ class CacheMemory : public SimObject
     void init();
 
     // Public Methods
-    void printConfig(ostream& out);
+    void printConfig(std::ostream& out);
 
     // perform a cache access and see if we hit or not.  Return true on a hit.
     bool tryCacheAccess(const Address& address, CacheRequestType type,
@@ -120,11 +122,11 @@ class CacheMemory : public SimObject
     void clearLocked (const Address& addr);
     bool isLocked (const Address& addr, int context);
     // Print cache contents
-    void print(ostream& out) const;
-    void printData(ostream& out) const;
+    void print(std::ostream& out) const;
+    void printData(std::ostream& out) const;
 
     void clearStats() const;
-    void printStats(ostream& out) const;
+    void printStats(std::ostream& out) const;
 
   private:
     // convert a Address to its location in the cache
@@ -141,7 +143,7 @@ class CacheMemory : public SimObject
     CacheMemory& operator=(const CacheMemory& obj);
 
   private:
-    const string m_cache_name;
+    const std::string m_cache_name;
     int m_latency;
 
     // Data Members (m_prefix)
@@ -159,7 +161,7 @@ class CacheMemory : public SimObject
     CacheProfiler* m_profiler_ptr;
 
     int m_cache_size;
-    string m_policy;
+    std::string m_policy;
     int m_cache_num_sets;
     int m_cache_num_set_bits;
     int m_cache_assoc;
index 315dab62aaa3cf473af7f86b1dd46c45036660c2..5d9037358b2725575dcd440d1716b650ea572856 100644 (file)
@@ -164,7 +164,7 @@ DMASequencer::ackCallback()
 }
 
 void
-DMASequencer::printConfig(ostream & out)
+DMASequencer::printConfig(std::ostream & out)
 {
 }
 
index 7fb9b44a04023c0a4812ab4aea6ce0dc59ece31d..b3999fb3f91a76aad54b808e159bd71aeed27ef9 100644 (file)
@@ -31,6 +31,8 @@
 #include "mem/ruby/system/DirectoryMemory.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 int DirectoryMemory::m_num_directories = 0;
 int DirectoryMemory::m_num_directories_bits = 0;
 uint64_t DirectoryMemory::m_total_size_bytes = 0;
index 4e7bfc4f69ef9ae61bd6c51c89582be7711f705f..79b04726a9de9e77506cfc8471581b83c0bae43f 100644 (file)
@@ -29,6 +29,9 @@
 #ifndef __MEM_RUBY_SYSTEM_DIRECTORYMEMORY_HH__
 #define __MEM_RUBY_SYSTEM_DIRECTORYMEMORY_HH__
 
+#include <iostream>
+#include <string>
+
 #include "mem/protocol/Directory_Entry.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -52,15 +55,15 @@ class DirectoryMemory : public SimObject
     bool isSparseImplementation() { return m_use_map; }
     uint64 getSize() { return m_size_bytes; }
 
-    void printConfig(ostream& out) const;
-    static void printGlobalConfig(ostream & out);
+    void printConfig(std::ostream& out) const;
+    static void printGlobalConfig(std::ostream & out);
     bool isPresent(PhysAddress address);
     Directory_Entry& lookup(PhysAddress address);
 
     void invalidateBlock(PhysAddress address);
 
-    void print(ostream& out) const;
-    void printStats(ostream& out) const;
+    void print(std::ostream& out) const;
+    void printStats(std::ostream& out) const;
 
   private:
     // Private copy constructor and assignment operator
@@ -68,7 +71,7 @@ class DirectoryMemory : public SimObject
     DirectoryMemory& operator=(const DirectoryMemory& obj);
 
   private:
-    const string m_name;
+    const std::string m_name;
     Directory_Entry **m_entries;
     // int m_size;  // # of memory module blocks this directory is
                     // responsible for
@@ -88,11 +91,11 @@ class DirectoryMemory : public SimObject
     int m_map_levels;
 };
 
-inline ostream&
-operator<<(ostream& out, const DirectoryMemory& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const DirectoryMemory& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 963cc39471a6f343d0b29d5361d4a0d6aad80234..3644a3e59000bb925b190dbe20a9fcd8e6dd7f5e 100644 (file)
  *
  */
 
-#include <list>
-
 #include "base/cprintf.hh"
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/system/MemoryControl.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 class Consumer;
 
 // Value to reset watchdog timer to.
index d42c1e6e08f9d2093ff6b2a67278fec2a15c094f..73646f623e5aa087fe03af9d2f0eb13e641f14b3 100644 (file)
@@ -29,7 +29,9 @@
 #ifndef __MEM_RUBY_SYSTEM_MEMORY_CONTROL_HH__
 #define __MEM_RUBY_SYSTEM_MEMORY_CONTROL_HH__
 
+#include <iostream>
 #include <list>
+#include <string>
 
 #include "mem/gems_common/Map.hh"
 #include "mem/gems_common/util.hh"
@@ -67,8 +69,8 @@ class MemoryControl :
 
     void setConsumer(Consumer* consumer_ptr);
     Consumer* getConsumer() { return m_consumer_ptr; };
-    void setDescription(const string& name) { m_description = name; };
-    string getDescription() { return m_description; };
+    void setDescription(const std::string& name) { m_description = name; };
+    std::string getDescription() { return m_description; };
 
     // Called from the directory:
     void enqueue(const MsgPtr& message, int latency );
@@ -82,11 +84,11 @@ class MemoryControl :
     //// Called from L3 cache:
     //void writeBack(physical_address_t addr);
 
-    void printConfig(ostream& out);
-    void print(ostream& out) const;
+    void printConfig(std::ostream& out);
+    void print(std::ostream& out) const;
     void setDebug(int debugFlag);
     void clearStats() const;
-    void printStats(ostream& out) const;
+    void printStats(std::ostream& out) const;
 
     //added by SS
     int getBanksPerRank() { return m_banks_per_rank; };
@@ -109,7 +111,7 @@ class MemoryControl :
 
     // data members
     Consumer* m_consumer_ptr;  // Consumer to signal a wakeup()
-    string m_description;
+    std::string m_description;
     int m_msg_counter;
     int m_awakened;
 
@@ -136,9 +138,9 @@ class MemoryControl :
     int m_refresh_period_system;
 
     // queues where memory requests live
-    list<MemoryNode> m_response_queue;
-    list<MemoryNode> m_input_queue;
-    list<MemoryNode>* m_bankQueues;
+    std::list<MemoryNode> m_response_queue;
+    std::list<MemoryNode> m_input_queue;
+    std::list<MemoryNode>* m_bankQueues;
 
     // Each entry indicates number of address-bus cycles until bank
     // is reschedulable:
index f1fb8b2e96569da6122e8cfff96a4ec0fddcf46a..e1d816923fc41b353362b01f3516590429455e38 100644 (file)
@@ -43,8 +43,8 @@ struct PerfectCacheLineState
 };
 
 template<class ENTRY>
-inline ostream&
-operator<<(ostream& out, const PerfectCacheLineState<ENTRY>& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const PerfectCacheLineState<ENTRY>& obj)
 {
     return out;
 }
@@ -55,7 +55,7 @@ class PerfectCacheMemory
   public:
     PerfectCacheMemory();
 
-    static void printConfig(ostream& out);
+    static void printConfig(std::ostream& out);
 
     // perform a cache access and see if we hit or not.  Return true
     // on a hit.
@@ -86,7 +86,7 @@ class PerfectCacheMemory
     void changePermission(const Address& address, AccessPermission new_perm);
 
     // Print cache contents
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     // Private copy constructor and assignment operator
@@ -98,11 +98,11 @@ class PerfectCacheMemory
 };
 
 template<class ENTRY>
-inline ostream&
-operator<<(ostream& out, const PerfectCacheMemory<ENTRY>& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const PerfectCacheMemory<ENTRY>& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
@@ -114,7 +114,7 @@ PerfectCacheMemory<ENTRY>::PerfectCacheMemory()
 
 template<class ENTRY>
 inline void
-PerfectCacheMemory<ENTRY>::printConfig(ostream& out)
+PerfectCacheMemory<ENTRY>::printConfig(std::ostream& out)
 {
 }
 
@@ -206,7 +206,7 @@ PerfectCacheMemory<ENTRY>::changePermission(const Address& address,
 
 template<class ENTRY>
 inline void
-PerfectCacheMemory<ENTRY>::print(ostream& out) const
+PerfectCacheMemory<ENTRY>::print(std::ostream& out) const
 {
 }
 
index 979a0d4abbd2787d64a43d7c959a16ffa13d3302..64730ee2918dc9cd11ef37a6c896e78b8ea29d67 100644 (file)
@@ -29,6 +29,8 @@
 #include "mem/gems_common/util.hh"
 #include "mem/ruby/system/PersistentTable.hh"
 
+using namespace std;
+
 // randomize so that handoffs are not locality-aware
 #if 0
 int persistent_randomize[] = {0, 4, 8, 12, 1, 5, 9, 13, 2, 6,
index 64203c82cad2f102ebc62735c18caea16bb092f0..667d68dcbe30aa9aff59a19f994d90c11b556d5c 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_SYSTEM_PERSISTENTTABLE_HH__
 #define __MEM_RUBY_SYSTEM_PERSISTENTTABLE_HH__
 
+#include <iostream>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/protocol/AccessType.hh"
 #include "mem/ruby/common/Address.hh"
@@ -39,7 +41,7 @@
 class PersistentTableEntry
 {
   public:
-    void print(ostream& out) const {}
+    void print(std::ostream& out) const {}
 
     NetDest m_starving;
     NetDest m_marked;
@@ -67,9 +69,9 @@ class PersistentTable
     int countStarvingForAddress(const Address& addr) const;
     int countReadStarvingForAddress(const Address& addr) const;
 
-    static void printConfig(ostream& out) {}
+    static void printConfig(std::ostream& out) {}
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     // Private copy constructor and assignment operator
@@ -80,19 +82,19 @@ class PersistentTable
     Map<Address, PersistentTableEntry>* m_map_ptr;
 };
 
-inline ostream&
-operator<<(ostream& out, const PersistentTable& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const PersistentTable& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
-inline ostream&
-operator<<(ostream& out, const PersistentTableEntry& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const PersistentTableEntry& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 4038c6007fc71ccf5be3003e840a780105c932ce..56701cd5c398822001bf452cabd425740be35188 100644 (file)
@@ -39,8 +39,6 @@
 #include "mem/tport.hh"
 #include "params/RubyPort.hh"
 
-using namespace std;
-
 class MessageBuffer;
 class AbstractController;
 
@@ -110,7 +108,7 @@ class RubyPort : public MemObject
     void setController(AbstractController* _cntrl) { m_controller = _cntrl; }
 
   protected:
-    const string m_name;
+    const std::string m_name;
     void ruby_hit_callback(PacketPtr pkt);
     void hit(PacketPtr pkt);
 
index a473ccf445b9d8f4ad45cf6b8595abac5ca40d7c..42bf7ebb5c1169a9d77440a599ab02c48d7395f7 100644 (file)
@@ -43,6 +43,8 @@
 #include "mem/ruby/system/System.hh"
 #include "params/RubySequencer.hh"
 
+using namespace std;
+
 Sequencer *
 RubySequencerParams::create()
 {
index 69fd3b771b9c91fa183432ed8be68f19bc427067..a5b2dd544efb78ce3a50943de2f06a046f4c2f09 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_SYSTEM_SEQUENCER_HH__
 #define __MEM_RUBY_SYSTEM_SEQUENCER_HH__
 
+#include <iostream>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/protocol/AccessModeType.hh"
 #include "mem/protocol/CacheRequestType.hh"
@@ -68,9 +70,9 @@ class Sequencer : public RubyPort, public Consumer
     // Public Methods
     void wakeup(); // Used only for deadlock detection
 
-    void printConfig(ostream& out) const;
+    void printConfig(std::ostream& out) const;
 
-    void printProgress(ostream& out) const;
+    void printProgress(std::ostream& out) const;
 
     void writeCallback(const Address& address, DataBlock& data);
     void readCallback(const Address& address, DataBlock& data);
@@ -79,8 +81,8 @@ class Sequencer : public RubyPort, public Consumer
     RequestStatus getRequestStatus(const RubyRequest& request);
     bool empty() const;
 
-    void print(ostream& out) const;
-    void printStats(ostream & out) const;
+    void print(std::ostream& out) const;
+    void printStats(std::ostream& out) const;
     void checkCoherence(const Address& address);
 
     void removeRequest(SequencerRequest* request);
@@ -133,11 +135,11 @@ class Sequencer : public RubyPort, public Consumer
     SequencerWakeupEvent deadlockCheckEvent;
 };
 
-inline ostream&
-operator<<(ostream& out, const Sequencer& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Sequencer& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index 70e00f14bea25ba96429284ed571e130fce1dc70..c4f63632209c81b616d08547adc87659d18ba1b3 100644 (file)
@@ -28,6 +28,8 @@
 
 #include "mem/ruby/system/SparseMemory.hh"
 
+using namespace std;
+
 SparseMemory::SparseMemory(int number_of_bits, int number_of_levels)
 {
     int even_level_bits;
index 2c207aa3f7cb58d294d7aee9f294a70cd476b6b1..0601a8ca554d5762c8ffb6146b80a8201ecfe13b 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_SYSTEM_SPARSEMEMORY_HH__
 #define __MEM_RUBY_SYSTEM_SPARSEMEMORY_HH__
 
+#include <iostream>
+
 #include "base/hashmap.hh"
 #include "mem/protocol/Directory_Entry.hh"
 #include "mem/ruby/common/Address.hh"
@@ -55,7 +57,7 @@ class SparseMemory
     SparseMemory(int number_of_bits, int number_of_levels);
     ~SparseMemory();
 
-    void printConfig(ostream& out) { }
+    void printConfig(std::ostream& out) { }
 
     bool exist(const Address& address) const;
     void add(const Address& address);
@@ -64,8 +66,8 @@ class SparseMemory
     Directory_Entry* lookup(const Address& address);
 
     // Print cache contents
-    void print(ostream& out) const;
-    void printStats(ostream& out) const;
+    void print(std::ostream& out) const;
+    void printStats(std::ostream& out) const;
 
   private:
     // Private Methods
@@ -93,11 +95,11 @@ class SparseMemory
     uint64_t* m_removes_per_level;
 };
 
-inline ostream&
-operator<<(ostream& out, const SparseMemEntry& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const SparseMemEntry& obj)
 {
     out << "SparseMemEntry";
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index ef4b6629088f19eb83cc4e81ca83854ef0e4b7fa..418b31bf031d659c0aeb786f3911c6b2cb8e31f4 100644 (file)
@@ -36,6 +36,8 @@
 #include "mem/ruby/system/MemoryVector.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 int RubySystem::m_random_seed;
 bool RubySystem::m_randomization;
 Tick RubySystem::m_clock;
index ccec2d61c098983f5e0ded047254af54d8a64442..f501c5a83a152564758e7982c266a602ffec987c 100644 (file)
@@ -113,8 +113,8 @@ class RubySystem : public SimObject
     }
 
     void recordCacheContents(CacheRecorder& tr) const;
-    static void printConfig(ostream& out);
-    static void printStats(ostream& out);
+    static void printConfig(std::ostream& out);
+    static void printStats(std::ostream& out);
     void clearStats() const;
 
     uint64 getInstructionCount(int thread) { return 1; }
@@ -124,7 +124,7 @@ class RubySystem : public SimObject
         return g_eventQueue_ptr->getTime();
     }
 
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     // Private copy constructor and assignment operator
@@ -133,7 +133,7 @@ class RubySystem : public SimObject
 
     void init();
 
-    static void printSystemConfig(ostream& out);
+    static void printSystemConfig(std::ostream& out);
 
   private:
     // configuration parameters
@@ -153,23 +153,23 @@ class RubySystem : public SimObject
     static MemoryVector* m_mem_vec_ptr;
 };
 
-inline ostream&
-operator<<(ostream& out, const RubySystem& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const RubySystem& obj)
 {
     //obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
 class RubyExitCallback : public Callback
 {
   private:
-    string stats_filename;
+    std::string stats_filename;
 
   public:
     virtual ~RubyExitCallback() {}
 
-    RubyExitCallback(const string& _stats_filename)
+    RubyExitCallback(const std::string& _stats_filename)
     {
         stats_filename = _stats_filename;
     }
index d21946abd14873a38495f4332392e4c3d7a8091e..fa1e6c8dd14abae0e60abb6ccc00f745a81473ea 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __MEM_RUBY_SYSTEM_TBETABLE_HH__
 #define __MEM_RUBY_SYSTEM_TBETABLE_HH__
 
+#include <iostream>
+
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -45,9 +47,9 @@ class TBETable
     }
 
     void
-    printConfig(ostream& out)
+    printConfig(std::ostream& out)
     {
-        out << "TBEs_per_TBETable: " << m_number_of_TBEs << endl;
+        out << "TBEs_per_TBETable: " << m_number_of_TBEs << std::endl;
     }
 
     bool isPresent(const Address& address) const;
@@ -63,7 +65,7 @@ class TBETable
     const ENTRY& lookup(const Address& address) const;
 
     // Print cache contents
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     // Private copy constructor and assignment operator
@@ -78,11 +80,11 @@ class TBETable
 };
 
 template<class ENTRY>
-inline ostream&
-operator<<(ostream& out, const TBETable<ENTRY>& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const TBETable<ENTRY>& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
@@ -133,7 +135,7 @@ TBETable<ENTRY>::lookup(const Address& address) const
 
 template<class ENTRY>
 inline void
-TBETable<ENTRY>::print(ostream& out) const
+TBETable<ENTRY>::print(std::ostream& out) const
 {
 }
 
index eba04e3e3a5c9a4dc4337beb2482df61e72c6941..c623677f3b51f59cad9317e3a46fe4fcd724b204 100644 (file)
@@ -96,7 +96,7 @@ TimerTable::unset(const Address& address)
 }
 
 void
-TimerTable::print(ostream& out) const
+TimerTable::print(std::ostream& out) const
 {
 }
 
index 96b4b0b15a139900e28adf1b9e46ab8ba4d7a5c8..4c1d2afa3e19e503b1543a9f75498789d9619c06 100644 (file)
@@ -30,6 +30,8 @@
 #define __MEM_RUBY_SYSTEM_TIMERTABLE_HH__
 
 #include <cassert>
+#include <iostream>
+#include <string>
 
 #include "mem/gems_common/Map.hh"
 #include "mem/ruby/common/Address.hh"
@@ -42,7 +44,7 @@ class TimerTable
   public:
     TimerTable();
 
-    static void printConfig(ostream& out) {}
+    static void printConfig(std::ostream& out) {}
 
     void
     setConsumer(Consumer* consumer_ptr)
@@ -52,7 +54,7 @@ class TimerTable
     }
 
     void
-    setDescription(const string& name)
+    setDescription(const std::string& name)
     {
         m_name = name;
     }
@@ -62,7 +64,7 @@ class TimerTable
     bool isSet(const Address& address) const { return m_map.exist(address); }
     void set(const Address& address, Time relative_latency);
     void unset(const Address& address);
-    void print(ostream& out) const;
+    void print(std::ostream& out) const;
 
   private:
     void updateNext() const;
@@ -77,17 +79,14 @@ class TimerTable
     mutable Time m_next_time; // Only valid if m_next_valid is true
     mutable Address m_next_address;  // Only valid if m_next_valid is true
     Consumer* m_consumer_ptr;  // Consumer to signal a wakeup()
-    string m_name;
+    std::string m_name;
 };
 
-// ******************* Definitions *******************
-
-// Output operator definition
-inline ostream&
-operator<<(ostream& out, const TimerTable& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const TimerTable& obj)
 {
     obj.print(out);
-    out << flush;
+    out << std::flush;
     return out;
 }
 
index a20f4b7496f300d99c8345e4cce5e007dbf7d56a..da07a0165c102f1d6c19dbaa16496f96cf054ac2 100644 (file)
@@ -66,6 +66,6 @@ class EnumDeclAST(DeclAST):
 
         pairs = { "external" : "yes" }
         func = Func(self.symtab, func_id, self.location,
-                    self.symtab.find("string", Type), [ t ], [], "",
+                    self.symtab.find("std::string", Type), [ t ], [], "",
                     pairs, None)
         self.symtab.newSymbol(func)
index 773e8f35c5455b00d23d8b78c54c6adf57775c26..6d259c17f93d2cf389caa35aab4a9b6df345bd07 100644 (file)
@@ -39,7 +39,7 @@ class LiteralExprAST(ExprAST):
 
     def generate(self, code):
         fix = code.nofix()
-        if self.type == "string":
+        if self.type == "std::string":
             code('("${{self.literal}}")')
         elif self.type == "bool":
             code('(${{str(self.literal).lower()}})')
index ae8a9342f2db9871509a0a3f1a439377b538ebb9..1505e1d0c91f481ad04f672d06bcbada002f4e7b 100644 (file)
@@ -394,8 +394,16 @@ class SLICC(Grammar):
         "types : empty"
         p[0] = []
 
-    def p_type(self, p):
-        "type : ident"
+    def p_typestr__multi(self, p):
+        "typestr : typestr DOUBLE_COLON ident"
+        p[0] = '%s::%s' % (p[1], p[3])
+
+    def p_typestr__single(self, p):
+        "typestr : ident"
+        p[0] = p[1]
+
+    def p_type__one(self, p):
+        "type : typestr"
         p[0] = ast.TypeAST(self, p[1])
 
     def p_void(self, p):
@@ -670,7 +678,7 @@ class SLICC(Grammar):
 
     def p_literal__string(self, p):
         "literal : STRING"
-        p[0] = ast.LiteralExprAST(self, p[1], "string")
+        p[0] = ast.LiteralExprAST(self, p[1], "std::string")
 
     def p_literal__number(self, p):
         "literal : NUMBER"
index 459cca52ac1530e8540be092d9b96ee3303bfbfd..a5751344a36218de45d59792014be6a150034ece 100644 (file)
@@ -81,6 +81,7 @@ class Func(Symbol):
         if self.isInternalMachineFunc:
             code('#include "mem/protocol/${{self.machineStr}}_Controller.hh"')
 
+        code('using namespace std;')
         # Generate function header
         void_type = self.symtab.find("void", Type)
         return_type = self.return_type.c_ident
index 0c66ddab4e6db3e1a65ebd7ef6ab680b78a48528..a58c1e9c73f3c44509583388a52c0bb20c03cbcf 100644 (file)
@@ -32,7 +32,7 @@ from slicc.symbols.Var import Var
 import slicc.generate.html as html
 
 python_class_map = {"int": "Int",
-                    "string": "String",
+                    "std::string": "String",
                     "bool": "Bool",
                     "CacheMemory": "RubyCache",
                     "Sequencer": "RubySequencer",
@@ -271,12 +271,12 @@ std::string m_name;
 int m_transitions_per_cycle;
 int m_buffer_size;
 int m_recycle_latency;
-map<std::string, std::string> m_cfg;
+std::map<std::string, std::string> m_cfg;
 NodeID m_version;
 Network* m_net_ptr;
 MachineID m_machineID;
 bool m_is_blocking;
-map< Address, MessageBuffer* > m_block_map;
+std::map<Address, MessageBuffer*> m_block_map;
 ${ident}_Profiler s_profiler;
 static int m_num_controllers;
 
@@ -714,6 +714,8 @@ $c_ident::${{action.ident}}(const Address& addr)
 #include "mem/protocol/Types.hh"
 #include "mem/ruby/system/System.hh"
 
+using namespace std;
+
 void
 ${ident}_Controller::wakeup()
 {
index 645291ac225e293428a98408f7f10406c4f7f7c4..c4b4d4275814e4d95ccea30cc9844e5fd311e95c 100644 (file)
@@ -385,12 +385,7 @@ set${{dm.ident}}(const ${{dm.type.c_ident}}& local_${{dm.ident}})
         code('};')
 
         code('''
-// Output operator declaration
-std::ostream&
-operator<<(std::ostream& out, const ${{self.c_ident}}& obj);
-
-// Output operator definition
-extern inline std::ostream&
+inline std::ostream&
 operator<<(std::ostream& out, const ${{self.c_ident}}& obj)
 {
     obj.print(out);