diff options
author | Javier Cano-Cano <javier.cano555@gmail.com> | 2017-06-06 16:10:26 +0200 |
---|---|---|
committer | Javier Cano-Cano <javier.cano555@gmail.com> | 2017-06-15 16:17:21 +0000 |
commit | b377217202305784f91ffe719f9c04f54ad24145 (patch) | |
tree | f090a92af15465737456cf5ebdb482cb04aea836 /src | |
parent | 04a58ded65e3a5f692f730eed87ee0476643c9fe (diff) | |
download | gem5-b377217202305784f91ffe719f9c04f54ad24145.tar.xz |
mem-garnet: Fix garnet stats
This patch fix some statistics that in presence of a resetStats
instruction were not reseted. This bug makes impossible to obtain
reliable network statistics when the simulation doesn't start from tick
zero.
Change-Id: Ibec45f08d95bf0a533d94b70ec960719206ae945
Maintainer: Tushar Krishna <tushar@ece.gatech.edu>
Reviewed-on: https://gem5-review.googlesource.com/3700
Reviewed-by: Jieming Yin <bjm419@gmail.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mem/ruby/network/garnet2.0/CrossbarSwitch.cc | 6 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet2.0/CrossbarSwitch.hh | 1 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet2.0/NetworkLink.cc | 10 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet2.0/NetworkLink.hh | 1 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet2.0/Router.cc | 3 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet2.0/SwitchAllocator.cc | 7 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet2.0/SwitchAllocator.hh | 2 |
7 files changed, 30 insertions, 0 deletions
diff --git a/src/mem/ruby/network/garnet2.0/CrossbarSwitch.cc b/src/mem/ruby/network/garnet2.0/CrossbarSwitch.cc index 340f56d61..fbaf25b7d 100644 --- a/src/mem/ruby/network/garnet2.0/CrossbarSwitch.cc +++ b/src/mem/ruby/network/garnet2.0/CrossbarSwitch.cc @@ -110,3 +110,9 @@ CrossbarSwitch::functionalWrite(Packet *pkt) return num_functional_writes; } + +void +CrossbarSwitch::resetStats() +{ + m_crossbar_activity = 0; +}
\ No newline at end of file diff --git a/src/mem/ruby/network/garnet2.0/CrossbarSwitch.hh b/src/mem/ruby/network/garnet2.0/CrossbarSwitch.hh index 7aaeabf0c..bca3a92e4 100644 --- a/src/mem/ruby/network/garnet2.0/CrossbarSwitch.hh +++ b/src/mem/ruby/network/garnet2.0/CrossbarSwitch.hh @@ -59,6 +59,7 @@ class CrossbarSwitch : public Consumer inline double get_crossbar_activity() { return m_crossbar_activity; } uint32_t functionalWrite(Packet *pkt); + void resetStats(); private: int m_num_vcs; diff --git a/src/mem/ruby/network/garnet2.0/NetworkLink.cc b/src/mem/ruby/network/garnet2.0/NetworkLink.cc index 6010071f0..e718fb867 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkLink.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkLink.cc @@ -75,6 +75,16 @@ NetworkLink::wakeup() } } +void +NetworkLink::resetStats() +{ + for (int i = 0; i < m_vc_load.size(); i++) { + m_vc_load[i] = 0; + } + + m_link_utilized = 0; +} + NetworkLink * NetworkLinkParams::create() { diff --git a/src/mem/ruby/network/garnet2.0/NetworkLink.hh b/src/mem/ruby/network/garnet2.0/NetworkLink.hh index cb69b39ad..10399ec37 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkLink.hh +++ b/src/mem/ruby/network/garnet2.0/NetworkLink.hh @@ -70,6 +70,7 @@ class NetworkLink : public ClockedObject, public Consumer inline flit* consumeLink() { return linkBuffer->getTopFlit(); } uint32_t functionalWrite(Packet *); + void resetStats(); private: const int m_id; diff --git a/src/mem/ruby/network/garnet2.0/Router.cc b/src/mem/ruby/network/garnet2.0/Router.cc index 65a730096..7266f998a 100644 --- a/src/mem/ruby/network/garnet2.0/Router.cc +++ b/src/mem/ruby/network/garnet2.0/Router.cc @@ -241,6 +241,9 @@ Router::resetStats() m_input_unit[i]->resetStats(); } } + + m_switch->resetStats(); + m_sw_alloc->resetStats(); } void diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 4619b0b8a..836f071fe 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -387,3 +387,10 @@ SwitchAllocator::clear_request_vector() } } } + +void +SwitchAllocator::resetStats() +{ + m_input_arbiter_activity = 0; + m_output_arbiter_activity = 0; +}
\ No newline at end of file diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.hh b/src/mem/ruby/network/garnet2.0/SwitchAllocator.hh index 162264e85..7515b734f 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.hh +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.hh @@ -70,6 +70,8 @@ class SwitchAllocator : public Consumer return m_output_arbiter_activity; } + void resetStats(); + private: int m_num_inports, m_num_outports; int m_num_vcs, m_vc_per_vnet; |