GarnetNetwork_d::regStats()
{
BaseGarnetNetwork::regStats();
- regLinkStats();
- regPowerStats();
-}
-void
-GarnetNetwork_d::regLinkStats()
-{
m_average_link_utilization.name(name() + ".avg_link_utilization");
m_average_vc_load
;
}
-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)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();
}
}
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
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;
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; }
// 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__
}
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++) {
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,
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;