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.
This commit is contained in:
David Guillen Fandos 2015-06-17 16:49:40 +01:00
parent 21f8242430
commit c0c3316e31

View file

@ -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())); }