Commit Graph

750 Commits

Author SHA1 Message Date
688e643078 firmware: update rust to 2021-09-01 nightly 2024-05-17 15:36:56 +08:00
1e9070a2af testing: add coreanalyzer_proxy smoke test 2024-02-02 10:21:22 +08:00
392533f8ee subkernel lit tests: fix timeouts to no-timeouts 2024-02-01 18:56:07 +08:00
726cb092ca tests: add message passing tests 2024-01-31 11:46:07 +08:00
4956fac861 satman: allow subkernels start subkernels 2024-01-09 08:44:45 +08:00
ede0b37c6e devices: introduce notify_run_end API 2023-12-13 14:27:04 +08:00
85850ad9e8 wavesynth: remove 2023-12-13 13:36:21 +08:00
b168f0bb4b subkernel: separate tags and data 2023-10-17 12:18:03 +02:00
9c90f923d2 test: check return value of subprocesses in test_compile 2023-10-09 10:07:04 +08:00
David Nadlinger
08eea09d44 compiler: Catch escaping numpy.{array, full, transpose}() results
Function calls in general can still be used to hide escaping
allocations from the compiler (issue #1497), but these calls in
particular always allocate, so we can easily and accurately handle
them.
2023-10-09 09:00:26 +08:00
8d7194941e tests: add lit tests for subkernels 2023-10-08 17:11:51 +08:00
6eb81494c5 Allow using Python types in type annotations
This maps basic Python types (float, str, bool, np.int32, np.int64) as well as
some generics (list, tuple) to ARTIQ's own type instances.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-09-26 23:46:43 +01:00
586d97c6cb Fix type annotations with mixed tuples
The type checker/inferer visits every node in an AST tree, including
function return annotations. This means for a function definition like

    def f() -> TTuple([TInt32, TBool]):
      ...

We attempt to type check the list [TInt32, TBool], which generates the
unification constraint builtins.TBool ~ builtins.TInt. This causes an
internal error due to compiler weirdness.

We can avoid this by just nulling-out the return annotation in the
embedding stage. The return type isn't actually used anywhere (it's
extracted via the inspect module instead), so this is entirely safe.

Arguments aren't affected by this, as we already nulled out the
annotation (see visit_arg in embedding.py).

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-09-26 23:43:01 +01:00
David Nadlinger
892b0eaca2 compiler: Fix crash on multiple types with the same name
The original fix in 21574bdfa9
was incomplete, as it only addressed the TInstance types, but
not their linked (typ.constructor) TConstructor instances.

This would (potentially among other issues) cause assertion
errors in llvm_ir_generator due to the wrong associated globals
being referenced; see added test case for an example that
previously caused such a crash.

Also modified the name collision detection from O(len(type_map))
(so quadratic overall in the number of custom types) to cache
names in sets for O(1) lookup.
2023-09-26 23:31:21 +01:00
5c85cef0c2
Allow indexing tuples in kernel code
This only allows for indexing with a constant value (e.g. x[0]).

While slices would be possible to implement, it's not clear how to
preserve type inference here. The current typing rule is:

  Γ ⊢ x : τ  Γ ⊢ a : Int  Γ ⊢ b : Int
  ------------------------------------
             Γ ⊢ x[a:b] : τ

