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: 21b170ed32d7
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: cd199f16eccb
Choose a head ref
  • 4 commits
  • 4 files changed
  • 1 contributor

Commits on Aug 17, 2015

  1. Copy the full SHA
    e7d495c View commit details
  2. Copy the full SHA
    278adf1 View commit details
  3. Copy the full SHA
    c71d207 View commit details
  4. Copy the full SHA
    cd199f1 View commit details
Showing with 9 additions and 25 deletions.
  1. +3 −1 artiq/coredevice/core.py
  2. +1 −9 artiq/gui/tools.py
  3. +4 −14 artiq/test/pc_rpc.py
  4. +1 −1 doc/manual/getting_started.rst
4 changes: 3 additions & 1 deletion artiq/coredevice/core.py
Original file line number Diff line number Diff line change
@@ -124,4 +124,6 @@ def get_rtio_counter_mu(self):

@kernel
def break_realtime(self):
at_mu(syscall("rtio_get_counter") + 125000)
min_now = syscall("rtio_get_counter") + 125000
if now_mu() < min_now:
at_mu(min_now)
10 changes: 1 addition & 9 deletions artiq/gui/tools.py
Original file line number Diff line number Diff line change
@@ -22,19 +22,11 @@ def elide(s, maxlen):
return s


_scalar_types = {
int, float,
np.int8, np.int16, np.int32, np.int64,
np.uint8, np.uint16, np.uint32, np.uint64,
np.float16, np.float32, np.float64
}


def short_format(v):
if v is None:
return "None"
t = type(v)
if t in _scalar_types:
if np.issubdtype(t, int) or np.issubdtype(t, float):
return str(v)
elif t is str:
return "\"" + elide(v, 15) + "\""
18 changes: 4 additions & 14 deletions artiq/test/pc_rpc.py
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ def _blocking_echo(self):
self.assertEqual(test_object, test_object_back)
with self.assertRaises(pc_rpc.RemoteError):
remote.non_existing_method()
remote.quit()
remote.terminate()
finally:
remote.close_rpc()

@@ -68,7 +68,7 @@ def _asyncio_echo(self):
self.assertEqual(test_object, test_object_back)
with self.assertRaises(pc_rpc.RemoteError):
yield from remote.non_existing_method()
yield from remote.quit()
yield from remote.terminate()
finally:
remote.close_rpc()

@@ -97,16 +97,6 @@ def test_fire_and_forget(self):


class Echo:
def __init__(self):
self.terminate_notify = asyncio.Semaphore(0)

@asyncio.coroutine
def wait_quit(self):
yield from self.terminate_notify.acquire()

def quit(self):
self.terminate_notify.release()

def echo(self, x):
return x

@@ -116,10 +106,10 @@ def run_server():
asyncio.set_event_loop(loop)
try:
echo = Echo()
server = pc_rpc.Server({"test": echo})
server = pc_rpc.Server({"test": echo}, builtin_terminate=True)
loop.run_until_complete(server.start(test_address, test_port))
try:
loop.run_until_complete(echo.wait_quit())
loop.run_until_complete(server.wait_terminate())
finally:
loop.run_until_complete(server.stop())
finally:
2 changes: 1 addition & 1 deletion doc/manual/getting_started.rst
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ As a very first step, we will turn on a LED on the core device. Create a file ``

The central part of our code is our ``LED`` class, that derives from :class:`artiq.language.environment.EnvExperiment`. Among other features, ``EnvExperiment`` calls our ``build`` method and provides the ``attr_device`` method that interfaces to the device database to create the appropriate device drivers and make those drivers accessible as ``self.core`` and ``self.led``. The ``@kernel`` decorator tells the system that the ``run`` method must be executed on the core device (instead of the host). The decorator uses ``self.core`` internally, which is why we request the core device using ``attr_device`` like any other.

Copy the files ``ddb.pyon`` and ``pdb.pyon`` (containing the device and parameter databases) from the ``examples`` folder of ARTIQ into the same directory as ``led.py`` (alternatively, you can use the ``-d`` and ``-p`` options of ``artiq_run.py``). You can open the database files using a text editor - their contents are in a human-readable format.
Copy the files ``ddb.pyon`` and ``pdb.pyon`` (containing the device and parameter databases) from the ``examples`` folder of ARTIQ into the same directory as ``led.py`` (alternatively, you can use the ``-d`` and ``-p`` options of ``artiq_run.py``). You can open the database files using a text editor - their contents are in a human-readable format. You will probably want to set the IP address of the core device in ``ddb.pyon`` so that the computer can connect to it (it is the ``host`` parameter of the ``comm`` entry).

Run your code using ``artiq_run``, which is part of the ARTIQ front-end tools: ::