diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-10-11 15:02:23 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-10-11 15:02:23 -0500 |
commit | 25bb18f12b7983e46e5b0544de18445d3b60d41a (patch) | |
tree | df4b8addf4fd2266a50da7d93b930dfd8e4e51db /src/mem/ruby/network | |
parent | 9321a41c62c25643d7b6381abbcf5694a012e056 (diff) | |
download | gem5-25bb18f12b7983e46e5b0544de18445d3b60d41a.tar.xz |
ruby: network: garnet: remove functions for computing power
Diffstat (limited to 'src/mem/ruby/network')
5 files changed, 5 insertions, 82 deletions
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 baf6a9687..35732edad 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -210,13 +210,7 @@ void GarnetNetwork_d::regStats() { BaseGarnetNetwork::regStats(); - regLinkStats(); - regPowerStats(); -} -void -GarnetNetwork_d::regLinkStats() -{ m_average_link_utilization.name(name() + ".avg_link_utilization"); m_average_vc_load @@ -227,34 +221,8 @@ GarnetNetwork_d::regLinkStats() } void -GarnetNetwork_d::regPowerStats() -{ - m_dynamic_link_power.name(name() + ".link_dynamic_power"); - m_static_link_power.name(name() + ".link_static_power"); - - m_total_link_power.name(name() + ".link_total_power"); - m_total_link_power = m_dynamic_link_power + m_static_link_power; - - m_dynamic_router_power.name(name() + ".router_dynamic_power"); - m_static_router_power.name(name() + ".router_static_power"); - m_clk_power.name(name() + ".clk_power"); - - m_total_router_power.name(name() + ".router_total_power"); - m_total_router_power = m_dynamic_router_power + - m_static_router_power + - m_clk_power; -} - -void GarnetNetwork_d::collateStats() { - collateLinkStats(); - collatePowerStats(); -} - -void -GarnetNetwork_d::collateLinkStats() -{ for (int i = 0; i < m_links.size(); i++) { m_average_link_utilization += (double(m_links[i]->getLinkUtilization())) / @@ -266,23 +234,10 @@ GarnetNetwork_d::collateLinkStats() ((double)vc_load[j] / (double)(curCycle() - g_ruby_start)); } } -} - -void -GarnetNetwork_d::collatePowerStats() -{ - double sim_cycles = (double)(curCycle() - g_ruby_start); - for (int i = 0; i < m_links.size(); i++) { - m_links[i]->calculate_power(sim_cycles); - m_dynamic_link_power += m_links[i]->get_dynamic_power(); - m_static_link_power += m_links[i]->get_static_power(); - } + // Ask the routers to collate their statistics for (int i = 0; i < m_routers.size(); i++) { - m_routers[i]->calculate_power(); - m_dynamic_router_power += m_routers[i]->get_dynamic_power(); - m_static_router_power += m_routers[i]->get_static_power(); - m_clk_power += m_routers[i]->get_clk_power(); + m_routers[i]->collateStats(); } } 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 507d8bbd6..738a28cf7 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh @@ -90,13 +90,7 @@ class GarnetNetwork_d : public BaseGarnetNetwork GarnetNetwork_d(const GarnetNetwork_d& obj); GarnetNetwork_d& operator=(const GarnetNetwork_d& obj); - void collateLinkStats(); - void collatePowerStats(); - void regLinkStats(); - void regPowerStats(); - std::vector<VNET_type > m_vnet_type; - std::vector<Router_d *> m_routers; // All Routers in Network std::vector<NetworkLink_d *> m_links; // All links in the network std::vector<CreditLink_d *> m_creditlinks; // All links in net @@ -105,16 +99,6 @@ class GarnetNetwork_d : public BaseGarnetNetwork int m_buffers_per_data_vc; int m_buffers_per_ctrl_vc; - // Statistical variables for power - Stats::Scalar m_dynamic_link_power; - Stats::Scalar m_static_link_power; - Stats::Formula m_total_link_power; - - Stats::Scalar m_dynamic_router_power; - Stats::Scalar m_static_router_power; - Stats::Scalar m_clk_power; - Stats::Formula m_total_router_power; - // Statistical variables for performance Stats::Scalar m_average_link_utilization; Stats::Vector m_average_vc_load; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh index 868937fe7..684f7ebaf 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh @@ -55,10 +55,6 @@ class NetworkLink_d : public ClockedObject, public Consumer int get_id(){return m_id;} void wakeup(); - void calculate_power(double) {} - double get_dynamic_power() const { return m_power_dyn; } - double get_static_power()const { return m_power_sta; } - unsigned int getLinkUtilization() const { return m_link_utilized; } const std::vector<unsigned int> & getVcLoad() const { return m_vc_load; } @@ -83,9 +79,6 @@ class NetworkLink_d : public ClockedObject, public Consumer // Statistical variables unsigned int m_link_utilized; std::vector<unsigned int> m_vc_load; - - double m_power_dyn; - double m_power_sta; }; #endif // __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_NETWORK_LINK_D_HH__ diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc index 3370c356c..9f0b6c33f 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc @@ -158,7 +158,7 @@ Router_d::update_sw_winner(int inport, flit_d *t_flit) } void -Router_d::calculate_performance_numbers() +Router_d::collateStats() { for (int j = 0; j < m_virtual_networks; j++) { for (int i = 0; i < m_input_unit.size(); i++) { diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh index 7dae0bb52..931455e43 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh @@ -85,14 +85,10 @@ class Router_d : public BasicRouter void route_req(flit_d *t_flit, InputUnit_d* in_unit, int invc); void vcarb_req(); void swarb_req(); + void printFaultVector(std::ostream& out); void printAggregateFaultProbability(std::ostream& out); - - void calculate_power() {} - void calculate_performance_numbers(); - double get_dynamic_power() const { return m_power_dyn; } - double get_static_power() const { return m_power_sta; } - double get_clk_power() const { return m_clk_power; } + void collateStats(); bool get_fault_vector(int temperature, float fault_vector[]){ return m_network_ptr->fault_model->fault_vector(m_id, temperature, @@ -119,11 +115,6 @@ class Router_d : public BasicRouter SWallocator_d *m_sw_alloc; Switch_d *m_switch; - // Statistical variables for power - double m_power_dyn; - double m_power_sta; - double m_clk_power; - // Statistical variables for performance std::vector<double> buf_read_count; std::vector<double> buf_write_count; |