mirror of https://github.com/m-labs/artiq.git
coredevice/dds: use explicit 64-bit ints for ftw computations
This commit is contained in:
parent
1b9713115c
commit
a9cf89215b
|
@ -87,14 +87,14 @@ class _DDSGeneric:
|
||||||
"""Returns the frequency tuning word corresponding to the given
|
"""Returns the frequency tuning word corresponding to the given
|
||||||
frequency.
|
frequency.
|
||||||
"""
|
"""
|
||||||
return round(2**32*frequency/self.sysclk)
|
return round(int(2, width=64)**32*frequency/self.sysclk)
|
||||||
|
|
||||||
@portable
|
@portable
|
||||||
def ftw_to_frequency(self, ftw):
|
def ftw_to_frequency(self, ftw):
|
||||||
"""Returns the frequency corresponding to the given frequency tuning
|
"""Returns the frequency corresponding to the given frequency tuning
|
||||||
word.
|
word.
|
||||||
"""
|
"""
|
||||||
return ftw*self.sysclk/2**32
|
return ftw*self.sysclk/int(2, width=64)**32
|
||||||
|
|
||||||
@portable
|
@portable
|
||||||
def turns_to_pow(self, turns):
|
def turns_to_pow(self, turns):
|
||||||
|
|
Loading…
Reference in New Issue