forked from M-Labs/artiq
1
0
Fork 0

update NAC3, use power operator

This commit is contained in:
Sebastien Bourdeauducq 2022-01-09 11:45:10 +08:00
parent 4ad8f5d6c7
commit 02555e48a0
2 changed files with 6 additions and 8 deletions

View File

@ -482,16 +482,14 @@ class TTLClockGen:
"""Returns the frequency tuning word corresponding to the given """Returns the frequency tuning word corresponding to the given
frequency. frequency.
""" """
# NAC3TODO return round64(2**self.acc_width*frequency*self.core.coarse_ref_period) return round(2.**float(self.acc_width)*frequency*self.core.coarse_ref_period)
return 0
@portable @portable
def ftw_to_frequency(self, ftw: int32) -> float: def ftw_to_frequency(self, ftw: int32) -> float:
"""Returns the frequency corresponding to the given frequency tuning """Returns the frequency corresponding to the given frequency tuning
word. word.
""" """
# NAC3TODO return float(ftw)/self.core.coarse_ref_period/2**int64(self.acc_width) return float(ftw)/self.core.coarse_ref_period/2.**float(self.acc_width)
return 0.0
@kernel @kernel
def set_mu(self, frequency: int32): def set_mu(self, frequency: int32):

View File

@ -80,11 +80,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1641304829, "lastModified": 1641699066,
"narHash": "sha256-bXD7l+MMCgUzHPGybsF3poDLU5B8QLpbmuXecIOtMbk=", "narHash": "sha256-tjcdd8h9Jy1JzZKPjCVGYJtC4sXLmteMrpVeXs0Cff4=",
"ref": "master", "ref": "master",
"rev": "52ccf31bb17f804f2700eb88de4ddc61e9a38476", "rev": "8ef9e74aaf0e548d4b636a1d1c1cb208b26b04c1",
"revCount": 536, "revCount": 544,
"type": "git", "type": "git",
"url": "https://git.m-labs.hk/M-Labs/nac3.git" "url": "https://git.m-labs.hk/M-Labs/nac3.git"
}, },