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:
@@ -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())); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user