Commit Graph

80 Commits (master)

Author SHA1 Message Date
mwojcik c5d656ba32 drtio: increase maximum payload size 2024-05-17 15:36:56 +08:00
mwojcik a49ba3e350 master: support unsolicited async messages 2024-04-25 10:46:57 +08:00
mwojcik d1ee0ffb83 subkernel: fix passing arguments 2024-02-01 18:56:07 +08:00
mwojcik 09462442f7 subkernel: allow negative timeouts for no timeout 2024-01-31 11:46:07 +08:00
mwojcik c9e3771cd5 subkernels: add support for (d)dma 2024-01-09 08:44:45 +08:00
mwojcik 4363cdf9fa master: make use of the async message ready flag 2024-01-09 08:44:45 +08:00
mwojcik 95b92a178b satman: make use of the async flag 2024-01-09 08:44:45 +08:00
mwojcik 4956fac861 satman: allow subkernels start subkernels 2024-01-09 08:44:45 +08:00
mwojcik e556c29b40 drtioaux: add source to relevant drtio packets 2024-01-09 08:44:45 +08:00
mwojcik b3c0d084d4 drtio: better control state of bigger payloads 2023-11-07 13:42:04 +08:00
mwojcik b168f0bb4b subkernel: separate tags and data 2023-10-17 12:18:03 +02:00
mwojcik e05be2f8e4 runtime: support subkernels 2023-10-08 17:11:32 +08:00
mwojcik 6f4b8c641e drtioaux_proto: use better payload names 2023-10-08 17:11:32 +08:00
mwojcik b42816582e ksupport: support subkernels 2023-10-08 17:11:32 +08:00
David Nadlinger 4d636ea593 Upgrade to LLD 14
Previous linker versions had inserted some zero padding bytes
between the ELF headers and the first section, but LLD 14 does
not anymore.

Hard-coding the offset of the first section in ksupport.elf
manually isn't ideal; we should probably parse the ELF program
headers instead when first setting up the kernel CPU.
2023-08-07 10:10:38 +00:00
sven-oxionics b3dc199e6a Fix panic when receiving empty strings in rpc calls
Receiving an empty string in an RPC call currently panics.

When `length` is zero, a call to the `alloc` function (as implemented in `artiq/firmware/runtime/session.rs`) returns a null pointer. Constructing a `CMutSlice` from a null pointer panics.
A `CMutSlice` consists of a pointer and the length. Rust's documentation of the `core::ptr` module states: "The canonical way to obtain a pointer that is valid for zero-sized accesses is `NonNull::dangling`."
This commits adds a check for the length of a string received in an RPC call. Only for lengths greater than zero a memory allocation is performed. For zero-length strings, a dangling pointer is used.

Test plan:
Invoke the following experiment, which returns an empty string over RPC:
```
class ReturnEmptyString(artiq.experiment.EnvExperiment):
    def build(self):
        self.core: Core = self.get_device("core")

    @kernel
    def run(self):
        x = self.do_rpc()
        print(x)

    @rpc
    def do_rpc(self) -> TStr:
        return ""
```

Signed-off-by: Sven Over (Oxford Ionics) <sven.over@oxionics.com>
2023-07-18 04:00:32 +00:00
mwojcik ddfe51e7ac analyzer: use transactions for data transmission 2023-05-19 11:39:14 +08:00
mwojcik 0b03126038 satman: support analyzer packets 2023-05-19 11:39:14 +08:00
mwojcik fdca1ab7fc drtioaux: add analyzer related messages 2023-05-19 11:39:14 +08:00
mwojcik 918d30b900 dma: pass "uses_ddma" for non-remote recordings 2023-04-18 12:35:37 +08:00
Egor Savkin 8984f5104a Move RTIO errors formatting to the session_proto
This would be closer to the artiq-zynq implementation

Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-04-17 09:23:30 +08:00
Spaqin e9a153b985
runtime: implement distributed DMA 2023-03-22 11:16:25 +08:00
Spaqin 84e7515721
satman: distributed DMA support 2023-03-11 18:36:36 +08:00
Sebastien Bourdeauducq a9360823b1 libproto: remove obsolete Jdac packets 2023-03-02 20:29:09 +08:00
David Nadlinger b9f13d48aa firmware: Fix object references in tuples
Sine 8740ec3dd, the alignment() information from
"run-time type information" (i.e. the Tag type) is also
used when sending tuples to the host.
2022-12-19 00:57:46 +00:00
David Nadlinger 3d25092cbd firmware/rpc_proto: Remove unnecessary cast [nfc] 2022-11-14 22:50:38 +00:00
David Nadlinger dbbe8e8ed4 firmware/rpc_proto: Fix typo breaking receiving of arrays
This was introduced in 8740ec3dd5.
2022-11-14 22:49:45 +00:00
David Nadlinger 8740ec3dd5 firmware/rpc_proto: Fix size/alignment calculation for structs with tail padding
Also factors out duplicate code for (de)serializing
elements of lists and ndarrays, and replaces the rounding
calculations by the well-known, much faster power-of-two-only
bit-twiddling version.

