2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-29 05:03:34 +08:00

ttl/TTLClockGen: fix FTW computation with ref_multiplier != 1

This commit is contained in:
Sebastien Bourdeauducq 2016-03-04 16:59:59 +08:00
parent 4352d15016
commit 3364827744

View File

@ -245,14 +245,14 @@ class TTLClockGen:
"""Returns the frequency tuning word corresponding to the given
frequency.
"""
return round(2**self.acc_width*frequency*self.core.ref_period)
return round(2**self.acc_width*frequency*self.core.coarse_ref_period)
@portable
def ftw_to_frequency(self, ftw):
"""Returns the frequency corresponding to the given frequency tuning
word.
"""
return ftw/self.core.ref_period/2**self.acc_width
return ftw/self.core.coarse_ref_period/2**self.acc_width
@kernel
def set_mu(self, frequency):