mirror of
https://github.com/m-labs/artiq.git
synced 2025-02-03 06:10:18 +08:00
Update waveform test. Adjust doc-string in driver.
This commit is contained in:
parent
3f86d0f5ab
commit
128b4be8ec
@ -437,18 +437,20 @@ class AD9910:
|
|||||||
This method does not pulse ``IO_UPDATE``.
|
This method does not pulse ``IO_UPDATE``.
|
||||||
|
|
||||||
:param asf_profile_enable: Enable amplitude scale from single tone profiles.
|
:param asf_profile_enable: Enable amplitude scale from single tone profiles.
|
||||||
:param drg_destination: Digital ramp destination.
|
:param drg_destination: Digital ramp destination. Determines the parameter to modulate:
|
||||||
|
* 0: Frequency
|
||||||
|
* 1: Phase
|
||||||
|
* 2: Amplitude
|
||||||
:param drg_enable: Digital ramp enable.
|
:param drg_enable: Digital ramp enable.
|
||||||
:param drg_nodwell_high: Digital ramp no-dwell high.
|
:param drg_nodwell_high: Digital ramp no-dwell high.
|
||||||
:param drg_nodwell_low: Digital ramp no-dwell low.
|
:param drg_nodwell_low: Digital ramp no-dwell low.
|
||||||
:param effective_ftw: Read effective FTW.
|
:param effective_ftw: Read effective FTW.
|
||||||
:param sync_validation_disable: Disable the SYNC_SMP_ERR pin indicating
|
:param sync_validation_disable: Disable the SYNC_SMP_ERR pin indicating
|
||||||
(active high) detection of a synchronization pulse sampling error.
|
(active high) detection of a synchronization pulse sampling error.
|
||||||
:param matched_latency_enable: Simultaneous application of amplitude,
|
:param matched_latency_enable: Control the application timing of amplitude,
|
||||||
phase, and frequency changes to the DDS arrive at the output
|
phase, and frequency changes at the DDS output:
|
||||||
|
* 0: Changes are applied in the order listed.
|
||||||
* matched_latency_enable = 0: in the order listed
|
* 1: Changes are applied simultaneously.
|
||||||
* matched_latency_enable = 1: simultaneously.
|
|
||||||
"""
|
"""
|
||||||
self.write32(_AD9910_REG_CFR2,
|
self.write32(_AD9910_REG_CFR2,
|
||||||
(asf_profile_enable << 24) |
|
(asf_profile_enable << 24) |
|
||||||
|
@ -11,39 +11,56 @@ from artiq.coredevice.urukul import STA_PROTO_REV_8, STA_PROTO_REV_9
|
|||||||
from artiq.experiment import *
|
from artiq.experiment import *
|
||||||
from artiq.test.hardware_testbench import ExperimentCase
|
from artiq.test.hardware_testbench import ExperimentCase
|
||||||
|
|
||||||
###############################################################################
|
###################################################################################
|
||||||
## NOTE: These test are intended to create waveforms from AD9910 Urukul boards
|
## NOTE: These test are intended to create waveforms from AD9910 Urukul boards
|
||||||
## (all protocol revisions, see tests below) used with an oscilloscope.
|
## (all protocol revisions, see tests below) used with a dual-channel oscilloscope.
|
||||||
|
##
|
||||||
## Set your oscilloscope to:
|
## Set your oscilloscope to:
|
||||||
##
|
##
|
||||||
## Time division: 2 ns
|
## Time division: 2 ns
|
||||||
## Voltage division: 500 mV
|
## Voltage division: 500 mV
|
||||||
##
|
##
|
||||||
## These settings work with a nominal 100 MHz waveform.
|
## The settings below work with a nominal 100 MHz waveform. Set trigger to DDS1.
|
||||||
## You will need to play with your trigger level setting for some of the tests.
|
## You will need to play with your trigger level setting for some of the tests.
|
||||||
##
|
##
|
||||||
## If you change FREQ (see below) to something else, adjust your oscilloscope
|
## If you change FREQ (see below) to something else, adjust your oscilloscope
|
||||||
## settings to accomodate.
|
## settings to accomodate.
|
||||||
###############################################################################
|
###################################################################################
|
||||||
|
|
||||||
FREQ = 100 * MHz
|
FREQ = 100 * MHz
|
||||||
AMP = 1.0
|
AMP = 1.0
|
||||||
ATT = 1.0
|
ATT = 1.0
|
||||||
|
|
||||||
# Set to desired devices
|
# Set to desired devices
|
||||||
CPLD = "urukul0_cpld"
|
CPLD = "urukul1_cpld"
|
||||||
DDS1 = "urukul0_ch0"
|
DDS1 = "urukul1_ch0"
|
||||||
DDS2 = "urukul0_ch3"
|
DDS2 = "urukul1_ch3"
|
||||||
|
|
||||||
|
|
||||||
class AD9910WaveformExp(EnvExperiment):
|
class AD9910WaveformExp(EnvExperiment):
|
||||||
def build(self, runner, io_update_device=True):
|
def build(
|
||||||
|
self,
|
||||||
|
runner,
|
||||||
|
io_update_device=True,
|
||||||
|
multiple_profiles=True,
|
||||||
|
osk_manual=True,
|
||||||
|
drg_destination=0x0,
|
||||||
|
use_dds2=False,
|
||||||
|
with_hold=False,
|
||||||
|
nodwell=0,
|
||||||
|
):
|
||||||
self.setattr_device("core")
|
self.setattr_device("core")
|
||||||
self.cpld = self.get_device(CPLD)
|
self.cpld = self.get_device(CPLD)
|
||||||
self.dds1 = self.get_device(DDS1)
|
self.dds1 = self.get_device(DDS1)
|
||||||
self.dds2 = self.get_device(DDS2)
|
self.dds2 = self.get_device(DDS2)
|
||||||
self.runner = runner
|
self.runner = runner
|
||||||
self.io_update_device = io_update_device
|
self.io_update_device = io_update_device
|
||||||
|
self.multiple_profiles = multiple_profiles
|
||||||
|
self.osk_manual = osk_manual
|
||||||
|
self.drg_destination = drg_destination
|
||||||
|
self.use_dds2 = use_dds2
|
||||||
|
self.with_hold = with_hold
|
||||||
|
self.nodwell = nodwell
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
getattr(self, self.runner)()
|
getattr(self, self.runner)()
|
||||||
@ -106,81 +123,6 @@ class AD9910WaveformExp(EnvExperiment):
|
|||||||
|
|
||||||
self.core.wait_until_mu(now_mu())
|
self.core.wait_until_mu(now_mu())
|
||||||
|
|
||||||
@kernel
|
|
||||||
def toggle_profile(self):
|
|
||||||
self.core.reset()
|
|
||||||
self.cpld.init()
|
|
||||||
|
|
||||||
if not self.io_update_device:
|
|
||||||
# Set MASK_NU to trigger CFG.IO_UPDATE
|
|
||||||
self.dds1.cfg_mask_nu(True)
|
|
||||||
self.dds2.cfg_mask_nu(True)
|
|
||||||
|
|
||||||
self.dds1.init()
|
|
||||||
self.dds2.init()
|
|
||||||
|
|
||||||
delay(10 * ms)
|
|
||||||
|
|
||||||
## SET SINGLE-TONE PROFILES
|
|
||||||
# Set Profile 7 (default)
|
|
||||||
self.dds1.set(FREQ, amplitude=AMP)
|
|
||||||
self.dds2.set(FREQ, amplitude=AMP)
|
|
||||||
# Set Profile 6 (default)
|
|
||||||
self.dds1.set(FREQ + 25 * MHz, amplitude=AMP, profile=6)
|
|
||||||
self.dds2.set(FREQ + 25 * MHz, amplitude=AMP, profile=6)
|
|
||||||
# Set Profile 5 (default)
|
|
||||||
self.dds1.set(FREQ + 50 * MHz, amplitude=AMP, profile=5)
|
|
||||||
self.dds2.set(FREQ + 50 * MHz, amplitude=AMP, profile=5)
|
|
||||||
# Set Profile 4 (default)
|
|
||||||
self.dds1.set(FREQ + 75 * MHz, amplitude=AMP, profile=4)
|
|
||||||
self.dds2.set(FREQ + 75 * MHz, amplitude=AMP, profile=4)
|
|
||||||
|
|
||||||
delay(1 * s) # slack
|
|
||||||
|
|
||||||
# Set Profile 3 (default)
|
|
||||||
self.dds1.set(FREQ + FREQ, amplitude=AMP, profile=3)
|
|
||||||
self.dds2.set(FREQ + FREQ, amplitude=AMP, profile=3)
|
|
||||||
# Set Profile 2 (default)
|
|
||||||
self.dds1.set(FREQ + 125 * MHz, amplitude=AMP, profile=2)
|
|
||||||
self.dds2.set(FREQ + 125 * MHz, amplitude=AMP, profile=2)
|
|
||||||
# Set Profile 1 (default)
|
|
||||||
self.dds1.set(FREQ + 150 * MHz, amplitude=AMP, profile=1)
|
|
||||||
self.dds2.set(FREQ + 150 * MHz, amplitude=AMP, profile=1)
|
|
||||||
# Set Profile 0 (default)
|
|
||||||
self.dds1.set(FREQ + 175 * MHz, amplitude=AMP, profile=0)
|
|
||||||
self.dds2.set(FREQ + 175 * MHz, amplitude=AMP, profile=0)
|
|
||||||
|
|
||||||
# Switch on waveforms -- Profile 7 (default)
|
|
||||||
self.dds1.cfg_sw(True)
|
|
||||||
self.dds2.cfg_sw(True)
|
|
||||||
self.dds1.set_att(ATT)
|
|
||||||
self.dds2.set_att(ATT)
|
|
||||||
delay(2 * s)
|
|
||||||
# Switch off waveforms
|
|
||||||
self.dds1.cfg_sw(False)
|
|
||||||
self.dds2.cfg_sw(False)
|
|
||||||
|
|
||||||
# Iterate over Profiles 6 to 0
|
|
||||||
for i in range(6, -1, -1):
|
|
||||||
# Switch channels 0 and 3 to Profile i
|
|
||||||
self.cpld.set_profile(0, i)
|
|
||||||
# This is the main different between proto_rev's,
|
|
||||||
# one sets them all
|
|
||||||
# self.cpld.set_profile(3, i)
|
|
||||||
self.dds1.cfg_sw(True)
|
|
||||||
self.dds2.cfg_sw(True)
|
|
||||||
delay(2 * s)
|
|
||||||
# Switch off waveforms
|
|
||||||
self.dds1.cfg_sw(False)
|
|
||||||
self.dds2.cfg_sw(False)
|
|
||||||
|
|
||||||
if not self.io_update_device:
|
|
||||||
# Unset MASK_NU to un-trigger CFG.IO_UPDATE
|
|
||||||
self.dds1.cfg_mask_nu(False)
|
|
||||||
self.dds2.cfg_mask_nu(False)
|
|
||||||
|
|
||||||
self.core.wait_until_mu(now_mu())
|
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
def toggle_profiles(self):
|
def toggle_profiles(self):
|
||||||
self.core.reset()
|
self.core.reset()
|
||||||
@ -199,33 +141,23 @@ class AD9910WaveformExp(EnvExperiment):
|
|||||||
delay(10 * ms)
|
delay(10 * ms)
|
||||||
|
|
||||||
## SET SINGLE-TONE PROFILES
|
## SET SINGLE-TONE PROFILES
|
||||||
# Set Profile 7 (default)
|
# Set profiles from 7 to 0
|
||||||
self.dds1.set(FREQ, amplitude=AMP)
|
frequencies = [
|
||||||
self.dds2.set(FREQ, amplitude=AMP)
|
0.0,
|
||||||
# Set Profile 6 (default)
|
25 * MHz,
|
||||||
self.dds1.set(FREQ + 25 * MHz, amplitude=AMP, profile=6)
|
50 * MHz,
|
||||||
self.dds2.set(FREQ + 25 * MHz, amplitude=AMP, profile=6)
|
75 * MHz,
|
||||||
# Set Profile 5 (default)
|
100 * MHz,
|
||||||
self.dds1.set(FREQ + 50 * MHz, amplitude=AMP, profile=5)
|
125 * MHz,
|
||||||
self.dds2.set(FREQ + 50 * MHz, amplitude=AMP, profile=5)
|
150 * MHz,
|
||||||
# Set Profile 4 (default)
|
175 * MHz,
|
||||||
self.dds1.set(FREQ + 75 * MHz, amplitude=AMP, profile=4)
|
]
|
||||||
self.dds2.set(FREQ + 75 * MHz, amplitude=AMP, profile=4)
|
for i in range(6, -1, -1):
|
||||||
|
freq_offset = frequencies[i]
|
||||||
delay(1 * s) # slack
|
profile = 7 - i
|
||||||
|
self.dds1.set(FREQ + freq_offset, amplitude=AMP, profile=profile)
|
||||||
# Set Profile 3 (default)
|
self.dds2.set(FREQ + freq_offset, amplitude=AMP, profile=profile)
|
||||||
self.dds1.set(FREQ + FREQ, amplitude=AMP, profile=3)
|
delay(0.5 * s) # slack
|
||||||
self.dds2.set(FREQ + FREQ, amplitude=AMP, profile=3)
|
|
||||||
# Set Profile 2 (default)
|
|
||||||
self.dds1.set(FREQ + 125 * MHz, amplitude=AMP, profile=2)
|
|
||||||
self.dds2.set(FREQ + 125 * MHz, amplitude=AMP, profile=2)
|
|
||||||
# Set Profile 1 (default)
|
|
||||||
self.dds1.set(FREQ + 150 * MHz, amplitude=AMP, profile=1)
|
|
||||||
self.dds2.set(FREQ + 150 * MHz, amplitude=AMP, profile=1)
|
|
||||||
# Set Profile 0 (default)
|
|
||||||
self.dds1.set(FREQ + 175 * MHz, amplitude=AMP, profile=0)
|
|
||||||
self.dds2.set(FREQ + 175 * MHz, amplitude=AMP, profile=0)
|
|
||||||
|
|
||||||
# Switch on waveforms -- Profile 7 (default)
|
# Switch on waveforms -- Profile 7 (default)
|
||||||
self.dds1.cfg_sw(True)
|
self.dds1.cfg_sw(True)
|
||||||
@ -239,9 +171,11 @@ class AD9910WaveformExp(EnvExperiment):
|
|||||||
|
|
||||||
# Iterate over Profiles 6 to 0
|
# Iterate over Profiles 6 to 0
|
||||||
for i in range(6, -1, -1):
|
for i in range(6, -1, -1):
|
||||||
# Switch channels 0 and 3 to Profile i
|
# Switch channels to Profile i
|
||||||
self.cpld.set_profile(0, i)
|
self.cpld.set_profile(0, i)
|
||||||
|
if self.multiple_profiles:
|
||||||
self.cpld.set_profile(3, i)
|
self.cpld.set_profile(3, i)
|
||||||
|
|
||||||
self.dds1.cfg_sw(True)
|
self.dds1.cfg_sw(True)
|
||||||
self.dds2.cfg_sw(True)
|
self.dds2.cfg_sw(True)
|
||||||
delay(2 * s)
|
delay(2 * s)
|
||||||
@ -275,9 +209,13 @@ class AD9910WaveformExp(EnvExperiment):
|
|||||||
delay(10 * ms)
|
delay(10 * ms)
|
||||||
|
|
||||||
self.dds1.set(FREQ, amplitude=AMP)
|
self.dds1.set(FREQ, amplitude=AMP)
|
||||||
|
|
||||||
|
if self.osk_manual:
|
||||||
self.dds1.set_cfr1(manual_osk_external=1, osk_enable=1)
|
self.dds1.set_cfr1(manual_osk_external=1, osk_enable=1)
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
else:
|
||||||
self.dds1.set_asf(0x3FFF)
|
self.dds1.write32(_AD9910_REG_ASF, 0xFFFF << 16 | 0x3FFF << 2 | 0b11)
|
||||||
|
self.dds1.set_cfr1(osk_enable=1, select_auto_osk=1)
|
||||||
|
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
self.dds1.cpld.io_update.pulse(1 * ms)
|
||||||
|
|
||||||
# Switch on waveform, then set attenuation
|
# Switch on waveform, then set attenuation
|
||||||
@ -302,197 +240,109 @@ class AD9910WaveformExp(EnvExperiment):
|
|||||||
self.core.wait_until_mu(now_mu())
|
self.core.wait_until_mu(now_mu())
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
def osk_auto(self):
|
def drg(self):
|
||||||
self.core.reset()
|
self.core.reset()
|
||||||
self.cpld.init()
|
self.cpld.init()
|
||||||
|
|
||||||
# Set ATT_EN
|
# Set ATT_EN
|
||||||
self.dds1.cfg_att_en(True)
|
self.dds1.cfg_att_en(True)
|
||||||
|
if self.use_dds2:
|
||||||
|
self.dds2.cfg_att_en(True)
|
||||||
|
|
||||||
if not self.io_update_device:
|
if not self.io_update_device:
|
||||||
# Set MASK_NU to trigger CFG.IO_UPDATE
|
# Set MASK_NU to trigger CFG.IO_UPDATE
|
||||||
self.dds1.cfg_mask_nu(True)
|
self.dds1.cfg_mask_nu(True)
|
||||||
|
if self.use_dds2:
|
||||||
|
self.dds2.cfg_mask_nu(True)
|
||||||
|
|
||||||
self.dds1.init()
|
self.dds1.init()
|
||||||
|
if self.use_dds2:
|
||||||
|
self.dds2.init()
|
||||||
|
|
||||||
delay(10 * ms)
|
delay(10 * ms)
|
||||||
|
|
||||||
|
# Set initial frequency and amplitude
|
||||||
self.dds1.set(FREQ, amplitude=AMP)
|
self.dds1.set(FREQ, amplitude=AMP)
|
||||||
self.dds1.set_cfr1(osk_enable=1, select_auto_osk=1)
|
if self.use_dds2:
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
self.dds2.set(FREQ, amplitude=AMP)
|
||||||
self.dds1.write32(_AD9910_REG_ASF, 0xFFFF << 16 | 0x3FFF << 2 | 0b11)
|
|
||||||
|
# Configure DRG
|
||||||
|
if self.drg_destination == 0x0: # Frequency
|
||||||
|
ramp_limit_high = self.dds1.frequency_to_ftw(FREQ + 30 * MHz)
|
||||||
|
ramp_limit_low = self.dds1.frequency_to_ftw(FREQ - 30 * MHz)
|
||||||
|
ramp_rate = 0x004F004F
|
||||||
|
ramp_step = 0xF0
|
||||||
|
pulse_duration = 1 * s if not self.with_hold else 0.25 * s
|
||||||
|
elif self.drg_destination == 0x1: # Phase
|
||||||
|
ramp_limit_high = 0xFFFFFFFF
|
||||||
|
ramp_limit_low = 0
|
||||||
|
ramp_rate = 0xC350C350
|
||||||
|
ramp_step = 0xD1B71
|
||||||
|
pulse_duration = 2 * s if not self.with_hold else 0.25 * s
|
||||||
|
else: # Amplitude
|
||||||
|
ramp_limit_high = 0xFFFFFFFF
|
||||||
|
ramp_limit_low = 0
|
||||||
|
ramp_rate = 0xC350C350
|
||||||
|
ramp_step = 0xD1B71
|
||||||
|
pulse_duration = 2 * s if not self.with_hold else 0.4 * s
|
||||||
|
|
||||||
|
self.dds1.write64(_AD9910_REG_RAMP_LIMIT, ramp_limit_high, ramp_limit_low)
|
||||||
|
self.dds1.write32(_AD9910_REG_RAMP_RATE, ramp_rate)
|
||||||
|
self.dds1.write64(_AD9910_REG_RAMP_STEP, ramp_step, ramp_step)
|
||||||
|
|
||||||
|
self.dds1.set_cfr2(
|
||||||
|
drg_enable=1,
|
||||||
|
drg_destination=self.drg_destination,
|
||||||
|
drg_nodwell_high=self.nodwell,
|
||||||
|
drg_nodwell_low=self.nodwell,
|
||||||
|
)
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
self.dds1.cpld.io_update.pulse(1 * ms)
|
||||||
|
|
||||||
# Switch on waveform, then set attenuation
|
# Enable waveform and set attenuation
|
||||||
self.dds1.cfg_sw(True)
|
self.dds1.cfg_sw(True)
|
||||||
self.dds1.set_att(ATT)
|
self.dds1.set_att(ATT)
|
||||||
|
if self.use_dds2:
|
||||||
|
self.dds2.cfg_sw(True)
|
||||||
|
self.dds2.set_att(ATT)
|
||||||
|
|
||||||
|
if not self.nodwell:
|
||||||
for _ in range(5):
|
for _ in range(5):
|
||||||
self.dds1.cfg_osk(True)
|
if self.with_hold:
|
||||||
delay(1 * s)
|
|
||||||
self.dds1.cfg_osk(False)
|
|
||||||
delay(1 * s)
|
|
||||||
# Switch off waveform
|
|
||||||
self.dds1.cfg_sw(False)
|
|
||||||
|
|
||||||
if not self.io_update_device:
|
|
||||||
# Unset MASK_NU to un-trigger CFG.IO_UPDATE
|
|
||||||
self.dds1.cfg_mask_nu(False)
|
|
||||||
|
|
||||||
# UnSet ATT_EN
|
|
||||||
self.dds1.cfg_att_en(False)
|
|
||||||
|
|
||||||
self.core.wait_until_mu(now_mu())
|
|
||||||
|
|
||||||
@kernel
|
|
||||||
def drg_normal(self):
|
|
||||||
self.core.reset()
|
|
||||||
self.cpld.init()
|
|
||||||
# Set ATT_EN
|
|
||||||
self.dds1.cfg_att_en(True)
|
|
||||||
if not self.io_update_device:
|
|
||||||
# Set MASK_NU to trigger CFG.IO_UPDATE
|
|
||||||
self.dds1.cfg_mask_nu(True)
|
|
||||||
|
|
||||||
self.dds1.init()
|
|
||||||
|
|
||||||
delay(10 * ms)
|
|
||||||
|
|
||||||
self.dds1.frequency_to_ftw(FREQ)
|
|
||||||
# cfr2 21:20 destination, 19 drg enable, no-dwell high, no-dwell low,
|
|
||||||
self.dds1.set(FREQ, amplitude=AMP)
|
|
||||||
self.dds1.set_cfr2(drg_enable=1)
|
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
|
||||||
self.dds1.write64(
|
|
||||||
_AD9910_REG_RAMP_LIMIT,
|
|
||||||
self.dds1.frequency_to_ftw(FREQ + 30 * MHz),
|
|
||||||
self.dds1.frequency_to_ftw(FREQ - 30 * MHz),
|
|
||||||
)
|
|
||||||
# The larger the values, the slower the update happens
|
|
||||||
self.dds1.write32(_AD9910_REG_RAMP_RATE, 0x004F004F)
|
|
||||||
# The smaller the value it is, the smaller the frequency step
|
|
||||||
self.dds1.write64(_AD9910_REG_RAMP_STEP, 0xF0, 0xF0)
|
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
|
||||||
|
|
||||||
# Switch on waveform, then set attenuation
|
|
||||||
self.dds1.cfg_sw(True)
|
|
||||||
self.dds1.set_att(ATT)
|
|
||||||
for _ in range(10):
|
|
||||||
self.dds1.cfg_drctl(True)
|
self.dds1.cfg_drctl(True)
|
||||||
delay(0.5 * s)
|
delay(pulse_duration)
|
||||||
|
self.dds1.cfg_drhold(True)
|
||||||
|
delay(pulse_duration)
|
||||||
|
self.dds1.cfg_drhold(False)
|
||||||
|
delay(pulse_duration)
|
||||||
self.dds1.cfg_drctl(False)
|
self.dds1.cfg_drctl(False)
|
||||||
delay(0.5 * s)
|
delay(pulse_duration)
|
||||||
# Switch off waveform
|
self.dds1.cfg_drhold(True)
|
||||||
self.dds1.cfg_sw(False)
|
delay(pulse_duration)
|
||||||
|
self.dds1.cfg_drhold(False)
|
||||||
if not self.io_update_device:
|
delay(pulse_duration)
|
||||||
# Unset MASK_NU to un-trigger CFG.IO_UPDATE
|
else:
|
||||||
self.dds1.cfg_mask_nu(False)
|
|
||||||
|
|
||||||
# UnSet ATT_EN
|
|
||||||
self.dds1.cfg_att_en(False)
|
|
||||||
|
|
||||||
self.core.wait_until_mu(now_mu())
|
|
||||||
|
|
||||||
@kernel
|
|
||||||
def drg_normal_with_hold(self):
|
|
||||||
self.core.reset()
|
|
||||||
self.cpld.init()
|
|
||||||
# Set ATT_EN
|
|
||||||
self.dds1.cfg_att_en(True)
|
|
||||||
if not self.io_update_device:
|
|
||||||
# Set MASK_NU to trigger CFG.IO_UPDATE
|
|
||||||
self.dds1.cfg_mask_nu(True)
|
|
||||||
|
|
||||||
self.dds1.init()
|
|
||||||
|
|
||||||
delay(10 * ms)
|
|
||||||
|
|
||||||
self.dds1.frequency_to_ftw(FREQ)
|
|
||||||
# cfr2 21:20 destination, 19 drg enable, no-dwell high, no-dwell low,
|
|
||||||
self.dds1.set(FREQ, amplitude=AMP)
|
|
||||||
self.dds1.set_cfr2(drg_enable=1)
|
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
|
||||||
self.dds1.write64(
|
|
||||||
_AD9910_REG_RAMP_LIMIT,
|
|
||||||
self.dds1.frequency_to_ftw(FREQ + 30 * MHz),
|
|
||||||
self.dds1.frequency_to_ftw(FREQ - 30 * MHz),
|
|
||||||
)
|
|
||||||
# The larger the values, the slower the update happens
|
|
||||||
self.dds1.write32(_AD9910_REG_RAMP_RATE, 0x004F004F)
|
|
||||||
# The smaller the value it is, the smaller the frequency step
|
|
||||||
self.dds1.write64(_AD9910_REG_RAMP_STEP, 0xF0, 0xF0)
|
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
|
||||||
|
|
||||||
# Switch on waveform, then set attenuation
|
|
||||||
self.dds1.cfg_sw(True)
|
|
||||||
self.dds1.set_att(ATT)
|
|
||||||
for _ in range(10):
|
|
||||||
self.dds1.cfg_drctl(True)
|
self.dds1.cfg_drctl(True)
|
||||||
delay(0.25 * s)
|
delay(pulse_duration)
|
||||||
self.dds1.cfg_drhold(True)
|
|
||||||
delay(0.25)
|
|
||||||
self.dds1.cfg_drhold(False)
|
|
||||||
delay(0.25)
|
|
||||||
self.dds1.cfg_drctl(False)
|
self.dds1.cfg_drctl(False)
|
||||||
delay(0.25)
|
delay(pulse_duration)
|
||||||
self.dds1.cfg_drhold(True)
|
else:
|
||||||
delay(0.25)
|
|
||||||
self.dds1.cfg_drhold(False)
|
|
||||||
delay(0.25)
|
|
||||||
# Switch off waveform
|
|
||||||
self.dds1.cfg_sw(False)
|
|
||||||
|
|
||||||
if not self.io_update_device:
|
|
||||||
# Unset MASK_NU to un-trigger CFG.IO_UPDATE
|
|
||||||
self.dds1.cfg_mask_nu(False)
|
|
||||||
|
|
||||||
# UnSet ATT_EN
|
|
||||||
self.dds1.cfg_att_en(False)
|
|
||||||
|
|
||||||
self.core.wait_until_mu(now_mu())
|
|
||||||
|
|
||||||
@kernel
|
|
||||||
def drg_nodwell(self):
|
|
||||||
self.core.reset()
|
|
||||||
self.cpld.init()
|
|
||||||
# Set ATT_EN
|
|
||||||
self.dds1.cfg_att_en(True)
|
|
||||||
if not self.io_update_device:
|
|
||||||
# Set MASK_NU to trigger CFG.IO_UPDATE
|
|
||||||
self.dds1.cfg_mask_nu(True)
|
|
||||||
|
|
||||||
self.dds1.init()
|
|
||||||
|
|
||||||
delay(10 * ms)
|
|
||||||
|
|
||||||
self.dds1.frequency_to_ftw(FREQ)
|
|
||||||
# cfr2 21:20 destination, 19 drg enable, no-dwell high, no-dwell low,
|
|
||||||
self.dds1.set(FREQ, amplitude=AMP)
|
|
||||||
self.dds1.set_cfr2(drg_enable=1, drg_nodwell_high=1, drg_nodwell_low=1)
|
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
|
||||||
self.dds1.write64(
|
|
||||||
_AD9910_REG_RAMP_LIMIT,
|
|
||||||
self.dds1.frequency_to_ftw(FREQ + 30 * MHz),
|
|
||||||
self.dds1.frequency_to_ftw(FREQ - 30 * MHz),
|
|
||||||
)
|
|
||||||
# The larger the values, the slower the update happens
|
|
||||||
self.dds1.write32(_AD9910_REG_RAMP_RATE, 0x004F004F)
|
|
||||||
# The smaller the value it is, the smaller the frequency step
|
|
||||||
self.dds1.write64(_AD9910_REG_RAMP_STEP, 0xF0, 0xF0)
|
|
||||||
self.dds1.cpld.io_update.pulse(1 * ms)
|
|
||||||
|
|
||||||
# Switch on waveform, then set attenuation
|
|
||||||
self.dds1.cfg_sw(True)
|
|
||||||
self.dds1.set_att(ATT)
|
|
||||||
|
|
||||||
delay(10 * s)
|
delay(10 * s)
|
||||||
# Switch off waveform
|
|
||||||
|
# Disable waveform
|
||||||
self.dds1.cfg_sw(False)
|
self.dds1.cfg_sw(False)
|
||||||
|
if self.use_dds2:
|
||||||
|
self.dds2.cfg_sw(False)
|
||||||
|
|
||||||
if not self.io_update_device:
|
if not self.io_update_device:
|
||||||
# Unset MASK_NU to un-trigger CFG.IO_UPDATE
|
# Unset MASK_NU to un-trigger CFG.IO_UPDATE
|
||||||
self.dds1.cfg_mask_nu(False)
|
self.dds1.cfg_mask_nu(False)
|
||||||
|
if self.use_dds2:
|
||||||
|
self.dds2.cfg_mask_nu(False)
|
||||||
|
|
||||||
# UnSet ATT_EN
|
# Unset ATT_EN
|
||||||
self.dds1.cfg_att_en(False)
|
self.dds1.cfg_att_en(False)
|
||||||
|
if self.use_dds2:
|
||||||
|
self.dds2.cfg_att_en(False)
|
||||||
|
|
||||||
self.core.wait_until_mu(now_mu())
|
self.core.wait_until_mu(now_mu())
|
||||||
|
|
||||||
@ -614,12 +464,17 @@ class AD9910Test(ExperimentCase):
|
|||||||
self.execute(AD9910WaveformExp, "single_tone", io_update_device=False)
|
self.execute(AD9910WaveformExp, "single_tone", io_update_device=False)
|
||||||
|
|
||||||
@io_update_device(True, proto_rev=STA_PROTO_REV_8)
|
@io_update_device(True, proto_rev=STA_PROTO_REV_8)
|
||||||
def test_toggle_profile(self):
|
def test_toggle_profiles(self):
|
||||||
self.execute(AD9910WaveformExp, "toggle_profile")
|
self.execute(AD9910WaveformExp, "toggle_profiles", multiple_profiles=False)
|
||||||
|
|
||||||
@io_update_device(False, proto_rev=STA_PROTO_REV_8)
|
@io_update_device(False, proto_rev=STA_PROTO_REV_8)
|
||||||
def test_toggle_profile_no_io_update_device(self):
|
def test_toggle_profiles_no_io_update_device(self):
|
||||||
self.execute(AD9910WaveformExp, "toggle_profile", io_update_device=False)
|
self.execute(
|
||||||
|
AD9910WaveformExp,
|
||||||
|
"toggle_profiles",
|
||||||
|
io_update_device=False,
|
||||||
|
multiple_profiles=False,
|
||||||
|
)
|
||||||
|
|
||||||
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_toggle_profiles(self):
|
def test_toggle_profiles(self):
|
||||||
@ -630,44 +485,134 @@ class AD9910Test(ExperimentCase):
|
|||||||
self.execute(AD9910WaveformExp, "toggle_profiles", io_update_device=False)
|
self.execute(AD9910WaveformExp, "toggle_profiles", io_update_device=False)
|
||||||
|
|
||||||
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_osk(self):
|
def test_osk_manual(self):
|
||||||
self.execute(AD9910WaveformExp, "osk")
|
self.execute(AD9910WaveformExp, "osk")
|
||||||
|
|
||||||
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_osk_no_io_update_device(self):
|
def test_osk_manual_no_io_update_device(self):
|
||||||
self.execute(AD9910WaveformExp, "osk", io_update_device=False)
|
self.execute(AD9910WaveformExp, "osk", io_update_device=False)
|
||||||
|
|
||||||
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_osk_auto(self):
|
def test_osk_auto(self):
|
||||||
self.execute(AD9910WaveformExp, "osk_auto")
|
self.execute(AD9910WaveformExp, "osk", osk_manual=False)
|
||||||
|
|
||||||
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_osk_auto_no_io_update_device(self):
|
def test_osk_auto_no_io_update_device(self):
|
||||||
self.execute(AD9910WaveformExp, "osk_auto", io_update_device=False)
|
self.execute(AD9910WaveformExp, "osk", io_update_device=False, osk_manual=False)
|
||||||
|
|
||||||
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_drg_normal(self):
|
def test_drg_normal_frequency(self):
|
||||||
self.execute(AD9910WaveformExp, "drg_normal")
|
self.execute(AD9910WaveformExp, "drg")
|
||||||
|
|
||||||
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
|
||||||
def test_drg_normal_no_io_update_device(self):
|
|
||||||
self.execute(AD9910WaveformExp, "drg_normal", io_update_device=False)
|
|
||||||
|
|
||||||
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_drg_normal_with_hold(self):
|
def test_drg_normal_phase(self):
|
||||||
self.execute(AD9910WaveformExp, "drg_normal_with_hold")
|
self.execute(AD9910WaveformExp, "drg", drg_destination=0x1, use_dds2=True)
|
||||||
|
|
||||||
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
|
||||||
def test_drg_normal_with_hold_no_io_update_device(self):
|
|
||||||
self.execute(AD9910WaveformExp, "drg_normal_with_hold", io_update_device=False)
|
|
||||||
|
|
||||||
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_drg_nodwell(self):
|
def test_drg_normal_amplitude(self):
|
||||||
self.execute(AD9910WaveformExp, "drg_nodwell")
|
self.execute(AD9910WaveformExp, "drg", drg_destination=0x2)
|
||||||
|
|
||||||
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_drg_nodwell_no_io_update_device(self):
|
def test_drg_normal_frequency_no_io_update_device(self):
|
||||||
self.execute(AD9910WaveformExp, "drg_nodwell", io_update_device=False)
|
self.execute(AD9910WaveformExp, "drg", io_update_device=False)
|
||||||
|
|
||||||
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_normal_phase_no_io_update_device(self):
|
||||||
|
self.execute(
|
||||||
|
AD9910WaveformExp,
|
||||||
|
"drg",
|
||||||
|
io_update_device=False,
|
||||||
|
drg_destination=0x1,
|
||||||
|
use_dds2=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_normal_amplitude_no_io_update_device(self):
|
||||||
|
self.execute(
|
||||||
|
AD9910WaveformExp, "drg", io_update_device=False, drg_destination=0x2
|
||||||
|
)
|
||||||
|
|
||||||
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_normal_with_hold_frequency(self):
|
||||||
|
self.execute(AD9910WaveformExp, "drg", with_hold=True)
|
||||||
|
|
||||||
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_normal_with_hold_phase(self):
|
||||||
|
self.execute(
|
||||||
|
AD9910WaveformExp,
|
||||||
|
"drg",
|
||||||
|
drg_destination=0x1,
|
||||||
|
use_dds2=True,
|
||||||
|
with_hold=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_normal_with_hold_amplitude(self):
|
||||||
|
self.execute(AD9910WaveformExp, "drg", drg_destination=0x2, with_hold=True)
|
||||||
|
|
||||||
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_normal_with_hold_frequency_no_io_update_device(self):
|
||||||
|
self.execute(AD9910WaveformExp, "drg", io_update_device=False, with_hold=True)
|
||||||
|
|
||||||
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_normal_with_hold_phase_no_io_update_device(self):
|
||||||
|
self.execute(
|
||||||
|
AD9910WaveformExp,
|
||||||
|
"drg",
|
||||||
|
io_update_device=False,
|
||||||
|
drg_destination=0x1,
|
||||||
|
use_dds2=True,
|
||||||
|
with_hold=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_normal_with_hold_amplitude_no_io_update_device(self):
|
||||||
|
self.execute(
|
||||||
|
AD9910WaveformExp,
|
||||||
|
"drg",
|
||||||
|
io_update_device=False,
|
||||||
|
drg_destination=0x2,
|
||||||
|
with_hold=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_nodwell_frequency(self):
|
||||||
|
self.execute(AD9910WaveformExp, "drg", nodwell=1)
|
||||||
|
|
||||||
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_nodwell_phase(self):
|
||||||
|
self.execute(
|
||||||
|
AD9910WaveformExp, "drg", drg_destination=0x1, use_dds2=True, nodwell=1
|
||||||
|
)
|
||||||
|
|
||||||
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_nodwell_amplitude(self):
|
||||||
|
self.execute(AD9910WaveformExp, "drg", drg_destination=0x2, nodwell=1)
|
||||||
|
|
||||||
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_nodwell_frequency_no_io_update_device(self):
|
||||||
|
self.execute(AD9910WaveformExp, "drg", io_update_device=False, nodwell=1)
|
||||||
|
|
||||||
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_nodwell_phase_no_io_update_device(self):
|
||||||
|
self.execute(
|
||||||
|
AD9910WaveformExp,
|
||||||
|
"drg",
|
||||||
|
io_update_device=False,
|
||||||
|
drg_destination=0x1,
|
||||||
|
use_dds2=True,
|
||||||
|
nodwell=1,
|
||||||
|
)
|
||||||
|
|
||||||
|
@io_update_device(False, proto_rev=STA_PROTO_REV_9)
|
||||||
|
def test_drg_nodwell_amplitude_no_io_update_device(self):
|
||||||
|
self.execute(
|
||||||
|
AD9910WaveformExp,
|
||||||
|
"drg",
|
||||||
|
io_update_device=False,
|
||||||
|
drg_destination=0x2,
|
||||||
|
nodwell=1,
|
||||||
|
)
|
||||||
|
|
||||||
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
@io_update_device(True, proto_rev=STA_PROTO_REV_9)
|
||||||
def test_att_single_tone(self):
|
def test_att_single_tone(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user