Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 354a62f5d064
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 33648277448d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 4, 2016

  1. Copy the full SHA
    4352d15 View commit details
  2. Copy the full SHA
    3364827 View commit details
Showing with 9 additions and 3 deletions.
  1. +7 −1 artiq/coredevice/core.py
  2. +2 −2 artiq/coredevice/ttl.py
8 changes: 7 additions & 1 deletion artiq/coredevice/core.py
Original file line number Diff line number Diff line change
@@ -60,11 +60,17 @@ class Core:
The time machine unit is equal to this period.
:param external_clock: whether the core device should switch to its
external RTIO clock input instead of using its internal oscillator.
:param ref_multiplier: ratio between the RTIO fine timestamp frequency
and the RTIO coarse timestamp frequency (e.g. SERDES multiplication
factor).
:param comm_device: name of the device used for communications.
"""
def __init__(self, dmgr, ref_period, external_clock=False, comm_device="comm"):
def __init__(self, dmgr, ref_period, external_clock=False,
ref_multiplier=8, comm_device="comm"):
self.ref_period = ref_period
self.external_clock = external_clock
self.ref_multiplier = ref_multiplier
self.coarse_ref_period = ref_period*ref_multiplier
self.comm = dmgr.get(comm_device)

self.first_run = True
4 changes: 2 additions & 2 deletions artiq/coredevice/ttl.py
Original file line number Diff line number Diff line change
@@ -245,14 +245,14 @@ def frequency_to_ftw(self, frequency):
"""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):