SimpleNetwork.hh (7055:4e24742201d7) SimpleNetwork.hh (7454:3a3e8e8cce1b)
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;

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

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>
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;

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

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#include <vector>
67
68
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;
76class MessageBuffer;

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

91 void clearStats();
92 void printConfig(std::ostream& out) const;
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);
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;
76class MessageBuffer;

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

91 void clearStats();
92 void printConfig(std::ostream& out) const;
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;
99 virtual const std::vector<Throttle*>* getThrottles(NodeID id) const;
100
101 bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
102 bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }
103
104 int getNumNodes() {return m_nodes; }
105
106 // Methods used by Topology to setup the network
107 void makeOutLink(SwitchID src, NodeID dest,

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

125 void makeTopology();
126 void linkTopology();
127
128 // Private copy constructor and assignment operator
129 SimpleNetwork(const SimpleNetwork& obj);
130 SimpleNetwork& operator=(const SimpleNetwork& obj);
131
132 // vector of queues from the components
100
101 bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
102 bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }
103
104 int getNumNodes() {return m_nodes; }
105
106 // Methods used by Topology to setup the network
107 void makeOutLink(SwitchID src, NodeID dest,

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

125 void makeTopology();
126 void linkTopology();
127
128 // Private copy constructor and assignment operator
129 SimpleNetwork(const SimpleNetwork& obj);
130 SimpleNetwork& operator=(const SimpleNetwork& obj);
131
132 // vector of queues from the components
133 Vector<Vector<MessageBuffer*> > m_toNetQueues;
134 Vector<Vector<MessageBuffer*> > m_fromNetQueues;
133 std::vector<std::vector<MessageBuffer*> > m_toNetQueues;
134 std::vector<std::vector<MessageBuffer*> > m_fromNetQueues;
135
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;
136 std::vector<bool> m_in_use;
137 std::vector<bool> m_ordered;
138 std::vector<Switch*> m_switch_ptr_vector;
139 std::vector<MessageBuffer*> m_buffers_to_free;
140 std::vector<Switch*> m_endpoint_switches;
141};
142
143inline std::ostream&
144operator<<(std::ostream& out, const SimpleNetwork& obj)
145{
146 obj.print(out);
147 out << std::flush;
148 return out;
149}
150
151#endif // __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
141};
142
143inline std::ostream&
144operator<<(std::ostream& out, const SimpleNetwork& obj)
145{
146 obj.print(out);
147 out << std::flush;
148 return out;
149}
150
151#endif // __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__