From 66f0d26059ffaa09b829c0a84419936f88fd68c2 Mon Sep 17 00:00:00 2001 From: Tushar Krishna Date: Tue, 22 Jun 2010 15:36:07 -0700 Subject: style: updated garnet to match M5 coding style --- .../garnet/flexible-pipeline/GarnetNetwork.hh | 85 ++++++++++++---------- 1 file changed, 45 insertions(+), 40 deletions(-) (limited to 'src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh') diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh index 62857223e..96aa5fd10 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh @@ -28,8 +28,8 @@ * Authors: Niket Agarwal */ -#ifndef GARNET_NETWORK_H -#define GARNET_NETWORK_H +#ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_GARNET_NETWORK_HH__ +#define __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_GARNET_NETWORK_HH__ #include #include @@ -46,61 +46,65 @@ class Topology; class NetDest; class NetworkLink; -class GarnetNetwork : public BaseGarnetNetwork { -public: +class GarnetNetwork : public BaseGarnetNetwork +{ + public: typedef GarnetNetworkParams Params; GarnetNetwork(const Params *p); ~GarnetNetwork(); - void init(); - - // returns the queue requested for the given component - MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num); - MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num); + void init(); - void clearStats(); - void printStats(std::ostream& out) const; - void printConfig(std::ostream& out) const; - void print(std::ostream& out) const; + // returns the queue requested for the given component + MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num); + MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num); - bool isVNetOrdered(int vnet) { return m_ordered[vnet]; } - bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; } + void clearStats(); + void printStats(std::ostream& out) const; + void printConfig(std::ostream& out) const; + void print(std::ostream& out) const; - Time getRubyStartTime(); - int getNumNodes(){ return m_nodes; } + bool isVNetOrdered(int vnet) { return m_ordered[vnet]; } + bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; } - void reset(); + Time getRubyStartTime(); + int getNumNodes(){ return m_nodes; } - // Methods used by Topology to setup the network - void makeOutLink(SwitchID src, NodeID dest, const NetDest& routing_table_entry, int link_latency, int link_weight, int bw_multiplier, bool isReconfiguration); - void makeInLink(SwitchID src, NodeID dest, const NetDest& routing_table_entry, int link_latency, int bw_multiplier, bool isReconfiguration); - void makeInternalLink(SwitchID src, NodeID dest, const NetDest& routing_table_entry, int link_latency, int link_weight, int bw_multiplier, bool isReconfiguration); + void reset(); -private: - void checkNetworkAllocation(NodeID id, bool ordered, int network_num); + // Methods used by Topology to setup the network + void makeOutLink(SwitchID src, NodeID dest, + const NetDest& routing_table_entry, int link_latency, + int link_weight, int bw_multiplier, bool isReconfiguration); + void makeInLink(SwitchID src, NodeID dest, + const NetDest& routing_table_entry, int link_latency, + int bw_multiplier, bool isReconfiguration); + void makeInternalLink(SwitchID src, NodeID dest, + const NetDest& routing_table_entry, int link_latency, + int link_weight, int bw_multiplier, bool isReconfiguration); -// Private copy constructor and assignment operator - GarnetNetwork(const GarnetNetwork& obj); - GarnetNetwork& operator=(const GarnetNetwork& obj); + private: + void checkNetworkAllocation(NodeID id, bool ordered, int network_num); + GarnetNetwork(const GarnetNetwork& obj); + GarnetNetwork& operator=(const GarnetNetwork& obj); -/***********Data Members*************/ -// int m_virtual_networks; -// int m_nodes; + // int m_virtual_networks; + // int m_nodes; - std::vector m_in_use; - std::vector m_ordered; + std::vector m_in_use; + std::vector m_ordered; - std::vector > m_toNetQueues; - std::vector > m_fromNetQueues; + std::vector > m_toNetQueues; + std::vector > m_fromNetQueues; - std::vector m_router_ptr_vector; // All Routers in Network - std::vector m_link_ptr_vector; // All links in the network - std::vector m_ni_ptr_vector; // All NI's in Network + std::vector m_router_ptr_vector; // All Routers in Network + std::vector m_link_ptr_vector; // All links in network + std::vector m_ni_ptr_vector; // All NI's in Network -// Topology* m_topology_ptr; - Time m_ruby_start; + // Topology* m_topology_ptr; + Time m_ruby_start; }; inline std::ostream& @@ -111,4 +115,5 @@ operator<<(std::ostream& out, const GarnetNetwork& obj) return out; } -#endif //NETWORK_H +#endif // __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_GARNET_NETWORK_HH__ + -- cgit v1.2.3