SimpleNetwork.hh (9859:1bd310386038) SimpleNetwork.hh (9863:9483739f83ee)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 42 unchanged lines hidden (view full) ---

51 ~SimpleNetwork();
52
53 void init();
54
55 int getBufferSize() { return m_buffer_size; }
56 int getEndpointBandwidth() { return m_endpoint_bandwidth; }
57 bool getAdaptiveRouting() {return m_adaptive_routing; }
58
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 42 unchanged lines hidden (view full) ---

51 ~SimpleNetwork();
52
53 void init();
54
55 int getBufferSize() { return m_buffer_size; }
56 int getEndpointBandwidth() { return m_endpoint_bandwidth; }
57 bool getAdaptiveRouting() {return m_adaptive_routing; }
58
59 void printStats(std::ostream& out) const;
60 void clearStats();
59 void collateStats();
60 void regStats();
61
62 // returns the queue requested for the given component
63 MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num, std::string vnet_type);
64 MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num, std::string vnet_type);
65 virtual const std::vector<Throttle*>* getThrottles(NodeID id) const;
66
67 bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
68 bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }

--- 16 unchanged lines hidden (view full) ---

85 bool functionalRead(Packet *pkt);
86 uint32_t functionalWrite(Packet *pkt);
87
88 private:
89 void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
90 void addLink(SwitchID src, SwitchID dest, int link_latency);
91 void makeLink(SwitchID src, SwitchID dest,
92 const NetDest& routing_table_entry, int link_latency);
61
62 // returns the queue requested for the given component
63 MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num, std::string vnet_type);
64 MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num, std::string vnet_type);
65 virtual const std::vector<Throttle*>* getThrottles(NodeID id) const;
66
67 bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
68 bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }

--- 16 unchanged lines hidden (view full) ---

85 bool functionalRead(Packet *pkt);
86 uint32_t functionalWrite(Packet *pkt);
87
88 private:
89 void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
90 void addLink(SwitchID src, SwitchID dest, int link_latency);
91 void makeLink(SwitchID src, SwitchID dest,
92 const NetDest& routing_table_entry, int link_latency);
93 SwitchID createSwitch();
94 void makeTopology();
93 void makeTopology();
95 void linkTopology();
96
97 // Private copy constructor and assignment operator
98 SimpleNetwork(const SimpleNetwork& obj);
99 SimpleNetwork& operator=(const SimpleNetwork& obj);
100
101 // vector of queues from the components
102 std::vector<std::vector<MessageBuffer*> > m_toNetQueues;
103 std::vector<std::vector<MessageBuffer*> > m_fromNetQueues;
104
105 std::vector<bool> m_in_use;
106 std::vector<bool> m_ordered;
107 std::vector<Switch*> m_switches;
108 std::vector<MessageBuffer*> m_buffers_to_free;
109 std::vector<Switch*> m_endpoint_switches;
110
111 int m_buffer_size;
112 int m_endpoint_bandwidth;
113 bool m_adaptive_routing;
94
95 // Private copy constructor and assignment operator
96 SimpleNetwork(const SimpleNetwork& obj);
97 SimpleNetwork& operator=(const SimpleNetwork& obj);
98
99 // vector of queues from the components
100 std::vector<std::vector<MessageBuffer*> > m_toNetQueues;
101 std::vector<std::vector<MessageBuffer*> > m_fromNetQueues;
102
103 std::vector<bool> m_in_use;
104 std::vector<bool> m_ordered;
105 std::vector<Switch*> m_switches;
106 std::vector<MessageBuffer*> m_buffers_to_free;
107 std::vector<Switch*> m_endpoint_switches;
108
109 int m_buffer_size;
110 int m_endpoint_bandwidth;
111 bool m_adaptive_routing;
112
113 //Statistical variables
114 std::vector<Stats::Formula> m_msg_counts;
115 std::vector<Stats::Formula> m_msg_bytes;
114};
115
116inline std::ostream&
117operator<<(std::ostream& out, const SimpleNetwork& obj)
118{
119 obj.print(out);
120 out << std::flush;
121 return out;
122}
123
124#endif // __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
116};
117
118inline std::ostream&
119operator<<(std::ostream& out, const SimpleNetwork& obj)
120{
121 obj.print(out);
122 out << std::flush;
123 return out;
124}
125
126#endif // __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__