diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-09-06 16:21:35 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-09-06 16:21:35 -0500 |
commit | 90bfbd9793e64b29d09f4ca4ee610ee08f82ea75 (patch) | |
tree | e14b49f9632b25cde8a32b5e5787a36a376e6dff /src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc | |
parent | e9ae8b7d29e83fa2cad55006d2c6dc58115965cc (diff) | |
download | gem5-90bfbd9793e64b29d09f4ca4ee610ee08f82ea75.tar.xz |
ruby: network: convert to gem5 style stats
Diffstat (limited to 'src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc')
-rw-r--r-- | src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc | 60 |
1 files changed, 22 insertions, 38 deletions
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc index ea08a054b..1e24cbc69 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc @@ -210,54 +210,38 @@ GarnetNetwork::functionalWrite(Packet *pkt) } void -GarnetNetwork::printLinkStats(ostream& out) const +GarnetNetwork::regStats() { - double average_link_utilization = 0; - vector<double> average_vc_load; - average_vc_load.resize(m_virtual_networks*m_vcs_per_vnet); - - for (int i = 0; i < m_virtual_networks*m_vcs_per_vnet; i++) { - average_vc_load[i] = 0; + BaseGarnetNetwork::regStats(); + + m_average_link_utilization.name(name() + ".avg_link_utilization"); + + m_average_vc_load + .init(m_virtual_networks * m_vcs_per_vnet) + .name(name() + ".avg_vc_load") + .flags(Stats::pdf | Stats::total | Stats::nozero) + ; + for (int i = 0; i < m_virtual_networks * m_vcs_per_vnet; i++) { + m_average_vc_load + .subname(i, csprintf(".%i", i)) + .flags(Stats::nozero) + ; } +} - out << endl; +void +GarnetNetwork::collateStats() +{ for (int i = 0; i < m_links.size(); i++) { - average_link_utilization += + m_average_link_utilization += (double(m_links[i]->getLinkUtilization())) / (double(curCycle() - g_ruby_start)); - vector<int> vc_load = m_links[i]->getVcLoad(); + vector<unsigned int> vc_load = m_links[i]->getVcLoad(); for (int j = 0; j < vc_load.size(); j++) { - assert(vc_load.size() == m_vcs_per_vnet*m_virtual_networks); - average_vc_load[j] += vc_load[j]; + m_average_vc_load[j] += vc_load[j]; } } - average_link_utilization = - average_link_utilization/m_links.size(); - out << "Average Link Utilization :: " << average_link_utilization - << " flits/cycle" << endl; - out << "-------------" << endl; - - for (int i = 0; i < m_vcs_per_vnet*m_virtual_networks; i++) { - if (!m_in_use[i/m_vcs_per_vnet]) - continue; - - average_vc_load[i] = double(average_vc_load[i]) / - (double(curCycle() - g_ruby_start)); - out << "Average VC Load [" << i << "] = " << average_vc_load[i] - << " flits/cycle " << endl; - } - out << "-------------" << endl; - out << endl; -} - -void -GarnetNetwork::printPowerStats(ostream& out) const -{ - out << "Network Power" << endl; - out << "-------------" << endl; - out << "Orion does not work with flexible pipeline" << endl; - out << endl; } void |