summaryrefslogtreecommitdiff
path: root/src/sim/clock_domain.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-01-24 15:29:30 -0600
committerAndreas Hansson <andreas.hansson@arm.com>2014-01-24 15:29:30 -0600
commit1d85e914a6b7a9b3550e84d2006ba775a27a0a44 (patch)
tree58e79831e0974042388f8223a46508192fe45ec9 /src/sim/clock_domain.cc
parentca89eba79ebe0adc9cea7656c288e0381754171a (diff)
downloadgem5-1d85e914a6b7a9b3550e84d2006ba775a27a0a44.tar.xz
sim: Expose the current clock period as a stat
This patch adds observability to the clock period of the clock domains by including it as a stat. As a result of adding this, the regressions will be updated in a separate patch.
Diffstat (limited to 'src/sim/clock_domain.cc')
-rw-r--r--src/sim/clock_domain.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sim/clock_domain.cc b/src/sim/clock_domain.cc
index ff96f2808..0d1836e83 100644
--- a/src/sim/clock_domain.cc
+++ b/src/sim/clock_domain.cc
@@ -49,6 +49,20 @@
#include "sim/voltage_domain.hh"
#include "sim/clocked_object.hh"
+void
+ClockDomain::regStats()
+{
+ using namespace Stats;
+
+ // Expose the current clock period as a stat for observability in
+ // the dumps
+ currentClock
+ .scalar(_clockPeriod)
+ .name(params()->name + ".clock")
+ .desc("Clock period in ticks")
+ ;
+}
+
double
ClockDomain::voltage() const
{