summaryrefslogtreecommitdiff
path: root/src/sim/dvfs_handler.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/dvfs_handler.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/dvfs_handler.hh')
-rw-r--r--src/sim/dvfs_handler.hh33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/sim/dvfs_handler.hh b/src/sim/dvfs_handler.hh
index c8d962133..3ff08115a 100644
--- a/src/sim/dvfs_handler.hh
+++ b/src/sim/dvfs_handler.hh
@@ -52,13 +52,14 @@
#include <vector>
+#include "debug/DVFS.hh"
#include "params/ClockDomain.hh"
#include "params/DVFSHandler.hh"
#include "params/VoltageDomain.hh"
#include "sim/clock_domain.hh"
#include "sim/eventq.hh"
#include "sim/sim_object.hh"
-
+#include "sim/voltage_domain.hh"
/**
* DVFS Handler class, maintains a list of all the domains it can handle.
@@ -80,6 +81,18 @@ class DVFSHandler : public SimObject
typedef SrcClockDomain::PerfLevel PerfLevel;
/**
+ * Get the number of domains assigned to this DVFS handler.
+ * @return Number of domains
+ */
+ uint32_t numDomains() const { return domainIDList.size(); }
+
+ /**
+ * Get the n-th domain ID, from the domains managed by this handler.
+ * @return Domain ID
+ */
+ DomainID domainID(uint32_t index) const;
+
+ /**
* Check whether a domain ID is known to the handler or not.
* @param domain_id Domain ID to check
* @return Domain ID known to handler?
@@ -128,6 +141,19 @@ class DVFSHandler : public SimObject
}
/**
+ * Read the voltage of the specified domain at the specified
+ * performance level.
+ * @param domain_id Domain ID to query
+ * @param perf_level Performance level of interest
+ * @return Voltage for the requested performance level of the respective
+ * domain
+ */
+ double voltageAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
+ {
+ return findDomain(domain_id)->voltageDomain()->voltage(perf_level);
+ }
+
+ /**
* Get the total number of available performance levels.
*
* @param domain_id Domain ID to query
@@ -154,6 +180,11 @@ class DVFSHandler : public SimObject
Domains domains;
/**
+ * List of IDs avaiable in the domain list
+ */
+ std::vector<DomainID> domainIDList;
+
+ /**
* Clock domain of the system the handler is instantiated.
*/
SrcClockDomain* sysClkDomain;