diff options
author | Nathan Binkert <nate@binkert.org> | 2010-04-02 11:20:32 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2010-04-02 11:20:32 -0700 |
commit | f1c3f3044b73d890ffdfdd113b3b37ae2809d21b (patch) | |
tree | 959d71e897a8d01868c8dea8a8b225cbd1b5ce2c /src/mem/ruby/slicc_interface | |
parent | be10204729c107b41d5d7487323c732e9fa09df5 (diff) | |
download | gem5-f1c3f3044b73d890ffdfdd113b3b37ae2809d21b.tar.xz |
ruby: get "using namespace" out of headers
In addition to obvious changes, this required a slight change to the slicc
grammar to allow types with :: in them. Otherwise slicc barfs on std::string
which we need for the headers that slicc generates.
Diffstat (limited to 'src/mem/ruby/slicc_interface')
6 files changed, 37 insertions, 25 deletions
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, |