From c0c3316e31436e83e960c0b0e5652da6983ed17c Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Wed, 17 Jun 2015 16:49:40 +0100 Subject: 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. --- src/sim/clocked_object.hh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sim/clocked_object.hh') 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())); } -- cgit v1.2.3