Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 69ea3d3cc0ad
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 60919c2ea75d
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Aug 25, 2016

  1. Copy the full SHA
    552146b View commit details
  2. Copy the full SHA
    60919c2 View commit details
Showing with 34 additions and 8 deletions.
  1. +1 −0 conda/artiq/meta.yaml
  2. +1 −0 doc/manual/conf.py
  3. +30 −7 doc/manual/rtio.rst
  4. +2 −1 setup.py
1 change: 1 addition & 0 deletions conda/artiq/meta.yaml
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ requirements:
- asyncserial
- sphinx
- sphinx-argparse
- sphinxcontrib-wavedrom
- h5py
- dateutil
- pyqt5
1 change: 1 addition & 0 deletions doc/manual/conf.py
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ def __getattr__(cls, name):
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinxarg.ext',
'sphinxcontrib.wavedrom',
]

# Add any paths that contain templates here, relative to this directory.
37 changes: 30 additions & 7 deletions doc/manual/rtio.rst
Original file line number Diff line number Diff line change
@@ -40,23 +40,45 @@ When computing the difference of absolute timestamps, use ``mu_to_seconds(t2-t1)
When accumulating time, do it in machine units and not in SI units, so that rounding errors do not accumulate.

The following basic example shows how to place output events on the timeline.
It emits a precisely timed 10 µs pulse:::
It emits a precisely timed 2 µs pulse:::

ttl.on()
delay(10*us)
delay(2*us)
ttl.off()

The device ``ttl`` represents a single digital output channel
(:class:`artiq.coredevice.ttl.TTLOut`).
The :meth:`artiq.coredevice.ttl.TTLOut.on` method places an rising edge on the timeline at the current cursor position (``now``).
Then the cursor is moved forward 10 µs and a falling edge event is placed at the new cursor position.
Then the cursor is moved forward 2 µs and a falling edge event is placed at the new cursor position.
Then later, when the wall clock reaches the respective timestamps the RTIO gateware executes the two events.

The following diagram shows what is going on at the different levels of the software and gateware stack:

.. wavedrom::
{
signal: [
{name: 'kernel', wave: 'x22.2x', data: ['on()', 'delay(2*us)', 'off()'], node: '..A.XB'},
{name: 'now_mu', wave: '2...2.', data: ['7000', '9000'], node: '..P..Q'},
{name: 'slack', wave: 'x2x.2x', data: ['4400', '5800']},
{},
{name: 'rtio_counter', wave: 'x2x|2x|2x2x', data: ['2600', '3200', '7000', '9000'], node: ' V.W'},
{name: 'ttl', wave: 'x1.0', node: ' R.S', phase: -7.5},
{ node: ' T.U', phase: -7.5}
],
edge: [
'A~>R', 'P~>R', 'V~>R', 'B~>S', 'Q~>S', 'W~>S',
'R-T', 'S-U', 'T<->U 2µs'
],
}



The sequence is exactly equivalent to:::

ttl.pulse(10*us)
ttl.pulse(2*us)

The :meth:`artiq.coredevice.ttl.TTLOut.pulse` method advances the timeline cursor (using ``delay()``) while other methods such as :meth:`artiq.coredevice.ttl.TTLOut.on`, :meth:`artiq.coredevice.ttl.TTLOut.off`, :meth:`artiq.coredevice.dds._DDSGeneric.set`, or the ``set_*()`` methods of :class:`artiq.coredevice.spi.SPIMaster` do not. The latter are called *zero-duration* methods.


Underflow exceptions
--------------------

@@ -132,5 +154,6 @@ If a previous kernel sets timeline cursor far in the future this effectively loc
It also means that a kernel is not guaranteed to always be executed with positive slack.

Therefore, when switching experiments it can be adequate to clear the RTIO FIFOs and initialize the timeline cursor to "sometime in the near future" using :meth:`artiq.coredevice.core.Core.reset`.

To accommodate for seamless handover the idle kernel is is only executed when no other experiment is pending and when there is significant negative slack.
The example idle kernel implements this mechanism.
Since it never waits for any input, it will rapidly fill the output FIFOs and would produce a large positive slack.
To avoid large positive slack and to accommodate for seamless handover the idle kernel will only run when no other experiment is pending and the example will wait before submitting events until there is significant negative slack.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@

# Depends on PyQt5, but setuptools cannot check for it.
requirements = [
"sphinx", "sphinx-argparse", "asyncserial", "numpy", "scipy",
"sphinx", "sphinx-argparse", "sphinxcontrib-wavedrom",
"asyncserial", "numpy", "scipy",
"python-dateutil", "prettytable", "h5py",
"quamash", "pyqtgraph", "pygit2", "aiohttp",
"llvmlite_artiq", "pythonparser", "python-Levenshtein",