SimpleNetwork.hh (7054:7d6862b80049) SimpleNetwork.hh (7055:4e24742201d7)
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;

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

58 * abstract Network class take a enumeration parameter, and based on
59 * that to initial proper network. Or even better, just make the ruby
60 * system initializer choose the proper network to initiate.
61 */
62
63#ifndef __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
64#define __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
65
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;

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

58 * abstract Network class take a enumeration parameter, and based on
59 * that to initial proper network. Or even better, just make the ruby
60 * system initializer choose the proper network to initiate.
61 */
62
63#ifndef __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
64#define __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
65
66#include <iostream>
67
66#include "mem/gems_common/Vector.hh"
67#include "mem/ruby/common/Global.hh"
68#include "mem/ruby/network/Network.hh"
69#include "mem/ruby/system/NodeID.hh"
70#include "params/SimpleNetwork.hh"
71#include "sim/sim_object.hh"
72
73class NetDest;

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

80{
81 public:
82 typedef SimpleNetworkParams Params;
83 SimpleNetwork(const Params *p);
84 ~SimpleNetwork();
85
86 void init();
87
68#include "mem/gems_common/Vector.hh"
69#include "mem/ruby/common/Global.hh"
70#include "mem/ruby/network/Network.hh"
71#include "mem/ruby/system/NodeID.hh"
72#include "params/SimpleNetwork.hh"
73#include "sim/sim_object.hh"
74
75class NetDest;

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

82{
83 public:
84 typedef SimpleNetworkParams Params;
85 SimpleNetwork(const Params *p);
86 ~SimpleNetwork();
87
88 void init();
89
88 void printStats(ostream& out) const;
90 void printStats(std::ostream& out) const;
89 void clearStats();
91 void clearStats();
90 void printConfig(ostream& out) const;
92 void printConfig(std::ostream& out) const;
91
92 void reset();
93
94 // returns the queue requested for the given component
95 MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num);
96 MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
97 virtual const Vector<Throttle*>* getThrottles(NodeID id) const;
98

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

107 int bw_multiplier, bool isReconfiguration);
108 void makeInLink(SwitchID src, NodeID dest,
109 const NetDest& routing_table_entry, int link_latency,
110 int bw_multiplier, bool isReconfiguration);
111 void makeInternalLink(SwitchID src, NodeID dest,
112 const NetDest& routing_table_entry, int link_latency, int link_weight,
113 int bw_multiplier, bool isReconfiguration);
114
93
94 void reset();
95
96 // returns the queue requested for the given component
97 MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num);
98 MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
99 virtual const Vector<Throttle*>* getThrottles(NodeID id) const;
100

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

109 int bw_multiplier, bool isReconfiguration);
110 void makeInLink(SwitchID src, NodeID dest,
111 const NetDest& routing_table_entry, int link_latency,
112 int bw_multiplier, bool isReconfiguration);
113 void makeInternalLink(SwitchID src, NodeID dest,
114 const NetDest& routing_table_entry, int link_latency, int link_weight,
115 int bw_multiplier, bool isReconfiguration);
116
115 void print(ostream& out) const;
117 void print(std::ostream& out) const;
116
117 private:
118 void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
119 void addLink(SwitchID src, SwitchID dest, int link_latency);
120 void makeLink(SwitchID src, SwitchID dest,
121 const NetDest& routing_table_entry, int link_latency);
122 SwitchID createSwitch();
123 void makeTopology();

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

133
134 Vector<bool> m_in_use;
135 Vector<bool> m_ordered;
136 Vector<Switch*> m_switch_ptr_vector;
137 Vector<MessageBuffer*> m_buffers_to_free;
138 Vector<Switch*> m_endpoint_switches;
139};
140
118
119 private:
120 void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
121 void addLink(SwitchID src, SwitchID dest, int link_latency);
122 void makeLink(SwitchID src, SwitchID dest,
123 const NetDest& routing_table_entry, int link_latency);
124 SwitchID createSwitch();
125 void makeTopology();

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

135
136 Vector<bool> m_in_use;
137 Vector<bool> m_ordered;
138 Vector<Switch*> m_switch_ptr_vector;
139 Vector<MessageBuffer*> m_buffers_to_free;
140 Vector<Switch*> m_endpoint_switches;
141};
142
141inline ostream&
142operator<<(ostream& out, const SimpleNetwork& obj)
143inline std::ostream&
144operator<<(std::ostream& out, const SimpleNetwork& obj)
143{
144 obj.print(out);
145{
146 obj.print(out);
145 out << flush;
147 out << std::flush;
146 return out;
147}
148
149#endif // __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
148 return out;
149}
150
151#endif // __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__