garnet: Split network power in ruby.stats
authorJoel Hestness <hestness@cs.utexas.edu>
Mon, 7 Feb 2011 06:14:19 +0000 (22:14 -0800)
committerJoel Hestness <hestness@cs.utexas.edu>
Mon, 7 Feb 2011 06:14:19 +0000 (22:14 -0800)
Split out dynamic and static power numbers for printing to ruby.stats

src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
src/mem/ruby/network/orion/NetworkPower.cc

index d11054abf28796c9f75b91bc802c7cc63fe421d2..dbfabc8f1267c59e5360ba113310270949b7b662 100644 (file)
@@ -319,16 +319,28 @@ GarnetNetwork_d::printStats(ostream& out) const
     out << "-------------" << endl;
 
     double m_total_link_power = 0.0;
+    double m_dynamic_link_power = 0.0;
+    double m_static_link_power = 0.0;
     double m_total_router_power = 0.0;
+    double m_dynamic_router_power = 0.0;
+    double m_static_router_power = 0.0;
 
     for (int i = 0; i < m_link_ptr_vector.size(); i++) {
         m_total_link_power += m_link_ptr_vector[i]->calculate_power();
+        m_dynamic_link_power += m_link_ptr_vector[i]->get_dynamic_power();
+        m_static_link_power += m_link_ptr_vector[i]->get_static_power();
     }
 
     for (int i = 0; i < m_router_ptr_vector.size(); i++) {
         m_total_router_power += m_router_ptr_vector[i]->calculate_power();
+        m_dynamic_router_power += m_router_ptr_vector[i]->get_dynamic_power();
+        m_static_router_power += m_router_ptr_vector[i]->get_static_power();
     }
+    out << "Link Dynamic Power = " << m_dynamic_link_power << " W" << endl;
+    out << "Link Static Power = " << m_static_link_power << " W" << endl;
     out << "Total Link Power = " << m_total_link_power << " W " << endl;
+    out << "Router Dynamic Power = " << m_dynamic_router_power << " W" << endl;
+    out << "Router Static Power = " << m_static_router_power << " W" << endl;
     out << "Total Router Power = " << m_total_router_power << " W " <<endl;
     out << "-------------" << endl;
     m_topology_ptr->printStats(out);
index cc13f5b9e2dc4eaac1d31272f82ee56f4cf3b7af..8024ebd9c7959b1861c70f6c550f96fcff3112a9 100644 (file)
@@ -54,6 +54,8 @@ class NetworkLink_d : public Consumer
     int getLinkUtilization();
     std::vector<int> getVcLoad();
     int get_id(){return m_id;}
+    double get_dynamic_power(){return m_power_dyn;}
+    double get_static_power(){return m_power_sta;}
     void wakeup();
 
     double calculate_power();
@@ -73,6 +75,9 @@ class NetworkLink_d : public Consumer
     int m_link_utilized;
     std::vector<int> m_vc_load;
     int m_flit_width;
+
+    double m_power_dyn;
+    double m_power_sta;
 };
 
 #endif // __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_NETWORK_LINK_D_HH__
index 0c5d51fc3ba0a5ab48f75b3768ec643fa2b0726c..b6899ea6b8fcc3b51c04878479db2dd20b7985b4 100644 (file)
@@ -81,6 +81,9 @@ class Router_d
     double calculate_power();
     void calculate_performance_numbers();
 
+    double get_dynamic_power(){return m_power_dyn;}
+    double get_static_power(){return m_power_sta;}
+
   private:
     int m_id;
     int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
@@ -100,6 +103,9 @@ class Router_d
     VCallocator_d *m_vc_alloc;
     SWallocator_d *m_sw_alloc;
     Switch_d *m_switch;
+
+    double m_power_dyn;
+    double m_power_sta;
 };
 
 #endif // __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_ROUTER_D_HH__
index 7d4aae3edcf46f6982de5bba0ec59088c12285cb..b71e09dcebe55ce5b733a315ba6b9fdcaea94fab 100644 (file)
@@ -206,6 +206,7 @@ Router_d::calculate_power()
                  Pxbar_dyn +
                  Pclk_dyn;
 
+    m_power_dyn = Ptotal_dyn;
 
     // Static Power
     Pbuf_sta = orion_rtr_ptr->get_static_power_buf();
@@ -215,6 +216,8 @@ Router_d::calculate_power()
 
     Ptotal_sta += Pbuf_sta + Pvc_arb_sta + Psw_arb_sta + Pxbar_sta;
 
+    m_power_sta = Ptotal_sta;
+
     Ptotal = Ptotal_dyn + Ptotal_sta;
 
     return Ptotal;
@@ -250,9 +253,13 @@ NetworkLink_d::calculate_power()
     double Plink_dyn = orion_link_ptr->calc_dynamic_energy(channel_width/2)*
         (m_link_utilized/ sim_cycles)*freq_Hz;
 
+    m_power_dyn = Plink_dyn;
+
     // Static Power
     double Plink_sta = orion_link_ptr->get_static_power();
 
+    m_power_sta = Plink_sta;
+
     double Ptotal = Plink_dyn + Plink_sta;
 
     return Ptotal;