GitHub: Fixes #1934.
2022-11-14 11:37:45 +08:00
Sebastien Bourdeauducq aff569b2c3 firmware: support 64-bit moninj probes 2022-03-17 19:56:07 +08:00
pca006132 ebfeb1869f firmware: use &CSlice for lists 2022-03-10 16:30:22 +08:00
Spaqin a85b4d5f5e
I2C API for PCA9547 support (#1860) 2022-03-01 15:07:53 +08:00
Steve Fan 34008b7a21
Backport of "fixes alignment and size problem" from artiq-zynq (#1841) 2022-01-28 20:49:55 +08:00
pca006132 4132c450a5 firmware: runtime changes for exception
Ported from:
M-Labs/artiq-zynq#162

This includes new API for exception handling, some refactoring to avoid
code duplication for exception structures, and modified protocols to
send nested exceptions and avoid string allocation.
2022-01-26 07:16:54 +08:00
Steve Fan 4a6bea479a
Host report for async error upon kernel termination (#1791)
Closes #1644
2021-12-04 13:33:24 +08:00
occheung eecd825d23 firmware: suppress warning 2021-09-10 13:25:12 +08:00
occheung 8fa47b8119 rpc: enforce alignment 2021-09-10 13:25:12 +08:00
occheung de0f2d4a28 firmware: adopt endianness protocol in artiq-zynq
Related:
artiq-zynq: M-Labs/artiq-zynq#126
artiq: #1588
2021-09-10 13:25:12 +08:00
occheung ebb9f298b5 proto_artiq: update alloc type path 2021-09-10 13:20:31 +08:00
Sebastien Bourdeauducq 9f94bc61ae missing part of 477b1516d 2021-08-12 12:55:37 +08:00
Sebastien Bourdeauducq 477b1516d3 remove profiler 2021-08-12 12:51:55 +08:00
Star Chen 6b88ea563d
talk to ICAP primitive to restart gateware (#1733) 2021-08-05 17:00:31 +08:00
Sebastien Bourdeauducq 92fd705990 increase memory allocated to comms CPU
See discussion in #1612.
2021-02-21 19:06:12 +08:00
pca006132 3832b261b1 firmware: optimize integer array/list rpc 2021-01-21 09:05:17 +01:00
Sebastien Bourdeauducq 90017da484 firmware: remove obsolete watchdog code (#1458) 2020-10-15 18:38:00 +08:00
pca006132 aac2194759 Ported rpc changes to or1k 2020-08-26 14:17:06 +08:00
Sebastien Bourdeauducq d8cd5023f6 runtime: expose more libm functions 2020-08-12 13:36:06 +08:00
David Nadlinger 8783ba2072 compiler/firmware: RPCs for ndarrays 2020-08-09 17:08:43 +01:00
pca006132 eb28d7be3a firmware/rpc: fixed typo 2020-07-16 15:15:47 +08:00
pca006132 f78d673079 firmware/rpc: added `#[repr(C)]` for structs.
Previously the structs are in repr(Rust) which has no layout guarantee.
2020-07-16 15:11:17 +08:00
Sebastien Bourdeauducq 05e8f24c24 sayma2: JESD204 synchronization 2019-10-18 23:28:47 +08:00