diff options
Diffstat (limited to 'src/mem/ruby/network/garnet')
-rw-r--r-- | src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc | 10 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc | 7 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc index 35732edad..d16db76ca 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -40,6 +40,7 @@ #include "mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh" #include "mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh" #include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh" +#include "mem/ruby/system/System.hh" using namespace std; using m5::stl_helpers::deletePointers; @@ -223,15 +224,16 @@ GarnetNetwork_d::regStats() void GarnetNetwork_d::collateStats() { + RubySystem *rs = params()->ruby_system; + double time_delta = double(curCycle() - rs->getStartCycle()); + for (int i = 0; i < m_links.size(); i++) { m_average_link_utilization += - (double(m_links[i]->getLinkUtilization())) / - (double(curCycle() - g_ruby_start)); + (double(m_links[i]->getLinkUtilization())) / time_delta; vector<unsigned int> vc_load = m_links[i]->getVcLoad(); for (int j = 0; j < vc_load.size(); j++) { - m_average_vc_load[j] += - ((double)vc_load[j] / (double)(curCycle() - g_ruby_start)); + m_average_vc_load[j] += ((double)vc_load[j] / time_delta); } } diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc index 8951f7513..091a0077d 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc @@ -40,6 +40,7 @@ #include "mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh" #include "mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh" #include "mem/ruby/network/garnet/flexible-pipeline/Router.hh" +#include "mem/ruby/system/System.hh" using namespace std; using m5::stl_helpers::deletePointers; @@ -227,10 +228,12 @@ GarnetNetwork::regStats() void GarnetNetwork::collateStats() { + RubySystem *rs = params()->ruby_system; + double time_delta = double(curCycle() - rs->getStartCycle()); + for (int i = 0; i < m_links.size(); i++) { m_average_link_utilization += - (double(m_links[i]->getLinkUtilization())) / - (double(curCycle() - g_ruby_start)); + (double(m_links[i]->getLinkUtilization())) / time_delta; vector<unsigned int> vc_load = m_links[i]->getVcLoad(); for (int j = 0; j < vc_load.size(); j++) { |