summaryrefslogtreecommitdiff
path: root/src/sim/voltage_domain.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-09-23 18:21:20 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-09-26 13:22:55 +0000
commit911c0959351a2c959e9a3a63a14af0599e637460 (patch)
tree0b116ddb32da99fee26105d82042af9dbe0e5e74 /src/sim/voltage_domain.cc
parent7e52bf014adefe6be8ea0da53192bf77f6131c9b (diff)
downloadgem5-911c0959351a2c959e9a3a63a14af0599e637460.tar.xz
sim: Convert power modelling framework to new-style stats
Change-Id: I1dd3ea3d37bb4464637222aa5bc5d88cc7d9b66a Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21143 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Diffstat (limited to 'src/sim/voltage_domain.cc')
-rw-r--r--src/sim/voltage_domain.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/sim/voltage_domain.cc b/src/sim/voltage_domain.cc
index 6f32dc7c0..ca86478f1 100644
--- a/src/sim/voltage_domain.cc
+++ b/src/sim/voltage_domain.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2014 ARM Limited
+ * Copyright (c) 2012-2014, 2019 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -49,7 +49,7 @@
#include "sim/sim_object.hh"
VoltageDomain::VoltageDomain(const Params *p)
- : SimObject(p), voltageOpPoints(p->voltage), _perfLevel(0)
+ : SimObject(p), voltageOpPoints(p->voltage), _perfLevel(0), stats(*this)
{
fatal_if(voltageOpPoints.empty(), "DVFS: Empty set of voltages for "\
"voltage domain %s\n", name());
@@ -127,18 +127,6 @@ VoltageDomain::startup() {
}
}
-void
-VoltageDomain::regStats()
-{
- SimObject::regStats();
-
- currentVoltage
- .method(this, &VoltageDomain::voltage)
- .name(params()->name + ".voltage")
- .desc("Voltage in Volts")
- ;
-}
-
VoltageDomain *
VoltageDomainParams::create()
{
@@ -157,3 +145,10 @@ VoltageDomain::unserialize(CheckpointIn &cp)
UNSERIALIZE_SCALAR(_perfLevel);
perfLevel(_perfLevel);
}
+
+VoltageDomain::VoltageDomainStats::VoltageDomainStats(VoltageDomain &vd)
+ : Stats::Group(&vd),
+ ADD_STAT(voltage, "Voltage in Volts")
+{
+ voltage.method(&vd, &VoltageDomain::voltage);
+}