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/network/garnet/flexible-pipeline | |
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/network/garnet/flexible-pipeline')
12 files changed, 50 insertions, 48 deletions
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 |