summaryrefslogtreecommitdiff
path: root/src/sim/voltage_domain.hh
diff options
context:
space:
mode:
authorStephan Diestelhorst <stephan.diestelhorst@arm.com>2014-06-16 14:59:44 +0100
committerStephan Diestelhorst <stephan.diestelhorst@arm.com>2014-06-16 14:59:44 +0100
commit4422d1322a8ed47bc9d743894ad47d82f33eba7c (patch)
tree54aa0efe2365af7d41d41e78cba3dae9434f13ee /src/sim/voltage_domain.hh
parentbf238470726b4cc5c0b34fcb349d767726fe53bc (diff)
downloadgem5-4422d1322a8ed47bc9d743894ad47d82f33eba7c.tar.xz
energy: Small extentions and fixes for DVFS handler
These additions allow easier interoperability with and querying from an additional controller which will be in a separate patch. Also adding warnings for changing the enabled state of the handler across checkpoint / resume and deviating from the state in the configuration. Contributed-by: Akash Bagdia <akash.bagdia@arm.com>
Diffstat (limited to 'src/sim/voltage_domain.hh')
-rw-r--r--src/sim/voltage_domain.hh15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/sim/voltage_domain.hh b/src/sim/voltage_domain.hh
index 3904c80c9..9ffbe7bbc 100644
--- a/src/sim/voltage_domain.hh
+++ b/src/sim/voltage_domain.hh
@@ -60,6 +60,8 @@ class VoltageDomain : public SimObject
typedef VoltageDomainParams Params;
VoltageDomain(const Params *p);
+ typedef SrcClockDomain::PerfLevel PerfLevel;
+
/**
* Get the current voltage.
*
@@ -67,9 +69,18 @@ class VoltageDomain : public SimObject
*/
double voltage() const { return voltageOpPoints[_perfLevel]; }
- uint32_t numVoltages() const { return (uint32_t)voltageOpPoints.size(); }
+ /**
+ * Get the voltage at specified performance level.
+ *
+ * @param perf_level Performance level for which the voltage is requested
+ * @return Voltage of the domain at specified performance level
+ */
+ double voltage(PerfLevel perf_level) const
+ {
+ return voltageOpPoints[perf_level];
+ }
- typedef SrcClockDomain::PerfLevel PerfLevel;
+ uint32_t numVoltages() const { return (uint32_t)voltageOpPoints.size(); }
/**
* Set the voltage point of the domain.