diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-09-01 16:55:42 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-09-01 16:55:42 -0500 |
commit | 00dbadcbb09c51b8d05a22c21193b55d7e9a0cf1 (patch) | |
tree | fc8e8e99d2f1e48176e0f00c7cf3c567aa5ddbec /src/mem/ruby/network/garnet | |
parent | cc2cc588693bb73b1892aea82fd0ac9729196f25 (diff) | |
download | gem5-00dbadcbb09c51b8d05a22c21193b55d7e9a0cf1.tar.xz |
ruby: network: move getNumNodes() to base class
All the implementations were doing the same things.
Diffstat (limited to 'src/mem/ruby/network/garnet')
6 files changed, 1 insertions, 44 deletions
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc index 01f1b80ed..92e45c36d 100644 --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc @@ -58,34 +58,6 @@ BaseGarnetNetwork::BaseGarnetNetwork(const Params *p) fatal("Garnet only supports uniform bw across all links and NIs\n"); } } - - // Allocate to and from queues - - // Queues that are getting messages from protocol - m_toNetQueues.resize(m_nodes); - - // Queues that are feeding the protocol - m_fromNetQueues.resize(m_nodes); - - m_in_use.resize(m_virtual_networks); - m_ordered.resize(m_virtual_networks); - for (int i = 0; i < m_virtual_networks; i++) { - m_in_use[i] = false; - m_ordered[i] = false; - } - - for (int node = 0; node < m_nodes; node++) { - // Setting number of virtual message buffers per Network Queue - m_toNetQueues[node].resize(m_virtual_networks); - m_fromNetQueues[node].resize(m_virtual_networks); - - // Instantiating the Message Buffers that - // interact with the coherence protocol - for (int j = 0; j < m_virtual_networks; j++) { - m_toNetQueues[node][j] = new MessageBuffer(); - m_fromNetQueues[node][j] = new MessageBuffer(); - } - } } void 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 6de60b285..baf6a9687 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -108,15 +108,10 @@ GarnetNetwork_d::init() GarnetNetwork_d::~GarnetNetwork_d() { - for (int i = 0; i < m_nodes; i++) { - deletePointers(m_toNetQueues[i]); - deletePointers(m_fromNetQueues[i]); - } deletePointers(m_routers); deletePointers(m_nis); deletePointers(m_links); deletePointers(m_creditlinks); - delete m_topology_ptr; } /* diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh index 5aef42f3a..507d8bbd6 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh @@ -52,11 +52,8 @@ class GarnetNetwork_d : public BaseGarnetNetwork GarnetNetwork_d(const Params *p); ~GarnetNetwork_d(); - void init(); - int getNumNodes() { return m_nodes; } - int getBuffersPerDataVC() {return m_buffers_per_data_vc; } int getBuffersPerCtrlVC() {return m_buffers_per_ctrl_vc; } diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc index db71c9974..2f1b5ee46 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc @@ -114,8 +114,8 @@ NetworkInterface_d::addNode(vector<MessageBuffer *>& in, assert(in.size() == m_virtual_networks); inNode_ptr = in; outNode_ptr = out; - for (int j = 0; j < m_virtual_networks; j++) { + for (int j = 0; j < m_virtual_networks; j++) { // the protocol injects messages into the NI inNode_ptr[j]->setConsumer(this); inNode_ptr[j]->setReceiver(this); diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc index 280917bab..07d5412d0 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc @@ -88,14 +88,9 @@ GarnetNetwork::init() GarnetNetwork::~GarnetNetwork() { - for (int i = 0; i < m_nodes; i++) { - deletePointers(m_toNetQueues[i]); - deletePointers(m_fromNetQueues[i]); - } deletePointers(m_routers); deletePointers(m_nis); deletePointers(m_links); - delete m_topology_ptr; } void diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh index bd273b0c8..906e7eb3a 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh @@ -50,12 +50,10 @@ class GarnetNetwork : public BaseGarnetNetwork GarnetNetwork(const Params *p); ~GarnetNetwork(); - void init(); int getBufferSize() { return m_buffer_size; } int getNumPipeStages() {return m_number_of_pipe_stages; } - int getNumNodes(){ return m_nodes; } void collateStats(); void regStats(); |