m_input_unit.clear();
m_output_unit.clear();
-
- crossbar_count = 0;
- sw_local_arbit_count = 0;
- sw_global_arbit_count = 0;
- buf_read_count.resize(m_virtual_networks);
- buf_write_count.resize(m_virtual_networks);
- vc_local_arbit_count.resize(m_virtual_networks);
- vc_global_arbit_count.resize(m_virtual_networks);
- for (int i = 0; i < m_virtual_networks; i++) {
- buf_read_count[i] = 0;
- buf_write_count[i] = 0;
- vc_local_arbit_count[i] = 0;
- vc_global_arbit_count[i] = 0;
- }
}
Router_d::~Router_d()
m_switch->scheduleEventAbsolute(clockEdge(Cycles(1)));
}
+void
+Router_d::regStats()
+{
+ m_buffer_reads
+ .name(name() + ".buffer_reads")
+ .flags(Stats::nozero)
+ ;
+
+ m_buffer_writes
+ .name(name() + ".buffer_writes")
+ .flags(Stats::nozero)
+ ;
+
+ m_crossbar_activity
+ .name(name() + ".crossbar_activity")
+ .flags(Stats::nozero)
+ ;
+
+ m_sw_local_arbiter_activity
+ .name(name() + ".sw_local_arbiter_activity")
+ .flags(Stats::nozero)
+ ;
+
+ m_sw_global_arbiter_activity
+ .name(name() + ".sw_global_arbiter_activity")
+ .flags(Stats::nozero)
+ ;
+
+ m_vc_local_arbiter_activity
+ .name(name() + ".vc_local_arbiter_activity")
+ .flags(Stats::nozero)
+ ;
+
+ m_vc_global_arbiter_activity
+ .name(name() + ".vc_global_arbiter_activity")
+ .flags(Stats::nozero)
+ ;
+}
+
void
Router_d::collateStats()
{
for (int j = 0; j < m_virtual_networks; j++) {
for (int i = 0; i < m_input_unit.size(); i++) {
- buf_read_count[j] += m_input_unit[i]->get_buf_read_count(j);
- buf_write_count[j] += m_input_unit[i]->get_buf_write_count(j);
+ m_buffer_reads += m_input_unit[i]->get_buf_read_count(j);
+ m_buffer_writes += m_input_unit[i]->get_buf_write_count(j);
}
- vc_local_arbit_count[j] = m_vc_alloc->get_local_arbit_count(j);
- vc_global_arbit_count[j] = m_vc_alloc->get_global_arbit_count(j);
+ m_vc_local_arbiter_activity += m_vc_alloc->get_local_arbit_count(j);
+ m_vc_global_arbiter_activity += m_vc_alloc->get_global_arbit_count(j);
}
- sw_local_arbit_count = m_sw_alloc->get_local_arbit_count();
- sw_global_arbit_count = m_sw_alloc->get_global_arbit_count();
- crossbar_count = m_switch->get_crossbar_count();
+ m_sw_local_arbiter_activity = m_sw_alloc->get_local_arbit_count();
+ m_sw_global_arbiter_activity = m_sw_alloc->get_global_arbit_count();
+ m_crossbar_activity = m_switch->get_crossbar_count();
+}
+
+void
+Router_d::resetStats()
+{
+ for (int j = 0; j < m_virtual_networks; j++) {
+ for (int i = 0; i < m_input_unit.size(); i++) {
+ m_input_unit[i]->resetStats();
+ }
+ }
}
void
void printFaultVector(std::ostream& out);
void printAggregateFaultProbability(std::ostream& out);
+
+ void regStats();
void collateStats();
+ void resetStats();
bool get_fault_vector(int temperature, float fault_vector[]){
return m_network_ptr->fault_model->fault_vector(m_id, temperature,
private:
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
GarnetNetwork_d *m_network_ptr;
- double sw_local_arbit_count, sw_global_arbit_count;
- double crossbar_count;
std::vector<InputUnit_d *> m_input_unit;
std::vector<OutputUnit_d *> m_output_unit;
SWallocator_d *m_sw_alloc;
Switch_d *m_switch;
- // Statistical variables for performance
- std::vector<double> buf_read_count;
- std::vector<double> buf_write_count;
- std::vector<double> vc_local_arbit_count;
- std::vector<double> vc_global_arbit_count;
+ // Statistical variables required for power computations
+ Stats::Scalar m_buffer_reads;
+ Stats::Scalar m_buffer_writes;
+
+ Stats::Scalar m_sw_local_arbiter_activity;
+ Stats::Scalar m_sw_global_arbiter_activity;
+
+ Stats::Scalar m_vc_local_arbiter_activity;
+ Stats::Scalar m_vc_global_arbiter_activity;
+
+ Stats::Scalar m_crossbar_activity;
};
#endif // __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_ROUTER_D_HH__