From 17a5fb2dce0a68cb6ad56a68f417a2c2eabb0359 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Mon, 23 Jul 2018 14:36:03 +0100 Subject: [PATCH] ttl: Remove error-prone sync() calls These methods are problematic, as with DMA in the picture, the timestamp member variables did not necessarily reflect the last submitted event timestamp (see GitHub #1113). sync() is only very rarely used in typical experimental code, so the methods are removed without a transition period. Core.wait_until() can be used to busy-wait for a specified RTIO timestamp value on the core device CPU instead. --- artiq/coredevice/ttl.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/artiq/coredevice/ttl.py b/artiq/coredevice/ttl.py index 802715df9..292a5cfbe 100644 --- a/artiq/coredevice/ttl.py +++ b/artiq/coredevice/ttl.py @@ -35,9 +35,6 @@ class TTLOut: self.core = dmgr.get(core_device) self.channel = channel - # in RTIO cycles - self.o_previous_timestamp = numpy.int64(0) - @kernel def output(self): pass @@ -45,14 +42,6 @@ class TTLOut: @kernel def set_o(self, o): rtio_output(now_mu(), self.channel, 0, 1 if o else 0) - self.o_previous_timestamp = now_mu() - - @kernel - def sync(self): - """Busy-wait until all programmed level switches have been - effected.""" - while self.core.get_rtio_counter_mu() < self.o_previous_timestamp: - pass @kernel def on(self): @@ -123,8 +112,6 @@ class TTLInOut: self.core = dmgr.get(core_device) self.channel = channel - # in RTIO cycles - self.o_previous_timestamp = numpy.int64(0) self.i_previous_timestamp = numpy.int64(0) self.queued_samples = 0 @@ -153,14 +140,6 @@ class TTLInOut: @kernel def set_o(self, o): rtio_output(now_mu(), self.channel, 0, 1 if o else 0) - self.o_previous_timestamp = now_mu() - - @kernel - def sync(self): - """Busy-wait until all programmed level switches have been - effected.""" - while self.core.get_rtio_counter_mu() < self.o_previous_timestamp: - pass @kernel def on(self):