manual/rtio: Update Syncrhonization section following sync() removal

This commit is contained in:
David Nadlinger 2019-05-14 20:27:06 +01:00
parent 1e01e6b834
commit d4275ea1e0

View File

@ -235,22 +235,25 @@ Here, ``run()`` calls ``k1()`` which exits leaving the cursor one second after t
} }
.. _rtio-handover-synchronization:
Synchronization Synchronization
--------------- ---------------
The seamless handover of the timeline (cursor and events) across kernels and experiments implies that a kernel can exit long before the events it has submitted have been executed. The seamless handover of the timeline (cursor and events) across kernels and experiments implies that a kernel can exit long before the events it has submitted have been executed.
If a previous kernel sets timeline cursor far in the future this effectively locks the system. If a previous kernel sets timeline cursor far in the future this effectively locks the system.
When a kernel should wait until all the events on a particular channel have been executed, use the :meth:`artiq.coredevice.ttl.TTLOut.sync` method of a channel:
When a kernel should wait until all the events have been executed, use the :meth:`artiq.coredevice.core.Core.wait_until_mu` with a timestamp after (or at) the last event:
.. wavedrom:: .. wavedrom::
{ {
"signal": [ "signal": [
{"name": "kernel", "wave": "x3x.|5.|x", "data": ["on()", "sync()"], "node": "..A.....Y"}, {"name": "kernel", "wave": "x3x.|5...|x", "data": ["on()", "wait_until_mu(7000)"], "node": "..A.....Y"},
{"name": "now", "wave": "2..", "data": ["7000"], "node": "..P"}, {"name": "now", "wave": "2..", "data": ["7000"], "node": "..P"},
{}, {},
{}, {},
{"name": "rtio_counter", "wave": "x2x.|..2x", "data": ["2000", "7000"], "node": " ....V"}, {"name": "rtio_counter", "wave": "x2x.|..2x..", "data": ["2000", "7000"], "node": " ....V"},
{"name": "ttl", "wave": "x1", "node": " R", "phase": -6.5} {"name": "ttl", "wave": "x1", "node": " R", "phase": -6.5}
], ],
"edge": [ "edge": [
@ -258,6 +261,11 @@ When a kernel should wait until all the events on a particular channel have been
] ]
} }
In many cases, :meth:`~artiq.language.core.now_mu` will return an appropriate timestamp::
self.core.wait_until_mu(now_mu())
RTIO reset RTIO reset
----------- -----------