diff options
author | Stephan Diestelhorst <stephan.diestelhorst@arm.com> | 2014-06-16 14:59:44 +0100 |
---|---|---|
committer | Stephan Diestelhorst <stephan.diestelhorst@arm.com> | 2014-06-16 14:59:44 +0100 |
commit | 4422d1322a8ed47bc9d743894ad47d82f33eba7c (patch) | |
tree | 54aa0efe2365af7d41d41e78cba3dae9434f13ee /src/sim/voltage_domain.cc | |
parent | bf238470726b4cc5c0b34fcb349d767726fe53bc (diff) | |
download | gem5-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.cc')
-rw-r--r-- | src/sim/voltage_domain.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sim/voltage_domain.cc b/src/sim/voltage_domain.cc index b5673feda..2b16d04b9 100644 --- a/src/sim/voltage_domain.cc +++ b/src/sim/voltage_domain.cc @@ -54,9 +54,9 @@ VoltageDomain::VoltageDomain(const Params *p) // Voltages must be sorted in descending order. fatal_if(!std::is_sorted(voltageOpPoints.begin(), voltageOpPoints.end(), - std::greater_equal<Voltages::value_type>()), "DVFS: Voltage "\ - "operation points not in descending order for voltage domain "\ - "%s\n", name()); + std::greater<Voltages::value_type>()), "DVFS: Voltage operation "\ + "points not in descending order for voltage domain %s\n", + name()); } void @@ -66,6 +66,11 @@ VoltageDomain::perfLevel(PerfLevel perf_level) "DVFS: Requested voltage ID %d is outside the known "\ "range for domain %s.\n", perf_level, name()); + if (perf_level == _perfLevel) { + // Silently ignore identical overwrites + return; + } + _perfLevel = perf_level; DPRINTF(VoltageDomain, "Setting voltage to %.3fV idx: %d for domain %s\n", |