forked from M-Labs/artiq
1
0
Fork 0

support builtin exceptions

This commit is contained in:
pca006132 2022-03-17 15:14:23 +08:00
parent 2f55f57803
commit 1a71a45225
2 changed files with 14 additions and 13 deletions

View File

@ -1,5 +1,5 @@
from artiq.language.core import nac3
from builtins import ZeroDivisionError, ValueError, IndexError, RuntimeError, AssertionError
@nac3
class RTIOUnderflow(Exception):
@ -8,7 +8,7 @@ class RTIOUnderflow(Exception):
The offending event is discarded and the RTIO core keeps operating.
"""
pass
artiq_builtin = True
@nac3
@ -20,7 +20,7 @@ class RTIOOverflow(Exception):
read attempt and discarding some events. Reading can be reattempted after
the exception is caught, and events will be partially retrieved.
"""
pass
artiq_builtin = True
@nac3
@ -28,34 +28,35 @@ class RTIODestinationUnreachable(Exception):
"""Raised with a RTIO operation could not be completed due to a DRTIO link
being down.
"""
pass
artiq_builtin = True
@nac3
class CacheError(Exception):
"""Raised when putting a value into a cache row would violate memory safety."""
pass
artiq_builtin = True
@nac3
class DMAError(Exception):
"""Raised when performing an invalid DMA operation."""
pass
artiq_builtin = True
@nac3
class ClockFailure(Exception):
"""Raised when RTIO PLL has lost lock."""
pass
artiq_builtin = True
@nac3
class I2CError(Exception):
"""Raised when a I2C transaction fails."""
pass
artiq_builtin = True
@nac3
class SPIError(Exception):
"""Raised when a SPI transaction fails."""
pass
artiq_builtin = True

View File

@ -45,11 +45,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1646904536,
"narHash": "sha256-1iyrx16xgQMjQZt2ZjqnNj5nm50gHoqdg07UGhHzsy8=",
"lastModified": 1647501180,
"narHash": "sha256-QWjv7LQRCaNjQ+PzQIs8r7moWxS/Jemaf9jzGb62L84=",
"ref": "master",
"rev": "8fd868a673ffaf89f809bacb95733ca00eba85c9",
"revCount": 641,
"rev": "fb8553311cf9838156fce39bfba547c0ae099c80",
"revCount": 645,
"type": "git",
"url": "https://git.m-labs.hk/m-labs/nac3.git"
},