However, tuples would require a different typing rule, and so we'd need
to defer type inference if τ is a tyvar. I'm not confident that this
won't change behaviour, so we leave as-is for now.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-09-12 14:43:38 +01:00
df662c4262 flake: update llvmlite 2023-08-07 23:02:23 +08:00
8589da0723 test_arguments: rename ndecimals to precision 2023-07-18 08:02:42 +00:00
373fe3dbe7 test_datasets: add metadata tests 2023-07-10 02:33:59 +00:00
1af98727b7 test_scheduler: refactor dataset metadata support 2023-07-10 02:33:59 +00:00
115415d120 Revert "flake: update to LLVM 14 and llvmlite 0.40.0+master"
This reverts commit c25c0bd55a.
2023-06-14 18:54:33 +08:00
c25c0bd55a
flake: update to LLVM 14 and llvmlite 0.40.0+master 2023-06-09 13:25:08 +08:00
c6b29b30fb Revert "flake: update to LLVM 14 and llvmlite 40"
This reverts commit 748969c21e.
2023-05-31 19:36:43 +08:00
748969c21e
flake: update to LLVM 14 and llvmlite 40
Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-05-30 16:47:59 +08:00
0e7e30d46e test: fix hardware testbench trying to write to ARTIQ_ROOT 2023-04-30 17:16:36 +08:00
d5a7755584 test: improve tmpdir names 2023-04-30 17:15:34 +08:00
4056168875 master: store datasets in LMDB (#1743) 2023-04-24 17:34:30 +08:00
9331911139
add tests for client submit functionality 2023-04-24 11:43:24 +08:00
0a37a1a4c1 Merge branch 'syncrtio' 2023-01-12 12:58:19 +08:00
73a4ef89ec scheduler: make asyncio loop a keyword-only argument, like in other asyncio APIs 2023-01-11 18:45:35 +08:00
c8ab6c1b2b test_worker: fix asyncio event loop management 2023-01-10 12:36:33 +08:00
a96bbd8508 test_scheduler: fix asyncio event loop management 2023-01-10 12:30:08 +08:00
5da9794895 remove Sayma and Metlino support 2023-01-06 17:41:12 +08:00
David Nadlinger
88684dbd2a test_embedding: Fix up spelling in FIXME comment [nfc] 2022-12-19 01:02:51 +00: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
1852491102
add channel names to RTIO errors 2022-12-02 16:27:03 +08: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
kk1050
4ddd2739ee
add log_tuples function (#1896)
Co-authored-by: kk105 <kkl@m-kabs.hk>
2022-06-06 18:41:46 +08:00
ca614a3eea use asyncio get/new_event_loop as recommended 2022-05-31 23:06:54 +08:00
David Nadlinger
8a7af3f75c compiler: Fix "nowrite" miscompilation for sret functions
This affected e.g. rtio_input_timestamped_data().
2022-05-07 21:43:55 +01:00
David Nadlinger
b2b84b1fd6 test: Fixup 6b5c390d4 typo 2022-04-22 00:29:03 +01:00
David Nadlinger
6b5c390d48 compiler: Fix #1871 (array() breaks math functions)
GitHub: Fixes #1871.
2022-04-22 00:12:20 +01:00
bbb2c75194 add aqctl_moninj_proxy 2022-03-18 17:02:50 +08:00
ac55da81d8 core: support precompilation of kernels 2022-03-06 18:25:18 +08:00
17ecd35530 test_i2c: fix for missing readback 2022-03-01 17:40:20 +08:00
a85b4d5f5e
I2C API for PCA9547 support (#1860) 2022-03-01 15:07:53 +08:00
1b80746f48 Remove outer_final
We don't need to know whether there's a outer finally block
that's already implicit in the current break and continue
target.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-02-24 19:58:33 +08:00
Steve Fan
34008b7a21
Backport of "fixes alignment and size problem" from artiq-zynq (#1841) 2022-01-28 20:49:55 +08:00
9d43762695 test: fixed lit tests
Note that because we changed exception representation from using string
names as exception identifier into using integer IDs, we need to
initialize the embedding map in order to allocate the integer IDs. Also,
we can no longer print the exception names and messages from the kernel,
we will need the host to map exception IDs to names, and may need the
host to map string IDs to actual strings (messages can be static strings
in the firmware, or strings stored in the host only).

We now check for exception IDs for lit tests, which are fixed because we
preallocated all builtin exceptions.
2022-01-26 07:16:54 +08:00
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
536b3e0c26 test: added test case for nested exceptions and try 2022-01-26 07:16:54 +08:00