diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-03-20 09:14:14 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-03-20 09:14:14 -0500 |
commit | 4b67ada89e2e47b26ad07562774ff65beb5633a5 (patch) | |
tree | a93e52d39595313eec559d9c4d9b164f76418706 /src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc | |
parent | 4f7ef51efba1c1688eadc14f628a1411512b235e (diff) | |
download | gem5-4b67ada89e2e47b26ad07562774ff65beb5633a5.tar.xz |
ruby: garnet: convert network interfaces into clocked objects
This helps in configuring the network interfaces from the python script and
these objects no longer rely on the network object for the timing information.
Diffstat (limited to 'src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc')
-rw-r--r-- | src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc index 2a9d37e3e..6de60b285 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -60,6 +60,17 @@ GarnetNetwork_d::GarnetNetwork_d(const Params *p) i != p->routers.end(); ++i) { Router_d* router = safe_cast<Router_d*>(*i); m_routers.push_back(router); + + // initialize the router's network pointers + router->init_net_ptr(this); + } + + // record the network interfaces + for (vector<ClockedObject*>::const_iterator i = p->netifs.begin(); + i != p->netifs.end(); ++i) { + NetworkInterface_d *ni = safe_cast<NetworkInterface_d *>(*i); + m_nis.push_back(ni); + ni->init_net_ptr(this); } } @@ -68,23 +79,13 @@ GarnetNetwork_d::init() { BaseGarnetNetwork::init(); - // initialize the router's network pointers - for (vector<Router_d*>::const_iterator i = m_routers.begin(); - i != m_routers.end(); ++i) { - Router_d* router = safe_cast<Router_d*>(*i); - router->init_net_ptr(this); + for (int i=0; i < m_nodes; i++) { + m_nis[i]->addNode(m_toNetQueues[i], m_fromNetQueues[i]); } // The topology pointer should have already been initialized in the // parent network constructor assert(m_topology_ptr != NULL); - - for (int i=0; i < m_nodes; i++) { - NetworkInterface_d *ni = new NetworkInterface_d(i, m_virtual_networks, - this); - ni->addNode(m_toNetQueues[i], m_fromNetQueues[i]); - m_nis.push_back(ni); - } m_topology_ptr->createLinks(this); // FaultModel: declare each router to the fault model |