diff options
author | David Guillen Fandos <david.guillen@arm.com> | 2015-06-17 16:49:40 +0100 |
---|---|---|
committer | David Guillen Fandos <david.guillen@arm.com> | 2015-06-17 16:49:40 +0100 |
commit | c0c3316e31436e83e960c0b0e5652da6983ed17c (patch) | |
tree | 11c5cdde0d78bfcefd9b23aee548e865ff743e9d /src/sim | |
parent | 21f8242430c7a1935a892aac1c26b970b306b113 (diff) | |
download | gem5-c0c3316e31436e83e960c0b0e5652da6983ed17c.tar.xz |
sim: Add voltage() function to clocked_object
Adding voltage function which returns the current voltage
for a given clocked object. It's handy for power models and
similar stuff that need to retrieve voltage. Function
frequency() is already there, so I see no reason for not having
this one too.
Diffstat (limited to 'src/sim')
-rw-r--r-- | src/sim/clocked_object.hh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sim/clocked_object.hh b/src/sim/clocked_object.hh index 5a6e9a6c3..b9a2481ec 100644 --- a/src/sim/clocked_object.hh +++ b/src/sim/clocked_object.hh @@ -212,6 +212,11 @@ class Clocked return clockDomain.clockPeriod(); } + inline double voltage() const + { + return clockDomain.voltage(); + } + inline Cycles ticksToCycles(Tick t) const { return Cycles(divCeil(t, clockPeriod())); } |