Calculate the frequency in
Hz, given the period in
ps
I.e., to calculate the clock frequency of a clock with a period of
5000 ps:
>>> periodToHz 5000
2.0e8
Note that if
p in
periodToHz (fromIntegral p)
is negative,
fromIntegral will give an
Underflow
:: ArithException without a call stack, making debugging
cumbersome.
Before Clash 1.8, this function always returned a
Ratio
Natural. To get the old behavior of this function, use a type
application:
>>> periodToHz @(Ratio Natural) 5000
200000000 % 1
NB: This function is not synthesizable