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:
parent
21f8242430
commit
c0c3316e31
1 changed files with 5 additions and 0 deletions
|
@ -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())); }
|
||||
|
||||
|
|
Loading…
Reference in a new issue