forked from M-Labs/artiq
DMA: various fixes to bring tests in line.
This commit is contained in:
parent
d383145752
commit
fd994ceef3
|
@ -503,7 +503,6 @@ class _DMA(EnvExperiment):
|
||||||
@kernel
|
@kernel
|
||||||
def playback(self, use_handle=False):
|
def playback(self, use_handle=False):
|
||||||
self.core.break_realtime()
|
self.core.break_realtime()
|
||||||
delay(100*ms)
|
|
||||||
start = now_mu()
|
start = now_mu()
|
||||||
if use_handle:
|
if use_handle:
|
||||||
handle = self.core_dma.get_handle(self.trace_name)
|
handle = self.core_dma.get_handle(self.trace_name)
|
||||||
|
@ -515,7 +514,6 @@ class _DMA(EnvExperiment):
|
||||||
@kernel
|
@kernel
|
||||||
def playback_many(self, n):
|
def playback_many(self, n):
|
||||||
self.core.break_realtime()
|
self.core.break_realtime()
|
||||||
delay(100*ms)
|
|
||||||
handle = self.core_dma.get_handle(self.trace_name)
|
handle = self.core_dma.get_handle(self.trace_name)
|
||||||
t1 = self.core.get_rtio_counter_mu()
|
t1 = self.core.get_rtio_counter_mu()
|
||||||
for i in range(n):
|
for i in range(n):
|
||||||
|
@ -597,11 +595,12 @@ class DMATest(ExperimentCase):
|
||||||
exp.record_many(count)
|
exp.record_many(count)
|
||||||
dt = self.dataset_mgr.get("dma_record_time")
|
dt = self.dataset_mgr.get("dma_record_time")
|
||||||
print("dt={}, dt/count={}".format(dt, dt/count))
|
print("dt={}, dt/count={}".format(dt, dt/count))
|
||||||
self.assertLess(dt/count, 16*us)
|
self.assertLess(dt/count, 18*us)
|
||||||
|
|
||||||
def test_dma_playback_time(self):
|
def test_dma_playback_time(self):
|
||||||
exp = self.create(_DMA)
|
exp = self.create(_DMA)
|
||||||
count = 20000
|
count = 20000
|
||||||
|
exp.record()
|
||||||
exp.playback_many(count)
|
exp.playback_many(count)
|
||||||
dt = self.dataset_mgr.get("dma_playback_time")
|
dt = self.dataset_mgr.get("dma_playback_time")
|
||||||
print("dt={}, dt/count={}".format(dt, dt/count))
|
print("dt={}, dt/count={}".format(dt, dt/count))
|
||||||
|
|
Loading…
Reference in New Issue