forked from M-Labs/artiq
1
0
Fork 0

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
1 changed files with 2 additions and 2 deletions

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):