diff options
author | Tushar Krishna <tushar@csail.mit.edu> | 2011-05-31 02:56:22 -0400 |
---|---|---|
committer | Tushar Krishna <tushar@csail.mit.edu> | 2011-05-31 02:56:22 -0400 |
commit | 07e5b15953741029bd58e21844824615d0108099 (patch) | |
tree | 88aa0986d6e7fe44fa044755030c9fa559d46264 /src/mem/ruby | |
parent | 36899dc197c17a87077c59604e00482b6f63a2a8 (diff) | |
download | gem5-07e5b15953741029bd58e21844824615d0108099.tar.xz |
orion: bug fix in link power, and some reorg
Diffstat (limited to 'src/mem/ruby')
-rw-r--r-- | src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc | 3 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh | 2 | ||||
-rw-r--r-- | src/mem/ruby/network/orion/NetworkPower.cc | 42 |
3 files changed, 29 insertions, 18 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 1fa4abbac..be9a92305 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -327,6 +327,7 @@ GarnetNetwork_d::printStats(ostream& out) const double m_total_router_power = 0.0; double m_dynamic_router_power = 0.0; double m_static_router_power = 0.0; + double m_clk_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(); @@ -338,11 +339,13 @@ GarnetNetwork_d::printStats(ostream& out) const 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(); + m_clk_power += m_router_ptr_vector[i]->get_clk_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 Clock Power = " << m_clk_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; 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 286d13a20..e5a3a0ce2 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh @@ -92,6 +92,7 @@ class Router_d : public BasicRouter double get_dynamic_power(){return m_power_dyn;} double get_static_power(){return m_power_sta;} + double get_clk_power(){return m_clk_power;} private: int m_virtual_networks, m_num_vcs, m_vc_per_vnet; @@ -113,6 +114,7 @@ class Router_d : public BasicRouter double m_power_dyn; double m_power_sta; + double m_clk_power; }; #endif // __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_ROUTER_D_HH__ diff --git a/src/mem/ruby/network/orion/NetworkPower.cc b/src/mem/ruby/network/orion/NetworkPower.cc index af163ac29..7c9634e56 100644 --- a/src/mem/ruby/network/orion/NetworkPower.cc +++ b/src/mem/ruby/network/orion/NetworkPower.cc @@ -40,7 +40,8 @@ Router_d::calculate_power() //Network Activities from garnet calculate_performance_numbers(); double sim_cycles; - sim_cycles = g_eventQueue_ptr->getTime() - m_network_ptr->getRubyStartTime(); + sim_cycles = + g_eventQueue_ptr->getTime() - m_network_ptr->getRubyStartTime(); // Number of virtual networks/message classes declared in Ruby // maybe greater than active virtual networks. @@ -88,7 +89,8 @@ Router_d::calculate_power() for (int i = 0; i < m_virtual_networks; i++) { if (active_vclass_ary[i]) { int temp_vc = i*m_vc_per_vnet; - vclass_type_ary.push_back((uint32_t) m_network_ptr->get_vnet_type(temp_vc)); + vclass_type_ary.push_back((uint32_t) + m_network_ptr->get_vnet_type(temp_vc)); } } assert(vclass_type_ary.size() == num_active_vclass); @@ -97,7 +99,7 @@ Router_d::calculate_power() uint32_t in_buf_per_data_vc = m_network_ptr->getBuffersPerDataVC(); uint32_t in_buf_per_ctrl_vc = m_network_ptr->getBuffersPerCtrlVC(); //flit width in bits - uint32_t flit_width = m_network_ptr->getNiFlitSize() * 8; + uint32_t flit_width_bits = m_network_ptr->getNiFlitSize() * 8; orion_rtr_ptr = new OrionRouter( num_in_port, @@ -107,7 +109,7 @@ Router_d::calculate_power() num_vc_per_vclass, in_buf_per_data_vc, in_buf_per_ctrl_vc, - flit_width, + flit_width_bits, orion_cfg_ptr ); @@ -120,7 +122,6 @@ Router_d::calculate_power() double Psw_arb_local_dyn = 0.0; double Psw_arb_global_dyn = 0.0; double Pxbar_dyn = 0.0; - double Pclk_dyn = 0.0; double Ptotal_dyn = 0.0; double Pbuf_sta = 0.0; @@ -178,7 +179,7 @@ Router_d::calculate_power() // Switch Allocation Local // Each input port chooses one input VC as requestor // Arbiter size: num_vclass*num_vc_per_vclass:1 - Psw_arb_local_dyn += + Psw_arb_local_dyn = orion_rtr_ptr->calc_dynamic_energy_local_sw_arb( num_vclass*num_vc_per_vclass/2, false)* (sw_local_arbit_count/sim_cycles)* @@ -187,28 +188,27 @@ Router_d::calculate_power() // Switch Allocation Global // Each output port chooses one input port as winner // Arbiter size: num_in_port:1 - Psw_arb_global_dyn += + Psw_arb_global_dyn = orion_rtr_ptr->calc_dynamic_energy_global_sw_arb( num_in_port/2, false)* (sw_global_arbit_count/sim_cycles)* freq_Hz; // Crossbar - Pxbar_dyn += + Pxbar_dyn = orion_rtr_ptr->calc_dynamic_energy_xbar(false)* (crossbar_count/sim_cycles)*freq_Hz; - // Clock - Pclk_dyn += orion_rtr_ptr->calc_dynamic_energy_clock()*freq_Hz; - // Total Ptotal_dyn = Pbuf_wr_dyn + Pbuf_rd_dyn + Pvc_arb_local_dyn + Pvc_arb_global_dyn + Psw_arb_local_dyn + Psw_arb_global_dyn + - Pxbar_dyn + - Pclk_dyn; + Pxbar_dyn; m_power_dyn = Ptotal_dyn; + + // Clock Power + m_clk_power = orion_rtr_ptr->calc_dynamic_energy_clock()*freq_Hz; // Static Power Pbuf_sta = orion_rtr_ptr->get_static_power_buf(); @@ -220,7 +220,7 @@ Router_d::calculate_power() m_power_sta = Ptotal_sta; - Ptotal = Ptotal_dyn + Ptotal_sta; + Ptotal = m_power_dyn + m_power_sta + m_clk_power; return Ptotal; } @@ -240,26 +240,32 @@ NetworkLink_d::calculate_power() link_length = orion_cfg_ptr->get<double>("LINK_LENGTH"); + int channel_width_bits = channel_width*8; + orion_link_ptr = new OrionLink( link_length, - channel_width /* channel width */, + channel_width_bits, orion_cfg_ptr); -// // Dynamic Power double sim_cycles = (double)(g_eventQueue_ptr->getTime() - m_net_ptr->getRubyStartTime()); - double Plink_dyn = orion_link_ptr->calc_dynamic_energy(channel_width/2)* + // Dynamic Power + // Assume half the bits flipped on every link activity + double Plink_dyn = + orion_link_ptr->calc_dynamic_energy(channel_width_bits/2)* (m_link_utilized/ sim_cycles)*freq_Hz; m_power_dyn = Plink_dyn; // Static Power + // Calculates number of repeaters needed in link, and their static power + // For short links, like 1mm, no repeaters are needed so static power is 0 double Plink_sta = orion_link_ptr->get_static_power(); m_power_sta = Plink_sta; - double Ptotal = Plink_dyn + Plink_sta; + double Ptotal = m_power_dyn + m_power_sta; return Ptotal; } |