1d0
<
31,33c30
< * SimpleNetwork.hh
< *
< * Description: The SimpleNetwork class implements the interconnection
---
> * The SimpleNetwork class implements the interconnection
64,66d60
< *
< * $Id$
< *
69,70c63,64
< #ifndef SIMPLENETWORK_H
< #define SIMPLENETWORK_H
---
> #ifndef __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
> #define __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
72d65
< #include "mem/ruby/common/Global.hh"
73a67
> #include "mem/ruby/common/Global.hh"
76d69
< #include "sim/sim_object.hh"
77a71
> #include "sim/sim_object.hh"
85,87c79,81
< class SimpleNetwork : public Network {
< public:
< // Constructors
---
> class SimpleNetwork : public Network
> {
> public:
89a84
> ~SimpleNetwork();
91,92c86
< // Destructor
< ~SimpleNetwork();
---
> void init();
94c88,90
< void init();
---
> void printStats(ostream& out) const;
> void clearStats();
> void printConfig(ostream& out) const;
96,99c92
< // Public Methods
< void printStats(ostream& out) const;
< void clearStats();
< void printConfig(ostream& out) const;
---
> void reset();
101c94,97
< void reset();
---
> // 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);
> virtual const Vector<Throttle*>* getThrottles(NodeID id) const;
103,106c99,100
< // 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);
< virtual const Vector<Throttle*>* getThrottles(NodeID id) const;
---
> bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
> bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }
108,109c102
< bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
< bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }
---
> int getNumNodes() {return m_nodes; }
111c104,113
< 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);
113,116c115
< // 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 print(ostream& out) const;
118,125c117,124
< void print(ostream& out) const;
< private:
< void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
< void addLink(SwitchID src, SwitchID dest, int link_latency);
< void makeLink(SwitchID src, SwitchID dest, const NetDest& routing_table_entry, int link_latency);
< SwitchID createSwitch();
< void makeTopology();
< void linkTopology();
---
> private:
> void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
> void addLink(SwitchID src, SwitchID dest, int link_latency);
> void makeLink(SwitchID src, SwitchID dest,
> const NetDest& routing_table_entry, int link_latency);
> SwitchID createSwitch();
> void makeTopology();
> void linkTopology();
126a126,128
> // Private copy constructor and assignment operator
> SimpleNetwork(const SimpleNetwork& obj);
> SimpleNetwork& operator=(const SimpleNetwork& obj);
128,130c130,132
< // Private copy constructor and assignment operator
< SimpleNetwork(const SimpleNetwork& obj);
< SimpleNetwork& operator=(const SimpleNetwork& obj);
---
> // vector of queues from the components
> Vector<Vector<MessageBuffer*> > m_toNetQueues;
> Vector<Vector<MessageBuffer*> > m_fromNetQueues;
132,142c134,138
< // Data Members (m_ prefix)
<
< // vector of queues from the components
< Vector<Vector<MessageBuffer*> > m_toNetQueues;
< Vector<Vector<MessageBuffer*> > m_fromNetQueues;
<
< Vector<bool> m_in_use;
< Vector<bool> m_ordered;
< Vector<Switch*> m_switch_ptr_vector;
< Vector<MessageBuffer*> m_buffers_to_free;
< Vector<Switch*> m_endpoint_switches;
---
> Vector<bool> m_in_use;
> Vector<bool> m_ordered;
> Vector<Switch*> m_switch_ptr_vector;
> Vector<MessageBuffer*> m_buffers_to_free;
> Vector<Switch*> m_endpoint_switches;
145,152c141,142
< // Output operator declaration
< ostream& operator<<(ostream& out, const SimpleNetwork& obj);
<
< // ******************* Definitions *******************
<
< // Output operator definition
< extern inline
< ostream& operator<<(ostream& out, const SimpleNetwork& obj)
---
> inline ostream&
> operator<<(ostream& out, const SimpleNetwork& obj)
154,156c144,146
< obj.print(out);
< out << flush;
< return out;
---
> obj.print(out);
> out << flush;
> return out;
159c149
< #endif //SIMPLENETWORK_H
---
> #endif // __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__