From 035b541a739a588ee9b90d4a85f0ca8fb22bad82 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 29 Sep 2014 17:36:35 +0800 Subject: [PATCH] language/core: add RuntimeException --- artiq/devices/runtime_exceptions.py | 5 +++-- artiq/language/core.py | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/artiq/devices/runtime_exceptions.py b/artiq/devices/runtime_exceptions.py index d01ef5bbf..c9b631010 100644 --- a/artiq/devices/runtime_exceptions.py +++ b/artiq/devices/runtime_exceptions.py @@ -1,7 +1,8 @@ -class RuntimeException(Exception): - pass +from artiq.language.core import RuntimeException +# Must be kept in sync with soc/runtime/exceptions.h + class OutOfMemory(RuntimeException): eid = 0 diff --git a/artiq/language/core.py b/artiq/language/core.py index 05755a1fb..eabc04a96 100644 --- a/artiq/language/core.py +++ b/artiq/language/core.py @@ -346,4 +346,12 @@ def EncodedException(eid): return EncodedException +class RuntimeException(Exception): + """Base class for all exceptions used by the device runtime. + Those exceptions are defined in ``artiq.devices.runtime_exceptions``. + + """ + pass + + first_user_eid = 1024