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: c80f0fa07a40
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: e8aa825a9da8
Choose a head ref
  • 4 commits
  • 6 files changed
  • 1 contributor

Commits on Aug 8, 2015

  1. Copy the full SHA
    1818e81 View commit details
  2. doc: core device page

    sbourdeauducq committed Aug 8, 2015
    Copy the full SHA
    c003040 View commit details
  3. Revert "comm_generic: cleanup"

    This reverts commit be55487.
    sbourdeauducq committed Aug 8, 2015
    Copy the full SHA
    0a6fcd9 View commit details
  4. doc: git integration

    sbourdeauducq committed Aug 8, 2015
    Copy the full SHA
    e8aa825 View commit details
19 changes: 10 additions & 9 deletions artiq/coredevice/comm_generic.py
Original file line number Diff line number Diff line change
@@ -108,7 +108,10 @@ def check_ident(self):
if ty != _D2HMsgType.IDENT_REPLY:
raise IOError("Incorrect reply from device: {}".format(ty))
(reply, ) = struct.unpack("B", self.read(1))
runtime_id = self.read(4).decode()
runtime_id = chr(reply)
for i in range(3):
(reply, ) = struct.unpack("B", self.read(1))
runtime_id += chr(reply)
if runtime_id != "AROR":
raise UnsupportedDevice("Unsupported runtime ID: {}"
.format(runtime_id))
@@ -235,11 +238,9 @@ def get_log(self):
length, ty = self._read_header()
if ty != _D2HMsgType.LOG_REPLY:
raise IOError("Incorrect request from device: "+str(ty))
log = self.read(length - 9).decode()
try:
idx = log.index("\x00")
except ValueError:
pass
else:
log = log[:idx]
return log
r = ""
for i in range(length - 9):
c = struct.unpack("B", self.read(1))[0]
if c:
r += chr(c)
return r
34 changes: 32 additions & 2 deletions artiq/frontend/artiq_client.py
Original file line number Diff line number Diff line change
@@ -82,10 +82,10 @@ def get_argparser():
parser_del_parameter.add_argument("name", help="name of the parameter")

parser_show = subparsers.add_parser(
"show", help="show schedule, devices or parameters")
"show", help="show schedule, log, devices or parameters")
parser_show.add_argument(
"what",
help="select object to show: schedule/devices/parameters")
help="select object to show: schedule/log/devices/parameters")

subparsers.add_parser("scan-repository",
help="trigger a repository rescan")
@@ -224,12 +224,42 @@ def init_d(x):
_run_subscriber(args.server, args.port, subscriber)


class _LogPrinter:
def __init__(self, init):
for rid, msg in init:
print(rid, msg)

def append(self, x):
rid, msg = x
print(rid, msg)

def insert(self, i, x):
rid, msg = x
print(rid, msg)

def pop(self, i=-1):
pass

def __delitem__(self, x):
pass

def __setitem__(self, k, v):
pass


def _show_log(args):
subscriber = Subscriber("log", _LogPrinter)
_run_subscriber(args.server, args.port, subscriber)


def main():
args = get_argparser().parse_args()
action = args.action.replace("-", "_")
if action == "show":
if args.what == "schedule":
_show_dict(args, "schedule", _show_schedule)
elif args.what == "log":
_show_log(args)
elif args.what == "devices":
_show_dict(args, "devices", _show_devices)
elif args.what == "parameters":
21 changes: 20 additions & 1 deletion doc/manual/fpga_board_ports.rst → doc/manual/core_device.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
Core device
===========

.. _core-device-flash-storage:

Flash storage
*************

The core device contains some flash space that can be used to store
some configuration data.

This storage area is used to store the core device MAC address, IP address and even the idle kernel.

The flash storage area is one sector (typically 64 kB) large and is organized as a list
of key-value records.

This flash storage space can be accessed by using the artiq_coretool :ref:`core-device-access-tool`.


FPGA board ports
================
****************

KC705
-----
14 changes: 0 additions & 14 deletions doc/manual/core_device_flash_storage.rst

