-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into scanwidget
* master: (38 commits) hardware_testbench: better message when skipping test_spi: drain errors and be more strict on where we expect errors monkey-patch asyncio.proactor_events to handle ConnectionAbortedError on Windows. Closes #247 test/rtio/Loopback: ensure loop_out is low before starting test test/rtio: raise exception when pulse is not received rtio: fix different address collision detection frontend/coreanalyzer: do not attempt to print obsolete decoded_dump attribute. Closes #324 coredevice: put cache into separate file/device gui: delete log/applet docks instead of hiding them gui/moninj: make DDS widgets look less like buttons rtio: remove NOP suppression capability rtio/wishbone: make replace configurable exceptions: clarify RTIOBusy gateware/rtio: factor _BlindTransfer test_spi: break_realtime test_spi: simplify test, add collision vs busy test hardware_testbench: clean up artiq_core_exeption printing coredevice: fix _DDSGeneric __init__ args hardware_testbench: also print artiq_core_exeption rtio/core: fix syntax ...
Showing
42 changed files
with
761 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from artiq.coredevice import exceptions, dds, spi | ||
from artiq.coredevice.exceptions import (RTIOUnderflow, RTIOSequenceError, | ||
RTIOCollision, RTIOOverflow, | ||
RTIOCollision, RTIOOverflow, RTIOBusy, | ||
DDSBatchError, CacheError) | ||
from artiq.coredevice.dds import (PHASE_MODE_CONTINUOUS, PHASE_MODE_ABSOLUTE, | ||
PHASE_MODE_TRACKING) | ||
|
||
__all__ = [] | ||
__all__ += ["RTIOUnderflow", "RTIOSequenceError", "RTIOCollision", | ||
"RTIOOverflow", "DDSBatchError", "CacheError"] | ||
"RTIOOverflow", "RTIOBusy", "DDSBatchError", "CacheError"] | ||
__all__ += ["PHASE_MODE_CONTINUOUS", "PHASE_MODE_ABSOLUTE", | ||
"PHASE_MODE_TRACKING"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from artiq.language.core import * | ||
from artiq.language.types import * | ||
|
||
|
||
@syscall | ||
def cache_get(key: TStr) -> TList(TInt32): | ||
raise NotImplementedError("syscall not simulated") | ||
|
||
@syscall | ||
def cache_put(key: TStr, value: TList(TInt32)) -> TNone: | ||
raise NotImplementedError("syscall not simulated") | ||
|
||
|
||
class CoreCache: | ||
"""Core device cache access""" | ||
def __init__(self, dmgr, core_device="core"): | ||
self.core = dmgr.get(core_device) | ||
|
||
@kernel | ||
def get(self, key): | ||
"""Extract a value from the core device cache. | ||
After a value is extracted, it cannot be replaced with another value using | ||
:meth:`put` until all kernel functions finish executing; attempting | ||
to replace it will result in a :class:`artiq.coredevice.exceptions.CacheError`. | ||
If the cache does not contain any value associated with ``key``, an empty list | ||
is returned. | ||
The value is not copied, so mutating it will change what's stored in the cache. | ||
:param str key: cache key | ||
:return: a list of 32-bit integers | ||
""" | ||
return cache_get(key) | ||
|
||
@kernel | ||
def put(self, key, value): | ||
"""Put a value into the core device cache. The value will persist until reboot. | ||
To remove a value from the cache, call :meth:`put` with an empty list. | ||
:param str key: cache key | ||
:param list value: a list of 32-bit integers | ||
""" | ||
cache_put(key, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.