summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2015-09-24 08:41:24 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2015-09-24 08:41:24 -0500
commit4647e4e9612c040f84f0e6de6a8d7c8699f89aa2 (patch)
tree345c45feddbab5e83c10e8b50783e3e1ef508ac2 /src/mem/ruby/network
parentb3a3b0b6cfd7e1fab192982170973d3e968a17cd (diff)
downloadgem5-4647e4e9612c040f84f0e6de6a8d7c8699f89aa2.tar.xz
ruby: simple network: refactor code
Drops an unused variable and marks three variables as const.
Diffstat (limited to 'src/mem/ruby/network')
-rw-r--r--src/mem/ruby/network/simple/SimpleNetwork.cc16
-rw-r--r--src/mem/ruby/network/simple/SimpleNetwork.hh8
2 files changed, 6 insertions, 18 deletions
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.cc b/src/mem/ruby/network/simple/SimpleNetwork.cc
index 457c3248e..3d76254fc 100644
--- a/src/mem/ruby/network/simple/SimpleNetwork.cc
+++ b/src/mem/ruby/network/simple/SimpleNetwork.cc
@@ -38,23 +38,15 @@
#include "mem/ruby/network/simple/Switch.hh"
#include "mem/ruby/network/simple/Throttle.hh"
#include "mem/ruby/profiler/Profiler.hh"
-#include "mem/ruby/system/RubySystem.hh"
using namespace std;
using m5::stl_helpers::deletePointers;
SimpleNetwork::SimpleNetwork(const Params *p)
- : Network(p)
+ : Network(p), m_buffer_size(p->buffer_size),
+ m_endpoint_bandwidth(p->endpoint_bandwidth),
+ m_adaptive_routing(p->adaptive_routing)
{
- 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) {
@@ -99,8 +91,6 @@ 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
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.hh b/src/mem/ruby/network/simple/SimpleNetwork.hh
index c5e56b1ec..434dfa702 100644
--- a/src/mem/ruby/network/simple/SimpleNetwork.hh
+++ b/src/mem/ruby/network/simple/SimpleNetwork.hh
@@ -87,11 +87,9 @@ class SimpleNetwork : public Network
std::vector<Switch*> m_switches;
std::vector<MessageBuffer*> m_int_link_buffers;
int m_num_connected_buffers;
- std::vector<Switch*> m_endpoint_switches;
-
- int m_buffer_size;
- int m_endpoint_bandwidth;
- bool m_adaptive_routing;
+ const int m_buffer_size;
+ const int m_endpoint_bandwidth;
+ const bool m_adaptive_routing;
//Statistical variables
Stats::Formula m_msg_counts[MessageSizeType_NUM];