From: David Guillen Fandos Date: Wed, 17 Jun 2015 15:49:40 +0000 (+0100) Subject: sim: Add voltage() function to clocked_object X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0c3316e31436e83e960c0b0e5652da6983ed17c;p=gem5.git 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. --- 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())); }