ruby: network: garnet: add statistics for different activities
This patch adds some statistics to garnet that record the activity of certain structures in the on-chip network. These statistics, in a later patch, will be used for computing the energy consumed by the on-chip network.
This commit is contained in:
parent
25bb18f12b
commit
a098fad174
4 changed files with 80 additions and 28 deletions
|
@ -105,3 +105,12 @@ InputUnit_d::functionalWrite(Packet *pkt)
|
|||
|
||||
return num_functional_writes;
|
||||
}
|
||||
|
||||
void
|
||||
InputUnit_d::resetStats()
|
||||
{
|
||||
for (int j = 0; j < m_num_buffer_reads.size(); j++) {
|
||||
m_num_buffer_reads[j] = 0;
|
||||
m_num_buffer_writes[j] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,6 +159,7 @@ class InputUnit_d : public Consumer
|
|||
{ return m_num_buffer_writes[vnet]; }
|
||||
|
||||
uint32_t functionalWrite(Packet *pkt);
|
||||
void resetStats();
|
||||
|
||||
private:
|
||||
int m_id;
|
||||
|
|
|
@ -57,20 +57,6 @@ Router_d::Router_d(const Params *p)
|
|||
|
||||
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()
|
||||
|
@ -157,22 +143,71 @@ Router_d::update_sw_winner(int inport, flit_d *t_flit)
|
|||
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
|
||||
|
|
|
@ -88,7 +88,10 @@ class Router_d : public BasicRouter
|
|||
|
||||
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,
|
||||
|
@ -105,8 +108,6 @@ class Router_d : public BasicRouter
|
|||
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;
|
||||
|
@ -115,11 +116,17 @@ class Router_d : public BasicRouter
|
|||
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__
|
||||
|
|
Loading…
Reference in a new issue