From bff611a888366d3f4cffe2086a257ad4ea8f2ad9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 11 Sep 2020 11:21:45 +0800 Subject: [PATCH] test: relax test_dma_playback_time on Zynq --- artiq/test/coredevice/test_rtio.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/artiq/test/coredevice/test_rtio.py b/artiq/test/coredevice/test_rtio.py index de7318d27..3313b5c14 100644 --- a/artiq/test/coredevice/test_rtio.py +++ b/artiq/test/coredevice/test_rtio.py @@ -627,11 +627,13 @@ class _DMA(EnvExperiment): self.delta = now_mu() - start @kernel - def playback_many(self, n): + def playback_many(self, n, add_delay=False): handle = self.core_dma.get_handle(self.trace_name) self.core.break_realtime() t1 = self.core.get_rtio_counter_mu() for i in range(n): + if add_delay: + delay(2*us) self.core_dma.playback_handle(handle) t2 = self.core.get_rtio_counter_mu() self.set_dataset("dma_playback_time", self.core.mu_to_seconds(t2 - t1)) @@ -724,13 +726,18 @@ class DMATest(ExperimentCase): self.device_mgr.get_desc("ad9914dds0") except KeyError: raise unittest.SkipTest("skipped on Kasli for now") + exp = self.create(_DMA) + is_zynq = exp.core.target_cls == CortexA9Target count = 20000 exp.record_many(40) - exp.playback_many(count) + exp.playback_many(count, is_zynq) dt = self.dataset_mgr.get("dma_playback_time") print("dt={}, dt/count={}".format(dt, dt/count)) - self.assertLess(dt/count, 4.5*us) + if is_zynq: + self.assertLess(dt/count, 6.2*us) + else: + self.assertLess(dt/count, 4.5*us) def test_dma_underflow(self): exp = self.create(_DMA)