diff options
Diffstat (limited to 'src/mem/ruby/network/simple/SimpleNetwork.cc')
-rw-r--r-- | src/mem/ruby/network/simple/SimpleNetwork.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.cc b/src/mem/ruby/network/simple/SimpleNetwork.cc index 09daa7960..5b7d7ebad 100644 --- a/src/mem/ruby/network/simple/SimpleNetwork.cc +++ b/src/mem/ruby/network/simple/SimpleNetwork.cc @@ -38,15 +38,23 @@ #include "mem/ruby/network/simple/Switch.hh" #include "mem/ruby/network/simple/Throttle.hh" #include "mem/ruby/profiler/Profiler.hh" +#include "mem/ruby/system/System.hh" using namespace std; using m5::stl_helpers::deletePointers; SimpleNetwork::SimpleNetwork(const Params *p) - : Network(p), m_buffer_size(p->buffer_size), - m_endpoint_bandwidth(p->endpoint_bandwidth), - m_adaptive_routing(p->adaptive_routing) + : Network(p) { + m_buffer_size = p->buffer_size; + m_endpoint_bandwidth = p->endpoint_bandwidth; + m_adaptive_routing = p->adaptive_routing; + + // Note: the parent Network Object constructor is called before the + // SimpleNetwork child constructor. Therefore, the member variables + // used below should already be initialized. + m_endpoint_switches.resize(m_nodes); + // record the routers for (vector<BasicRouter*>::const_iterator i = p->routers.begin(); i != p->routers.end(); ++i) { @@ -91,6 +99,8 @@ SimpleNetwork::makeOutLink(SwitchID src, NodeID dest, BasicLink* link, m_switches[src]->addOutPort(m_fromNetQueues[dest], routing_table_entry, simple_link->m_latency, simple_link->m_bw_multiplier); + + m_endpoint_switches[dest] = m_switches[src]; } // From an endpoint node to a switch @@ -223,6 +233,12 @@ SimpleNetwork::functionalRead(Packet *pkt) } } + for (unsigned int i = 0; i < m_int_link_buffers.size(); ++i) { + if (m_int_link_buffers[i]->functionalRead(pkt)) { + return true; + } + } + return false; } |