diff options
Diffstat (limited to 'src')
131 files changed, 550 insertions, 391 deletions
diff --git a/src/cpu/rubytest/Check.cc b/src/cpu/rubytest/Check.cc index ca7ca8457..867e755a8 100644 --- a/src/cpu/rubytest/Check.cc +++ b/src/cpu/rubytest/Check.cc @@ -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 diff --git a/src/cpu/rubytest/Check.hh b/src/cpu/rubytest/Check.hh index 5f621a018..6d41dfc59 100644 --- a/src/cpu/rubytest/Check.hh +++ b/src/cpu/rubytest/Check.hh @@ -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; } diff --git a/src/cpu/rubytest/CheckTable.cc b/src/cpu/rubytest/CheckTable.cc index 875b4b31e..1674ca234 100644 --- a/src/cpu/rubytest/CheckTable.cc +++ b/src/cpu/rubytest/CheckTable.cc @@ -126,6 +126,6 @@ CheckTable::getCheck(const Address& address) } void -CheckTable::print(ostream& out) const +CheckTable::print(std::ostream& out) const { } diff --git a/src/cpu/rubytest/RubyTester.cc b/src/cpu/rubytest/RubyTester.cc index b2af22a6e..3ad977b42 100644 --- a/src/cpu/rubytest/RubyTester.cc +++ b/src/cpu/rubytest/RubyTester.cc @@ -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 * diff --git a/src/cpu/rubytest/RubyTester.hh b/src/cpu/rubytest/RubyTester.hh index f4cf4a04d..634e61f88 100644 --- a/src/cpu/rubytest/RubyTester.hh +++ b/src/cpu/rubytest/RubyTester.hh @@ -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; } diff --git a/src/mem/gems_common/Vector.hh b/src/mem/gems_common/Vector.hh index e10849213..ddba7a2fc 100644 --- a/src/mem/gems_common/Vector.hh +++ b/src/mem/gems_common/Vector.hh @@ -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> diff --git a/src/mem/protocol/MESI_CMP_directory-L2cache.sm b/src/mem/protocol/MESI_CMP_directory-L2cache.sm index e7877211a..4739451b1 100644 --- a/src/mem/protocol/MESI_CMP_directory-L2cache.sm +++ b/src/mem/protocol/MESI_CMP_directory-L2cache.sm @@ -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)); } diff --git a/src/mem/protocol/MESI_SCMP_bankdirectory-L2cache.sm b/src/mem/protocol/MESI_SCMP_bankdirectory-L2cache.sm index 0bd9c2b14..8d3c2126f 100644 --- a/src/mem/protocol/MESI_SCMP_bankdirectory-L2cache.sm +++ b/src/mem/protocol/MESI_SCMP_bankdirectory-L2cache.sm @@ -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)); } diff --git a/src/mem/protocol/MOESI_CMP_directory-L2cache.sm b/src/mem/protocol/MOESI_CMP_directory-L2cache.sm index dff1dab27..0316e2310 100644 --- a/src/mem/protocol/MOESI_CMP_directory-L2cache.sm +++ b/src/mem/protocol/MOESI_CMP_directory-L2cache.sm @@ -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); } diff --git a/src/mem/protocol/MOESI_CMP_token-L2cache.sm b/src/mem/protocol/MOESI_CMP_token-L2cache.sm index d3e11349d..789a2b5cd 100644 --- a/src/mem/protocol/MOESI_CMP_token-L2cache.sm +++ b/src/mem/protocol/MOESI_CMP_token-L2cache.sm @@ -183,7 +183,7 @@ machine(L2Cache, "Token protocol") } } - string getStateStr(Address addr) { + std::string getStateStr(Address addr) { return L2Cache_State_to_string(getState(addr)); } diff --git a/src/mem/protocol/MSI_MOSI_CMP_directory-L1cache.sm b/src/mem/protocol/MSI_MOSI_CMP_directory-L1cache.sm index c16a2fe80..6ca749ac7 100644 --- a/src/mem/protocol/MSI_MOSI_CMP_directory-L1cache.sm +++ b/src/mem/protocol/MSI_MOSI_CMP_directory-L1cache.sm @@ -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)); } diff --git a/src/mem/protocol/MSI_MOSI_CMP_directory-L2cache.sm b/src/mem/protocol/MSI_MOSI_CMP_directory-L2cache.sm index 9f85e3a8f..8dbe5b8db 100644 --- a/src/mem/protocol/MSI_MOSI_CMP_directory-L2cache.sm +++ b/src/mem/protocol/MSI_MOSI_CMP_directory-L2cache.sm @@ -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)); } diff --git a/src/mem/protocol/MSI_MOSI_CMP_directory-dir.sm b/src/mem/protocol/MSI_MOSI_CMP_directory-dir.sm index 435bf0eff..e806b333c 100644 --- a/src/mem/protocol/MSI_MOSI_CMP_directory-dir.sm +++ b/src/mem/protocol/MSI_MOSI_CMP_directory-dir.sm @@ -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); } diff --git a/src/mem/protocol/MSI_MOSI_CMP_directory-msg.sm b/src/mem/protocol/MSI_MOSI_CMP_directory-msg.sm index 80ab0f246..fc653983a 100644 --- a/src/mem/protocol/MSI_MOSI_CMP_directory-msg.sm +++ b/src/mem/protocol/MSI_MOSI_CMP_directory-msg.sm @@ -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"; } diff --git a/src/mem/protocol/RubySlicc_Exports.sm b/src/mem/protocol/RubySlicc_Exports.sm index 8f1e5a6eb..599e895db 100644 --- a/src/mem/protocol/RubySlicc_Exports.sm +++ b/src/mem/protocol/RubySlicc_Exports.sm @@ -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); diff --git a/src/mem/protocol/RubySlicc_Profiler.sm b/src/mem/protocol/RubySlicc_Profiler.sm index d360af160..ce1183e22 100644 --- a/src/mem/protocol/RubySlicc_Profiler.sm +++ b/src/mem/protocol/RubySlicc_Profiler.sm @@ -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); diff --git a/src/mem/protocol/RubySlicc_Util.sm b/src/mem/protocol/RubySlicc_Util.sm index e1771448f..d4232650f 100644 --- a/src/mem/protocol/RubySlicc_Util.sm +++ b/src/mem/protocol/RubySlicc_Util.sm @@ -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(); diff --git a/src/mem/ruby/buffers/MessageBuffer.cc b/src/mem/ruby/buffers/MessageBuffer.cc index 83bb34dad..086f92ab7 100644 --- a/src/mem/ruby/buffers/MessageBuffer.cc +++ b/src/mem/ruby/buffers/MessageBuffer.cc @@ -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; diff --git a/src/mem/ruby/common/Address.cc b/src/mem/ruby/common/Address.cc index e74bdb47b..2d895cc33 100644 --- a/src/mem/ruby/common/Address.cc +++ b/src/mem/ruby/common/Address.cc @@ -29,23 +29,23 @@ #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) diff --git a/src/mem/ruby/common/Address.hh b/src/mem/ruby/common/Address.hh index c495f8d86..dc58d012f 100644 --- a/src/mem/ruby/common/Address.hh +++ b/src/mem/ruby/common/Address.hh @@ -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" diff --git a/src/mem/ruby/common/Driver.hh b/src/mem/ruby/common/Driver.hh index f5f2f9c58..8d687ef4f 100644 --- a/src/mem/ruby/common/Driver.hh +++ b/src/mem/ruby/common/Driver.hh @@ -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); diff --git a/src/mem/ruby/common/NetDest.cc b/src/mem/ruby/common/NetDest.cc index 1edf6d1a6..f694af99b 100644 --- a/src/mem/ruby/common/NetDest.cc +++ b/src/mem/ruby/common/NetDest.cc @@ -260,7 +260,7 @@ NetDest::setSize() } void -NetDest::print(ostream& out) const +NetDest::print(std::ostream& out) const { out << "[NetDest (" << m_bits.size() << ") "; diff --git a/src/mem/ruby/common/NetDest.hh b/src/mem/ruby/common/NetDest.hh index 7592ad9b5..a8d0009d7 100644 --- a/src/mem/ruby/common/NetDest.hh +++ b/src/mem/ruby/common/NetDest.hh @@ -34,12 +34,14 @@ #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; } diff --git a/src/mem/ruby/common/Set.cc b/src/mem/ruby/common/Set.cc index 55648043c..a9ced0078 100644 --- a/src/mem/ruby/common/Set.cc +++ b/src/mem/ruby/common/Set.cc @@ -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}]"; diff --git a/src/mem/ruby/common/Set.hh b/src/mem/ruby/common/Set.hh index a22da914c..d0660c6e6 100644 --- a/src/mem/ruby/common/Set.hh +++ b/src/mem/ruby/common/Set.hh @@ -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; } diff --git a/src/mem/ruby/common/SubBlock.cc b/src/mem/ruby/common/SubBlock.cc index 533aefbe7..5a42a415d 100644 --- a/src/mem/ruby/common/SubBlock.cc +++ b/src/mem/ruby/common/SubBlock.cc @@ -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 << "]"; } diff --git a/src/mem/ruby/common/SubBlock.hh b/src/mem/ruby/common/SubBlock.hh index ab286dd0e..571d45b57 100644 --- a/src/mem/ruby/common/SubBlock.hh +++ b/src/mem/ruby/common/SubBlock.hh @@ -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; } diff --git a/src/mem/ruby/eventqueue/RubyEventQueue.cc b/src/mem/ruby/eventqueue/RubyEventQueue.cc index eaa22ff1e..eb1f2d32b 100644 --- a/src/mem/ruby/eventqueue/RubyEventQueue.cc +++ b/src/mem/ruby/eventqueue/RubyEventQueue.cc @@ -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:]"; } diff --git a/src/mem/ruby/filters/AbstractBloomFilter.hh b/src/mem/ruby/filters/AbstractBloomFilter.hh index de11b4499..cf8476c8d 100644 --- a/src/mem/ruby/filters/AbstractBloomFilter.hh +++ b/src/mem/ruby/filters/AbstractBloomFilter.hh @@ -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; diff --git a/src/mem/ruby/filters/BlockBloomFilter.cc b/src/mem/ruby/filters/BlockBloomFilter.cc index 74b14593e..21d7921c6 100644 --- a/src/mem/ruby/filters/BlockBloomFilter.cc +++ b/src/mem/ruby/filters/BlockBloomFilter.cc @@ -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); diff --git a/src/mem/ruby/filters/BlockBloomFilter.hh b/src/mem/ruby/filters/BlockBloomFilter.hh index 14f064975..be31b025f 100644 --- a/src/mem/ruby/filters/BlockBloomFilter.hh +++ b/src/mem/ruby/filters/BlockBloomFilter.hh @@ -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); diff --git a/src/mem/ruby/filters/BulkBloomFilter.cc b/src/mem/ruby/filters/BulkBloomFilter.cc index 1788c0391..47cc386cd 100644 --- a/src/mem/ruby/filters/BulkBloomFilter.cc +++ b/src/mem/ruby/filters/BulkBloomFilter.cc @@ -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); diff --git a/src/mem/ruby/filters/BulkBloomFilter.hh b/src/mem/ruby/filters/BulkBloomFilter.hh index 53a913dc3..5a3117a60 100644 --- a/src/mem/ruby/filters/BulkBloomFilter.hh +++ b/src/mem/ruby/filters/BulkBloomFilter.hh @@ -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); diff --git a/src/mem/ruby/filters/GenericBloomFilter.cc b/src/mem/ruby/filters/GenericBloomFilter.cc index a31e97f1f..8d6b18e9e 100644 --- a/src/mem/ruby/filters/GenericBloomFilter.cc +++ b/src/mem/ruby/filters/GenericBloomFilter.cc @@ -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); diff --git a/src/mem/ruby/filters/GenericBloomFilter.hh b/src/mem/ruby/filters/GenericBloomFilter.hh index b7bd56d04..606f55d4f 100644 --- a/src/mem/ruby/filters/GenericBloomFilter.hh +++ b/src/mem/ruby/filters/GenericBloomFilter.hh @@ -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; } diff --git a/src/mem/ruby/filters/H3BloomFilter.cc b/src/mem/ruby/filters/H3BloomFilter.cc index c73a29a84..8018c7e38 100644 --- a/src/mem/ruby/filters/H3BloomFilter.cc +++ b/src/mem/ruby/filters/H3BloomFilter.cc @@ -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, diff --git a/src/mem/ruby/filters/H3BloomFilter.hh b/src/mem/ruby/filters/H3BloomFilter.hh index 6c18508eb..babd86657 100644 --- a/src/mem/ruby/filters/H3BloomFilter.hh +++ b/src/mem/ruby/filters/H3BloomFilter.hh @@ -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); diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc index b64c3e75a..7ec927d6c 100644 --- a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc +++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc @@ -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); diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh b/src/mem/ruby/filters/LSB_CountingBloomFilter.hh index 0d74c524a..1ce65edcf 100644 --- a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh +++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.hh @@ -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); diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc index 1fe316800..90f299fb4 100644 --- a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc +++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc @@ -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); diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh b/src/mem/ruby/filters/MultiBitSelBloomFilter.hh index c3b441c20..f53b2595a 100644 --- a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh +++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.hh @@ -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); diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.cc b/src/mem/ruby/filters/MultiGrainBloomFilter.cc index 543c4312a..24fcd7ead 100644 --- a/src/mem/ruby/filters/MultiGrainBloomFilter.cc +++ b/src/mem/ruby/filters/MultiGrainBloomFilter.cc @@ -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); diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.hh b/src/mem/ruby/filters/MultiGrainBloomFilter.hh index 4681e2806..8be226c02 100644 --- a/src/mem/ruby/filters/MultiGrainBloomFilter.hh +++ b/src/mem/ruby/filters/MultiGrainBloomFilter.hh @@ -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); diff --git a/src/mem/ruby/filters/NonCountingBloomFilter.cc b/src/mem/ruby/filters/NonCountingBloomFilter.cc index 06c069c7e..2b3965927 100644 --- a/src/mem/ruby/filters/NonCountingBloomFilter.cc +++ b/src/mem/ruby/filters/NonCountingBloomFilter.cc @@ -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); diff --git a/src/mem/ruby/filters/NonCountingBloomFilter.hh b/src/mem/ruby/filters/NonCountingBloomFilter.hh index bec645952..414de4bc8 100644 --- a/src/mem/ruby/filters/NonCountingBloomFilter.hh +++ b/src/mem/ruby/filters/NonCountingBloomFilter.hh @@ -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 diff --git a/src/mem/ruby/libruby.cc b/src/mem/ruby/libruby.cc index de120036b..2b61ce96c 100644 --- a/src/mem/ruby/libruby.cc +++ b/src/mem/ruby/libruby.cc @@ -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); } diff --git a/src/mem/ruby/network/Network.hh b/src/mem/ruby/network/Network.hh index b79c6407e..fb56904db 100644 --- a/src/mem/ruby/network/Network.hh +++ b/src/mem/ruby/network/Network.hh @@ -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; } diff --git a/src/mem/ruby/network/garnet/NetworkHeader.hh b/src/mem/ruby/network/garnet/NetworkHeader.hh index 1922df5ea..98c8024fa 100644 --- a/src/mem/ruby/network/garnet/NetworkHeader.hh +++ b/src/mem/ruby/network/garnet/NetworkHeader.hh @@ -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_}; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc index 7e9fe0762..8bdea4894 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -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) { diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh index 8a36c1572..7cb87b21a 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh @@ -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 diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc index ce7a0152d..ea8f7789b 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc @@ -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; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh index bca7b10f0..05358bc8b 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh @@ -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() { diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc index 6c61cef26..da86c32fa 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc @@ -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]"; } diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh index 1ca4a7a9c..88d882969 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh @@ -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: diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh index b5c58baa2..c5f9f14d1 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh @@ -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;} diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc index 7934dc9bd..99475cf69 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc @@ -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; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh index 25747a1f8..93cfd9d12 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh @@ -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); diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc index 7185249e4..428ba3260 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc @@ -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; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh index 498a6cae1..91f79882c 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh @@ -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; } diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh index a6c838e8a..95a7dad1c 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh @@ -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); diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh index 0e3c17b3b..09973b82d 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh @@ -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); diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh index c9247c6d0..c6d06d1ae 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh @@ -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; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.hh index 2b4779038..645506af7 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.hh @@ -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; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.cc index 9578f0a8f..38510c758 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.cc @@ -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() diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh index 11a3cda9c..976fa4053 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh @@ -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 diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/flit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/flit_d.cc index c6a58a839..2e73cdc72 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/flit_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/flit_d.cc @@ -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 << " "; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/flit_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/flit_d.hh index 3f9afcdca..39bbe011d 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/flit_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/flit_d.hh @@ -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 diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc index 82f664d26..e063e6a0e 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc @@ -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) { diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh index 3669799fa..c116a324b 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh @@ -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 diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc index 71c433aff..697f954ab 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc @@ -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]"; } diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh index 67bba5f04..bc2701125 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh @@ -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*************/ diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh index e371d9265..3f648ae14 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh @@ -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); diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc index 9963555cb..10696f1ad 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc @@ -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; diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh b/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh index 5ec7590a6..5d2610fae 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh @@ -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******************/ diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh b/src/mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh index 6a8c356f1..3f3223f29 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh @@ -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: diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/flit.cc b/src/mem/ruby/network/garnet/flexible-pipeline/flit.cc index e73a8b9b5..dd0525754 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/flit.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/flit.cc @@ -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 << " "; diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/flit.hh b/src/mem/ruby/network/garnet/flexible-pipeline/flit.hh index 2cf3eaade..1cc8806e9 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/flit.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/flit.hh @@ -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 diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.cc b/src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.cc index d2f9244de..7f41d6f8c 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.cc @@ -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; } diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh b/src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh index f8b34720c..646cd99c7 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh @@ -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 diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc b/src/mem/ruby/network/simple/PerfectSwitch.cc index bddcb8412..4555ef2b3 100644 --- a/src/mem/ruby/network/simple/PerfectSwitch.cc +++ b/src/mem/ruby/network/simple/PerfectSwitch.cc @@ -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 diff --git a/src/mem/ruby/network/simple/SimpleNetwork.cc b/src/mem/ruby/network/simple/SimpleNetwork.cc index 26924c2e7..2940f19a1 100644 --- a/src/mem/ruby/network/simple/SimpleNetwork.cc +++ b/src/mem/ruby/network/simple/SimpleNetwork.cc @@ -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 diff --git a/src/mem/ruby/network/simple/SimpleNetwork.hh b/src/mem/ruby/network/simple/SimpleNetwork.hh index d8ec89d49..f9cb22a6a 100644 --- a/src/mem/ruby/network/simple/SimpleNetwork.hh +++ b/src/mem/ruby/network/simple/SimpleNetwork.hh @@ -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; } diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc index 30403cd67..e88a24505 100644 --- a/src/mem/ruby/network/simple/Switch.cc +++ b/src/mem/ruby/network/simple/Switch.cc @@ -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, diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc index f749672e2..2d15b1141 100644 --- a/src/mem/ruby/network/simple/Throttle.cc +++ b/src/mem/ruby/network/simple/Throttle.cc @@ -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) diff --git a/src/mem/ruby/network/simple/Throttle.hh b/src/mem/ruby/network/simple/Throttle.hh index 608754190..74cd7b356 100644 --- a/src/mem/ruby/network/simple/Throttle.hh +++ b/src/mem/ruby/network/simple/Throttle.hh @@ -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; } diff --git a/src/mem/ruby/network/simple/Topology.cc b/src/mem/ruby/network/simple/Topology.cc index 3d7aa35d0..f21129255 100644 --- a/src/mem/ruby/network/simple/Topology.cc +++ b/src/mem/ruby/network/simple/Topology.cc @@ -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; diff --git a/src/mem/ruby/profiler/AccessTraceForAddress.cc b/src/mem/ruby/profiler/AccessTraceForAddress.cc index 978b72982..79661ed18 100644 --- a/src/mem/ruby/profiler/AccessTraceForAddress.cc +++ b/src/mem/ruby/profiler/AccessTraceForAddress.cc @@ -55,7 +55,7 @@ AccessTraceForAddress::~AccessTraceForAddress() } void -AccessTraceForAddress::print(ostream& out) const +AccessTraceForAddress::print(std::ostream& out) const { out << m_addr; diff --git a/src/mem/ruby/profiler/AccessTraceForAddress.hh b/src/mem/ruby/profiler/AccessTraceForAddress.hh index 53b96856e..7ca875f3f 100644 --- a/src/mem/ruby/profiler/AccessTraceForAddress.hh +++ b/src/mem/ruby/profiler/AccessTraceForAddress.hh @@ -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; } diff --git a/src/mem/ruby/profiler/AddressProfiler.cc b/src/mem/ruby/profiler/AddressProfiler.cc index cebf22fd8..d11e74b01 100644 --- a/src/mem/ruby/profiler/AddressProfiler.cc +++ b/src/mem/ruby/profiler/AddressProfiler.cc @@ -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 diff --git a/src/mem/ruby/profiler/AddressProfiler.hh b/src/mem/ruby/profiler/AddressProfiler.hh index 76dac323f..dd6cea52b 100644 --- a/src/mem/ruby/profiler/AddressProfiler.hh +++ b/src/mem/ruby/profiler/AddressProfiler.hh @@ -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; } diff --git a/src/mem/ruby/profiler/CacheProfiler.cc b/src/mem/ruby/profiler/CacheProfiler.cc index 9d12a46ab..f359314c1 100644 --- a/src/mem/ruby/profiler/CacheProfiler.cc +++ b/src/mem/ruby/profiler/CacheProfiler.cc @@ -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; diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc index 559c16900..fc67f0052 100644 --- a/src/mem/ruby/profiler/Profiler.cc +++ b/src/mem/ruby/profiler/Profiler.cc @@ -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(); diff --git a/src/mem/ruby/profiler/Profiler.hh b/src/mem/ruby/profiler/Profiler.hh index bf4bf8a50..bb2187488 100644 --- a/src/mem/ruby/profiler/Profiler.hh +++ b/src/mem/ruby/profiler/Profiler.hh @@ -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; } diff --git a/src/mem/ruby/profiler/StoreTrace.cc b/src/mem/ruby/profiler/StoreTrace.cc index ce42560b6..bcd90ab9d 100644 --- a/src/mem/ruby/profiler/StoreTrace.cc +++ b/src/mem/ruby/profiler/StoreTrace.cc @@ -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 diff --git a/src/mem/ruby/profiler/StoreTrace.hh b/src/mem/ruby/profiler/StoreTrace.hh index 8bddfe6c7..9c0945c15 100644 --- a/src/mem/ruby/profiler/StoreTrace.hh +++ b/src/mem/ruby/profiler/StoreTrace.hh @@ -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; } diff --git a/src/mem/ruby/recorder/CacheRecorder.cc b/src/mem/ruby/recorder/CacheRecorder.cc index 495a38fc8..32db211b6 100644 --- a/src/mem/ruby/recorder/CacheRecorder.cc +++ b/src/mem/ruby/recorder/CacheRecorder.cc @@ -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>; diff --git a/src/mem/ruby/recorder/TraceRecord.cc b/src/mem/ruby/recorder/TraceRecord.cc index 8c8daa051..7f1e96369 100644 --- a/src/mem/ruby/recorder/TraceRecord.cc +++ b/src/mem/ruby/recorder/TraceRecord.cc @@ -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) { diff --git a/src/mem/ruby/recorder/TraceRecord.hh b/src/mem/ruby/recorder/TraceRecord.hh index c8dae1986..98e78b20e 100644 --- a/src/mem/ruby/recorder/TraceRecord.hh +++ b/src/mem/ruby/recorder/TraceRecord.hh @@ -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; diff --git a/src/mem/ruby/recorder/Tracer.cc b/src/mem/ruby/recorder/Tracer.cc index e2d216ba3..23dafdb6c 100644 --- a/src/mem/ruby/recorder/Tracer.cc +++ b/src/mem/ruby/recorder/Tracer.cc @@ -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 { } diff --git a/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh b/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh index 223bc6fc8..66cce58a1 100644 --- a/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh +++ b/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh @@ -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; } diff --git a/src/mem/ruby/slicc_interface/AbstractController.hh b/src/mem/ruby/slicc_interface/AbstractController.hh index facaf2adf..44e47c8ca 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.hh +++ b/src/mem/ruby/slicc_interface/AbstractController.hh @@ -29,13 +29,15 @@ #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; }; diff --git a/src/mem/ruby/slicc_interface/AbstractEntry.hh b/src/mem/ruby/slicc_interface/AbstractEntry.hh index eef9a5227..19852fbe9 100644 --- a/src/mem/ruby/slicc_interface/AbstractEntry.hh +++ b/src/mem/ruby/slicc_interface/AbstractEntry.hh @@ -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; } diff --git a/src/mem/ruby/slicc_interface/NetworkMessage.hh b/src/mem/ruby/slicc_interface/NetworkMessage.hh index 8a7c00094..41365ff9e 100644 --- a/src/mem/ruby/slicc_interface/NetworkMessage.hh +++ b/src/mem/ruby/slicc_interface/NetworkMessage.hh @@ -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; } diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc index 6ffc7fdb4..2385b1cbc 100644 --- a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc +++ b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc @@ -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) diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh index 25495b6fa..10d1c0e5b 100644 --- a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh +++ b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh @@ -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, diff --git a/src/mem/ruby/system/CacheMemory.cc b/src/mem/ruby/system/CacheMemory.cc index 10ea8a6fc..1e188fb60 100644 --- a/src/mem/ruby/system/CacheMemory.cc +++ b/src/mem/ruby/system/CacheMemory.cc @@ -28,6 +28,8 @@ #include "mem/ruby/system/CacheMemory.hh" +using namespace std; + ostream& operator<<(ostream& out, const CacheMemory& obj) { diff --git a/src/mem/ruby/system/CacheMemory.hh b/src/mem/ruby/system/CacheMemory.hh index bdf2bb25c..21756a606 100644 --- a/src/mem/ruby/system/CacheMemory.hh +++ b/src/mem/ruby/system/CacheMemory.hh @@ -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; diff --git a/src/mem/ruby/system/DMASequencer.cc b/src/mem/ruby/system/DMASequencer.cc index 315dab62a..5d9037358 100644 --- a/src/mem/ruby/system/DMASequencer.cc +++ b/src/mem/ruby/system/DMASequencer.cc @@ -164,7 +164,7 @@ DMASequencer::ackCallback() } void -DMASequencer::printConfig(ostream & out) +DMASequencer::printConfig(std::ostream & out) { } diff --git a/src/mem/ruby/system/DirectoryMemory.cc b/src/mem/ruby/system/DirectoryMemory.cc index 7fb9b44a0..b3999fb3f 100644 --- a/src/mem/ruby/system/DirectoryMemory.cc +++ b/src/mem/ruby/system/DirectoryMemory.cc @@ -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; diff --git a/src/mem/ruby/system/DirectoryMemory.hh b/src/mem/ruby/system/DirectoryMemory.hh index 4e7bfc4f6..79b04726a 100644 --- a/src/mem/ruby/system/DirectoryMemory.hh +++ b/src/mem/ruby/system/DirectoryMemory.hh @@ -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; } diff --git a/src/mem/ruby/system/MemoryControl.cc b/src/mem/ruby/system/MemoryControl.cc index 963cc3947..3644a3e59 100644 --- a/src/mem/ruby/system/MemoryControl.cc +++ b/src/mem/ruby/system/MemoryControl.cc @@ -104,8 +104,6 @@ * */ -#include <list> - #include "base/cprintf.hh" #include "mem/gems_common/Map.hh" #include "mem/ruby/common/Address.hh" @@ -118,6 +116,8 @@ #include "mem/ruby/system/MemoryControl.hh" #include "mem/ruby/system/System.hh" +using namespace std; + class Consumer; // Value to reset watchdog timer to. diff --git a/src/mem/ruby/system/MemoryControl.hh b/src/mem/ruby/system/MemoryControl.hh index d42c1e6e0..73646f623 100644 --- a/src/mem/ruby/system/MemoryControl.hh +++ b/src/mem/ruby/system/MemoryControl.hh @@ -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: diff --git a/src/mem/ruby/system/PerfectCacheMemory.hh b/src/mem/ruby/system/PerfectCacheMemory.hh index f1fb8b2e9..e1d816923 100644 --- a/src/mem/ruby/system/PerfectCacheMemory.hh +++ b/src/mem/ruby/system/PerfectCacheMemory.hh @@ -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 { } diff --git a/src/mem/ruby/system/PersistentTable.cc b/src/mem/ruby/system/PersistentTable.cc index 979a0d4ab..64730ee29 100644 --- a/src/mem/ruby/system/PersistentTable.cc +++ b/src/mem/ruby/system/PersistentTable.cc @@ -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, diff --git a/src/mem/ruby/system/PersistentTable.hh b/src/mem/ruby/system/PersistentTable.hh index 64203c82c..667d68dcb 100644 --- a/src/mem/ruby/system/PersistentTable.hh +++ b/src/mem/ruby/system/PersistentTable.hh @@ -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; } diff --git a/src/mem/ruby/system/RubyPort.hh b/src/mem/ruby/system/RubyPort.hh index 4038c6007..56701cd5c 100644 --- a/src/mem/ruby/system/RubyPort.hh +++ b/src/mem/ruby/system/RubyPort.hh @@ -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); diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index a473ccf44..42bf7ebb5 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -43,6 +43,8 @@ #include "mem/ruby/system/System.hh" #include "params/RubySequencer.hh" +using namespace std; + Sequencer * RubySequencerParams::create() { diff --git a/src/mem/ruby/system/Sequencer.hh b/src/mem/ruby/system/Sequencer.hh index 69fd3b771..a5b2dd544 100644 --- a/src/mem/ruby/system/Sequencer.hh +++ b/src/mem/ruby/system/Sequencer.hh @@ -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; } diff --git a/src/mem/ruby/system/SparseMemory.cc b/src/mem/ruby/system/SparseMemory.cc index 70e00f14b..c4f636322 100644 --- a/src/mem/ruby/system/SparseMemory.cc +++ b/src/mem/ruby/system/SparseMemory.cc @@ -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; diff --git a/src/mem/ruby/system/SparseMemory.hh b/src/mem/ruby/system/SparseMemory.hh index 2c207aa3f..0601a8ca5 100644 --- a/src/mem/ruby/system/SparseMemory.hh +++ b/src/mem/ruby/system/SparseMemory.hh @@ -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; } diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index ef4b66290..418b31bf0 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -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; diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh index ccec2d61c..f501c5a83 100644 --- a/src/mem/ruby/system/System.hh +++ b/src/mem/ruby/system/System.hh @@ -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; } diff --git a/src/mem/ruby/system/TBETable.hh b/src/mem/ruby/system/TBETable.hh index d21946abd..fa1e6c8dd 100644 --- a/src/mem/ruby/system/TBETable.hh +++ b/src/mem/ruby/system/TBETable.hh @@ -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 { } diff --git a/src/mem/ruby/system/TimerTable.cc b/src/mem/ruby/system/TimerTable.cc index eba04e3e3..c623677f3 100644 --- a/src/mem/ruby/system/TimerTable.cc +++ b/src/mem/ruby/system/TimerTable.cc @@ -96,7 +96,7 @@ TimerTable::unset(const Address& address) } void -TimerTable::print(ostream& out) const +TimerTable::print(std::ostream& out) const { } diff --git a/src/mem/ruby/system/TimerTable.hh b/src/mem/ruby/system/TimerTable.hh index 96b4b0b15..4c1d2afa3 100644 --- a/src/mem/ruby/system/TimerTable.hh +++ b/src/mem/ruby/system/TimerTable.hh @@ -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; } diff --git a/src/mem/slicc/ast/EnumDeclAST.py b/src/mem/slicc/ast/EnumDeclAST.py index a20f4b749..da07a0165 100644 --- a/src/mem/slicc/ast/EnumDeclAST.py +++ b/src/mem/slicc/ast/EnumDeclAST.py @@ -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) diff --git a/src/mem/slicc/ast/LiteralExprAST.py b/src/mem/slicc/ast/LiteralExprAST.py index 773e8f35c..6d259c17f 100644 --- a/src/mem/slicc/ast/LiteralExprAST.py +++ b/src/mem/slicc/ast/LiteralExprAST.py @@ -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()}})') diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py index ae8a9342f..1505e1d0c 100644 --- a/src/mem/slicc/parser.py +++ b/src/mem/slicc/parser.py @@ -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" diff --git a/src/mem/slicc/symbols/Func.py b/src/mem/slicc/symbols/Func.py index 459cca52a..a5751344a 100644 --- a/src/mem/slicc/symbols/Func.py +++ b/src/mem/slicc/symbols/Func.py @@ -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 diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index 0c66ddab4..a58c1e9c7 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -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() { diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index 645291ac2..c4b4d4275 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -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); |