orion: bug fix in link power, and some reorg
This commit is contained in:
parent
36899dc197
commit
07e5b15953
3 changed files with 29 additions and 18 deletions
|
@ -327,6 +327,7 @@ GarnetNetwork_d::printStats(ostream& out) const
|
||||||
double m_total_router_power = 0.0;
|
double m_total_router_power = 0.0;
|
||||||
double m_dynamic_router_power = 0.0;
|
double m_dynamic_router_power = 0.0;
|
||||||
double m_static_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++) {
|
for (int i = 0; i < m_link_ptr_vector.size(); i++) {
|
||||||
m_total_link_power += m_link_ptr_vector[i]->calculate_power();
|
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_total_router_power += m_router_ptr_vector[i]->calculate_power();
|
||||||
m_dynamic_router_power += m_router_ptr_vector[i]->get_dynamic_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_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 Dynamic Power = " << m_dynamic_link_power << " W" << endl;
|
||||||
out << "Link Static Power = " << m_static_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 << "Total Link Power = " << m_total_link_power << " W " << endl;
|
||||||
out << "Router Dynamic Power = " << m_dynamic_router_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 << "Router Static Power = " << m_static_router_power << " W" << endl;
|
||||||
out << "Total Router Power = " << m_total_router_power << " W " <<endl;
|
out << "Total Router Power = " << m_total_router_power << " W " <<endl;
|
||||||
out << "-------------" << endl;
|
out << "-------------" << endl;
|
||||||
|
|
|
@ -92,6 +92,7 @@ class Router_d : public BasicRouter
|
||||||
|
|
||||||
double get_dynamic_power(){return m_power_dyn;}
|
double get_dynamic_power(){return m_power_dyn;}
|
||||||
double get_static_power(){return m_power_sta;}
|
double get_static_power(){return m_power_sta;}
|
||||||
|
double get_clk_power(){return m_clk_power;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
|
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_dyn;
|
||||||
double m_power_sta;
|
double m_power_sta;
|
||||||
|
double m_clk_power;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_ROUTER_D_HH__
|
#endif // __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_ROUTER_D_HH__
|
||||||
|
|
|
@ -40,7 +40,8 @@ Router_d::calculate_power()
|
||||||
//Network Activities from garnet
|
//Network Activities from garnet
|
||||||
calculate_performance_numbers();
|
calculate_performance_numbers();
|
||||||
double sim_cycles;
|
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
|
// Number of virtual networks/message classes declared in Ruby
|
||||||
// maybe greater than active virtual networks.
|
// maybe greater than active virtual networks.
|
||||||
|
@ -88,7 +89,8 @@ Router_d::calculate_power()
|
||||||
for (int i = 0; i < m_virtual_networks; i++) {
|
for (int i = 0; i < m_virtual_networks; i++) {
|
||||||
if (active_vclass_ary[i]) {
|
if (active_vclass_ary[i]) {
|
||||||
int temp_vc = i*m_vc_per_vnet;
|
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);
|
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_data_vc = m_network_ptr->getBuffersPerDataVC();
|
||||||
uint32_t in_buf_per_ctrl_vc = m_network_ptr->getBuffersPerCtrlVC();
|
uint32_t in_buf_per_ctrl_vc = m_network_ptr->getBuffersPerCtrlVC();
|
||||||
//flit width in bits
|
//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(
|
orion_rtr_ptr = new OrionRouter(
|
||||||
num_in_port,
|
num_in_port,
|
||||||
|
@ -107,7 +109,7 @@ Router_d::calculate_power()
|
||||||
num_vc_per_vclass,
|
num_vc_per_vclass,
|
||||||
in_buf_per_data_vc,
|
in_buf_per_data_vc,
|
||||||
in_buf_per_ctrl_vc,
|
in_buf_per_ctrl_vc,
|
||||||
flit_width,
|
flit_width_bits,
|
||||||
orion_cfg_ptr
|
orion_cfg_ptr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -120,7 +122,6 @@ Router_d::calculate_power()
|
||||||
double Psw_arb_local_dyn = 0.0;
|
double Psw_arb_local_dyn = 0.0;
|
||||||
double Psw_arb_global_dyn = 0.0;
|
double Psw_arb_global_dyn = 0.0;
|
||||||
double Pxbar_dyn = 0.0;
|
double Pxbar_dyn = 0.0;
|
||||||
double Pclk_dyn = 0.0;
|
|
||||||
double Ptotal_dyn = 0.0;
|
double Ptotal_dyn = 0.0;
|
||||||
|
|
||||||
double Pbuf_sta = 0.0;
|
double Pbuf_sta = 0.0;
|
||||||
|
@ -178,7 +179,7 @@ Router_d::calculate_power()
|
||||||
// Switch Allocation Local
|
// Switch Allocation Local
|
||||||
// Each input port chooses one input VC as requestor
|
// Each input port chooses one input VC as requestor
|
||||||
// Arbiter size: num_vclass*num_vc_per_vclass:1
|
// 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(
|
orion_rtr_ptr->calc_dynamic_energy_local_sw_arb(
|
||||||
num_vclass*num_vc_per_vclass/2, false)*
|
num_vclass*num_vc_per_vclass/2, false)*
|
||||||
(sw_local_arbit_count/sim_cycles)*
|
(sw_local_arbit_count/sim_cycles)*
|
||||||
|
@ -187,29 +188,28 @@ Router_d::calculate_power()
|
||||||
// Switch Allocation Global
|
// Switch Allocation Global
|
||||||
// Each output port chooses one input port as winner
|
// Each output port chooses one input port as winner
|
||||||
// Arbiter size: num_in_port:1
|
// Arbiter size: num_in_port:1
|
||||||
Psw_arb_global_dyn +=
|
Psw_arb_global_dyn =
|
||||||
orion_rtr_ptr->calc_dynamic_energy_global_sw_arb(
|
orion_rtr_ptr->calc_dynamic_energy_global_sw_arb(
|
||||||
num_in_port/2, false)*
|
num_in_port/2, false)*
|
||||||
(sw_global_arbit_count/sim_cycles)*
|
(sw_global_arbit_count/sim_cycles)*
|
||||||
freq_Hz;
|
freq_Hz;
|
||||||
|
|
||||||
// Crossbar
|
// Crossbar
|
||||||
Pxbar_dyn +=
|
Pxbar_dyn =
|
||||||
orion_rtr_ptr->calc_dynamic_energy_xbar(false)*
|
orion_rtr_ptr->calc_dynamic_energy_xbar(false)*
|
||||||
(crossbar_count/sim_cycles)*freq_Hz;
|
(crossbar_count/sim_cycles)*freq_Hz;
|
||||||
|
|
||||||
// Clock
|
|
||||||
Pclk_dyn += orion_rtr_ptr->calc_dynamic_energy_clock()*freq_Hz;
|
|
||||||
|
|
||||||
// Total
|
// Total
|
||||||
Ptotal_dyn = Pbuf_wr_dyn + Pbuf_rd_dyn +
|
Ptotal_dyn = Pbuf_wr_dyn + Pbuf_rd_dyn +
|
||||||
Pvc_arb_local_dyn + Pvc_arb_global_dyn +
|
Pvc_arb_local_dyn + Pvc_arb_global_dyn +
|
||||||
Psw_arb_local_dyn + Psw_arb_global_dyn +
|
Psw_arb_local_dyn + Psw_arb_global_dyn +
|
||||||
Pxbar_dyn +
|
Pxbar_dyn;
|
||||||
Pclk_dyn;
|
|
||||||
|
|
||||||
m_power_dyn = Ptotal_dyn;
|
m_power_dyn = Ptotal_dyn;
|
||||||
|
|
||||||
|
// Clock Power
|
||||||
|
m_clk_power = orion_rtr_ptr->calc_dynamic_energy_clock()*freq_Hz;
|
||||||
|
|
||||||
// Static Power
|
// Static Power
|
||||||
Pbuf_sta = orion_rtr_ptr->get_static_power_buf();
|
Pbuf_sta = orion_rtr_ptr->get_static_power_buf();
|
||||||
Pvc_arb_sta = orion_rtr_ptr->get_static_power_va();
|
Pvc_arb_sta = orion_rtr_ptr->get_static_power_va();
|
||||||
|
@ -220,7 +220,7 @@ Router_d::calculate_power()
|
||||||
|
|
||||||
m_power_sta = Ptotal_sta;
|
m_power_sta = Ptotal_sta;
|
||||||
|
|
||||||
Ptotal = Ptotal_dyn + Ptotal_sta;
|
Ptotal = m_power_dyn + m_power_sta + m_clk_power;
|
||||||
|
|
||||||
return Ptotal;
|
return Ptotal;
|
||||||
}
|
}
|
||||||
|
@ -240,26 +240,32 @@ NetworkLink_d::calculate_power()
|
||||||
|
|
||||||
link_length = orion_cfg_ptr->get<double>("LINK_LENGTH");
|
link_length = orion_cfg_ptr->get<double>("LINK_LENGTH");
|
||||||
|
|
||||||
|
int channel_width_bits = channel_width*8;
|
||||||
|
|
||||||
orion_link_ptr = new OrionLink(
|
orion_link_ptr = new OrionLink(
|
||||||
link_length,
|
link_length,
|
||||||
channel_width /* channel width */,
|
channel_width_bits,
|
||||||
orion_cfg_ptr);
|
orion_cfg_ptr);
|
||||||
|
|
||||||
// // Dynamic Power
|
|
||||||
double sim_cycles =
|
double sim_cycles =
|
||||||
(double)(g_eventQueue_ptr->getTime() - m_net_ptr->getRubyStartTime());
|
(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_link_utilized/ sim_cycles)*freq_Hz;
|
||||||
|
|
||||||
m_power_dyn = Plink_dyn;
|
m_power_dyn = Plink_dyn;
|
||||||
|
|
||||||
// Static Power
|
// 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();
|
double Plink_sta = orion_link_ptr->get_static_power();
|
||||||
|
|
||||||
m_power_sta = Plink_sta;
|
m_power_sta = Plink_sta;
|
||||||
|
|
||||||
double Ptotal = Plink_dyn + Plink_sta;
|
double Ptotal = m_power_dyn + m_power_sta;
|
||||||
|
|
||||||
return Ptotal;
|
return Ptotal;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue