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: 62e51c5f8c21
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: 8db9c53a6da3
Choose a head ref
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on Jan 25, 2016

  1. Copy the full SHA
    0e2c6c1 View commit details
  2. Copy the full SHA
    408430b View commit details
  3. CoreException: store at 'py_exn.artiq_core_exception'

    ... and fix a few imports
    jordens committed Jan 25, 2016
    Copy the full SHA
    8db9c53 View commit details
Showing with 15 additions and 14 deletions.
  1. +7 −7 artiq/coredevice/comm_generic.py
  2. +4 −0 artiq/coredevice/exceptions.py
  3. +2 −2 artiq/frontend/artiq_run.py
  4. +0 −1 artiq/language/core.py
  5. +1 −3 doc/manual/conf.py
  6. +1 −1 doc/manual/getting_started_core.rst
14 changes: 7 additions & 7 deletions artiq/coredevice/comm_generic.py
Original file line number Diff line number Diff line change
@@ -457,8 +457,8 @@ def _serve_rpc(self, object_map):

self._write_header(_H2DMsgType.RPC_EXCEPTION)

if hasattr(exn, 'core_exception'):
exn = exn.core_exception
if hasattr(exn, 'artiq_core_exception'):
exn = exn.artiq_core_exception
self._write_string(exn.name)
self._write_string(exn.message)
for index in range(3):
@@ -504,15 +504,15 @@ def _serve_exception(self, object_map, symbolizer):

traceback = list(reversed(symbolizer(backtrace))) + \
[(filename, line, column, function, None)]
core_exception = exceptions.CoreException(name, message, params, traceback)
core_exn = exceptions.CoreException(name, message, params, traceback)

if core_exception.id == 0:
python_exn_type = getattr(exceptions, core_exception.name.split('.')[-1])
if core_exn.id == 0:
python_exn_type = getattr(exceptions, core_exn.name.split('.')[-1])
else:
python_exn_type = object_map.retrieve(core_exception.id)
python_exn_type = object_map.retrieve(core_exn.id)

python_exn = python_exn_type(message.format(*params))
python_exn.core_exception = core_exception
python_exn.artiq_core_exception = core_exn
raise python_exn

def serve(self, object_map, symbolizer):
4 changes: 4 additions & 0 deletions artiq/coredevice/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import builtins
import linecache
import re
import os

from artiq.coredevice.runtime import source_loader


4 changes: 2 additions & 2 deletions artiq/frontend/artiq_run.py
Original file line number Diff line number Diff line change
@@ -132,8 +132,8 @@ def run(with_file=False):
except CompileError as error:
return
except Exception as exn:
if hasattr(exn, 'core_exception'):
print(exn.core_exception, file=sys.stderr)
if hasattr(exn, 'artiq_core_exception'):
print(exn.artiq_core_exception, file=sys.stderr)
raise exn
finally:
device_mgr.close_devices()
1 change: 0 additions & 1 deletion artiq/language/core.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
Core ARTIQ extensions to the Python language.
"""

import os, linecache, re
from collections import namedtuple
from functools import wraps

4 changes: 1 addition & 3 deletions doc/manual/conf.py
Original file line number Diff line number Diff line change
@@ -75,11 +75,9 @@ def __getattr__(cls, name):
# built documents.
#
# The short X.Y version.
# version = 'prerelease'
version = artiq_version.split('+', 1)[0]
# The full version, including alpha/beta/rc tags.
# release = 'prerelease'
release = artiq_version
version = release.split('+', 1)[0]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
2 changes: 1 addition & 1 deletion doc/manual/getting_started_core.rst
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ Instead, inside the core device, output timing is generated by the gateware and

Try reducing the period of the generated waveform until the CPU cannot keep up with the generation of switching events and the underflow exception is raised. Then try catching it: ::

from artiq.coredevice.exceptions import RTIOUnderflow
from artiq.experiment import *


def print_underflow():