changeset dcf729f0bbfa in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=dcf729f0bbfa
description:
        ruby: simple network: refactor code

        Drops an unused variable and marks three variables as const.

diffstat:

 src/mem/ruby/network/simple/SimpleNetwork.cc |  16 +++-------------
 src/mem/ruby/network/simple/SimpleNetwork.hh |   8 +++-----
 2 files changed, 6 insertions(+), 18 deletions(-)

diffs (57 lines):

diff -r 0cd13910b063 -r dcf729f0bbfa 
src/mem/ruby/network/simple/SimpleNetwork.cc
--- a/src/mem/ruby/network/simple/SimpleNetwork.cc      Fri Aug 14 19:28:44 
2015 -0500
+++ b/src/mem/ruby/network/simple/SimpleNetwork.cc      Fri Aug 14 19:28:44 
2015 -0500
@@ -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/System.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 @@
     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 -r 0cd13910b063 -r dcf729f0bbfa 
src/mem/ruby/network/simple/SimpleNetwork.hh
--- a/src/mem/ruby/network/simple/SimpleNetwork.hh      Fri Aug 14 19:28:44 
2015 -0500
+++ b/src/mem/ruby/network/simple/SimpleNetwork.hh      Fri Aug 14 19:28:44 
2015 -0500
@@ -95,11 +95,9 @@
     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];
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to