This file was deleted.

5 changes: 2 additions & 3 deletions doc/manual/index.rst
Original file line number Diff line number Diff line change
@@ -9,14 +9,13 @@ Contents:
introduction
installing
getting_started
developing_a_ndsp
management_system
core_device
core_language_reference
core_drivers_reference
protocols_reference
ndsp_reference
core_device_flash_storage
developing_a_ndsp
utilities
fpga_board_ports
default_network_ports
faq
71 changes: 57 additions & 14 deletions doc/manual/management_system.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
Management system
=================

The management system described below is optional: experiments can be run one by one using ``artiq_run``, and the controllers can run stand-alone (without a controller manager). For their very first steps with ARTIQ or in simple or particular cases, users do not need to deploy the management system.

Components
**********

Master
------

The master is responsible for managing the parameter and device databases, the experiment repository, scheduling and running experiments, archiving results, and distributing real-time results.

The master is a headless component, and one or several clients (command-line or GUI) use the network to interact with it.

.. argparse::
:ref: artiq.frontend.artiq_master.get_argparser
:prog: artiq_master

Controller manager
------------------

@@ -21,23 +22,65 @@ A controller manager connects to the master and uses the device database to dete

Controller managers use the local network address of the connection to the master to filter the device database and run only those controllers that are allocated to the current node. Hostname resolution is supported.

.. argparse::
:ref: artiq.frontend.artiq_ctlmgr.get_argparser
:prog: artiq_ctlmgr

Command-line client
-------------------

The command-line client connects to the master and permits modification and monitoring of the databases, monitoring the experiment schedule, and submitting experiments.

.. argparse::
:ref: artiq.frontend.artiq_client.get_argparser
:prog: artiq_client
The command-line client connects to the master and permits modification and monitoring of the databases, monitoring the experiment schedule and log, and submitting experiments.

GUI client
----------

The GUI client connects to the master and is the main way of interacting with it.
The GUI client connects to the master and is the main way of interacting with it. The main features of the GUI are scheduling of experiments, setting of their arguments, examining the schedule, displaying real-time results, and debugging TTL and DDS channels in real time.

Experiment scheduling
*********************

Git integration
***************

The master may use a Git repository for the storage of experiment source code. Using Git has many advantages. For example, each result file (HDF5) contains the commit ID corresponding to the exact source code that produced it, which helps reproducibility.

Even though the master also supports non-bare repositories, it is recommended to use a bare repository so that it can easily support push transactions from clients. Create it with e.g.: ::

mkdir experiments
cd experiments
git init --bare

You want Git to notify the master every time the repository is pushed to (updated), so that it is rescanned for experiments and e.g. the GUI controls and the experiment list are updated.

Create a file named ``post-receive`` in the ``hooks`` folder (this folder has been created by the ``git`` command), containing the following: ::

#!/bin/sh
artiq_client scan-repository

Then set the execution permission on it: ::

chmod 755 hooks/post-receive

You may now run the master with the Git support enabled: ::

artiq_master -g -r /path_to/experiments

Push commits containing experiments to the bare repository using e.g. Git over SSH, and the new experiments should automatically appear in the GUI.

.. note:: If you plan to run the ARTIQ system entirely on a single machine, you may also consider using a non-bare repository and the ``post-commit`` hook to trigger repository scans every time you commit changes (locally).

The GUI always runs experiments from the repository. The command-line client, by default, runs experiment from the raw filesystem (which is useful for iterating rapidly without creating many disorganized commits). If you want to use the repository instead, simply pass the ``-R`` option.

Reference
*********

.. argparse::
:ref: artiq.frontend.artiq_master.get_argparser
:prog: artiq_master

.. argparse::
:ref: artiq.frontend.artiq_ctlmgr.get_argparser
:prog: artiq_ctlmgr

.. argparse::
:ref: artiq.frontend.artiq_client.get_argparser
:prog: artiq_client

.. argparse::
:ref: artiq.frontend.artiq_gui.get_argparser