From 8fdad96b7c80a0fca5c91d4976a31ca120ffc532 Mon Sep 17 00:00:00 2001 From: Polydoros Petrakis Date: Wed, 20 May 2020 01:56:07 +0300 Subject: [PATCH] mem-garnet,mem-ruby: Properly reset garnet2.0 statistics. Statistics for crossbar activity, and link related statistics were not getting reset when using m5_reset_stats. Change-Id: Ib84c55200e4a86c6f9190de28498112bd43dde9d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29253 Reviewed-by: Jason Lowe-Power Reviewed-by: Srikant Bharadwaj Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/mem/ruby/network/garnet2.0/GarnetNetwork.cc | 14 ++++++++++++++ src/mem/ruby/network/garnet2.0/GarnetNetwork.hh | 1 + src/mem/ruby/system/RubySystem.cc | 1 + 3 files changed, 16 insertions(+) diff --git a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc index 1eff92175..8f226b1de 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc @@ -414,6 +414,20 @@ GarnetNetwork::collateStats() } } +void +GarnetNetwork::resetStats() +{ + for (int i = 0; i < m_routers.size(); i++) { + m_routers[i]->resetStats(); + } + for (int i = 0; i < m_networklinks.size(); i++) { + m_networklinks[i]->resetStats(); + } + for (int i = 0; i < m_creditlinks.size(); i++) { + m_creditlinks[i]->resetStats(); + } +} + void GarnetNetwork::print(ostream& out) const { diff --git a/src/mem/ruby/network/garnet2.0/GarnetNetwork.hh b/src/mem/ruby/network/garnet2.0/GarnetNetwork.hh index 9acbeef4e..3821dd8b8 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetNetwork.hh +++ b/src/mem/ruby/network/garnet2.0/GarnetNetwork.hh @@ -101,6 +101,7 @@ class GarnetNetwork : public Network // Stats void collateStats(); void regStats(); + void resetStats(); void print(std::ostream& out) const; // increment counters diff --git a/src/mem/ruby/system/RubySystem.cc b/src/mem/ruby/system/RubySystem.cc index 57d49667e..2aeff8cae 100644 --- a/src/mem/ruby/system/RubySystem.cc +++ b/src/mem/ruby/system/RubySystem.cc @@ -407,6 +407,7 @@ void RubySystem::resetStats() { m_start_cycle = curCycle(); + m_network->resetStats(); } bool -- 2.30.2