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/clock_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/clock_domain.cc')
-rw-r--r-- | src/sim/clock_domain.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sim/clock_domain.cc b/src/sim/clock_domain.cc index 746ef12fd..8f45bba09 100644 --- a/src/sim/clock_domain.cc +++ b/src/sim/clock_domain.cc @@ -136,6 +136,11 @@ SrcClockDomain::perfLevel(PerfLevel perf_level) { assert(validPerfLevel(perf_level)); + if (perf_level == _perfLevel) { + // Silently ignore identical overwrites + return; + } + DPRINTF(ClockDomain, "DVFS: Switching performance level of domain %s "\ "(id: %d) from %d to %d\n", name(), domainID(), _perfLevel, perf_level); @@ -162,6 +167,13 @@ SrcClockDomain::unserialize(Checkpoint *cp, const std::string §ion) { ClockDomain::unserialize(cp, section); UNSERIALIZE_SCALAR(_perfLevel); +} + +void +SrcClockDomain::startup() +{ + // Perform proper clock update when all related components have been + // created (i.e. after unserialization / object creation) perfLevel(_perfLevel); } |