From e8730a7e146de67a2015ec27f0a92ca70c18bfdf Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Mon, 9 Nov 2020 19:33:20 +0100 Subject: [PATCH] coredevice: adf5356: add test for failed PLL lock Signed-off-by: Etienne Wodey --- artiq/test/coredevice/test_adf5356.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/artiq/test/coredevice/test_adf5356.py b/artiq/test/coredevice/test_adf5356.py index 56f8c95a9..e98189c0f 100644 --- a/artiq/test/coredevice/test_adf5356.py +++ b/artiq/test/coredevice/test_adf5356.py @@ -62,6 +62,17 @@ class ADF5356Exp(EnvExperiment): delay(5 * ms) self.set_dataset("muxout", self.dev.read_muxout()) + @kernel + def muxout_lock_detect_no_lock(self): + self.core.break_realtime() + self.dev.cpld.init() + self.dev.init() + # set external SMA reference input + self.dev.cpld.write_reg(1, (1 << 4)) + self.dev.set_frequency(100 * MHz) + delay(5 * ms) + self.set_dataset("muxout", self.dev.read_muxout()) + @kernel def set_get_output_power(self): self.core.break_realtime() @@ -168,6 +179,11 @@ class ADF5356Test(ExperimentCase): muxout = self.dataset_mgr.get("muxout") self.assertTrue(muxout) + def test_muxout_lock_detect_no_lock(self): + self.execute(ADF5356Exp, "muxout_lock_detect_no_lock") + muxout = self.dataset_mgr.get("muxout") + self.assertFalse(muxout) + def test_set_too_high_frequency(self): with self.assertRaises(ValueError): self.execute(ADF5356Exp, "set_too_high_frequency")