ruby: garnet: mark some variables as const
authorNilay Vaish <nilay@cs.wisc.edu>
Fri, 18 Sep 2015 18:27:48 +0000 (13:27 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Fri, 18 Sep 2015 18:27:48 +0000 (13:27 -0500)
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh

index e350eba6bfcdbdbc7893a415be64dba958df25a4..a02ac83f0f7c732e50464fb1c55be89753fcb690 100644 (file)
@@ -43,13 +43,10 @@ using namespace std;
 using m5::stl_helpers::deletePointers;
 
 NetworkInterface_d::NetworkInterface_d(const Params *p)
-    : ClockedObject(p), Consumer(this)
+    : ClockedObject(p), Consumer(this), m_id(p->id),
+      m_virtual_networks(p->virt_nets), m_vc_per_vnet(p->vcs_per_vnet),
+      m_num_vcs(m_vc_per_vnet * m_virtual_networks)
 {
-    m_id = p->id;
-    m_virtual_networks  = p->virt_nets;
-    m_vc_per_vnet = p->vcs_per_vnet;
-    m_num_vcs = m_vc_per_vnet*m_virtual_networks;
-
     m_vc_round_robin = 0;
     m_ni_buffers.resize(m_num_vcs);
     m_ni_enqueue_time.resize(m_num_vcs);
index 812e8b7fb6028875c98235e8beb2e947488b2801..d2ddcb82074ae5f92937d784f325c235ee066569 100644 (file)
@@ -70,8 +70,8 @@ class NetworkInterface_d : public ClockedObject, public Consumer
 
   private:
     GarnetNetwork_d *m_net_ptr;
-    int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
-    NodeID m_id;
+    const NodeID m_id;
+    const int m_virtual_networks, m_vc_per_vnet, m_num_vcs;
     std::vector<OutVcState_d *> m_out_vc_state;
     std::vector<int> m_vc_allocator;
     int m_vc_round_robin; // For round robin scheduling