Commit Graph

73 Commits (1852491102752c83f6689a316e61b8000454d4fa)

Author SHA1 Message Date
Egor Savkin 1852491102
add channel names to RTIO errors 2022-12-02 16:27:03 +08:00
David Nadlinger 950b9ac4d6 firmware: More explicit panic message if stack guard is tripped
This should give even only mildly technical users a
chance to figure out what's going on, which empirically
is not the case for a plain Exception(LoadFault) without
further context.
2022-11-24 16:54:49 +00:00
David Nadlinger 4819016a3c firmware/ksupport: Document rpc_recv alignment requirements [nfc] 2022-11-14 11:37:45 +08:00
pca006132 ebfeb1869f firmware: use &CSlice for lists 2022-03-10 16:30:22 +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
occheung 6d3164a912 riscv: print mtval on panic 2021-10-16 17:42:24 +08:00
occheung 0a59c889de satman/kern: init locked PMP on startup 2021-10-16 17:42:24 +08:00
occheung b091d8cb66 kernel: flush cache before mod_init
This could be necessary as redirecting instructions from D$ directly to I$ as it seems.
Related: https://github.com/SpinalHDL/VexRiscv/issues/137
2021-09-10 13:25:12 +08:00
occheung 09ffd9de1e dma: fix timestamp fetch 2021-09-10 13:25:12 +08:00
occheung c6ba0f3cf4 ksupport: fix dma cslice (ffi) 2021-09-10 13:25:12 +08:00
occheung eecd825d23 firmware: suppress warning 2021-09-10 13:25:12 +08:00
occheung af263ffe1f ksupport: fix rpc, cache signature (FFI)
The reason of the borrow stuff is explained in M-Labs/artiq-zynq#76 (artiq-zyna repo).
As for `cache_get()`, compiler will perform stack allocation to pre-allocate the returned structure, and pass to cache_get alongside the `key`.
However, ksupport fails to recognize the passed memory, so it will always assume the passed memory as the key.
2021-09-10 13:25:12 +08:00
occheung 29a2f106d1 ksupport: replace asm with llvm_asm 2021-09-10 13:25:12 +08:00
occheung 1b8b4baf6a ksupport: fix panic, libc, unwind 2021-09-10 13:25:12 +08:00
occheung 905330b0f1 ksupport: handle riscv exceptions 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 90017da484 firmware: remove obsolete watchdog code (#1458) 2020-10-15 18:38:00 +08:00
David Nadlinger d3508b014f firmware: Add whitespace between panic handler location and message 2019-12-17 19:59:59 +00:00
whitequark dd829afebd firmware: fix another TOCTTOU race in sync/async RPC code. 2018-11-12 15:42:07 +00:00
whitequark 583bba8777 Revert "firmware: workaround for RPC failures"
This reverts commit 59033d2588.
2018-11-12 15:36:36 +00:00
Sebastien Bourdeauducq 59033d2588 firmware: workaround for RPC failures 2018-11-12 19:51:54 +08:00
Sebastien Bourdeauducq 84a6b3d09b runtime: fix DMA recording after now-pinning 2018-11-10 14:14:55 +08:00
Sebastien Bourdeauducq c990b5e4f1 Merge remote-tracking branch 'origin/master' into new 2018-11-08 20:21:56 +08:00
David Nadlinger 9740032a94 firmware: Fix dma_record_output_wide 2018-11-08 11:06:43 +00:00
Sebastien Bourdeauducq 8caea0e6d3 gateware,runtime: optimize RTIO kernel interface further
* now pinning (TODO: atomicity)
* for inputs, merge request and timeout registers
2018-11-08 18:29:24 +08:00
Sebastien Bourdeauducq 3d0c3cc1cf gateware,runtime: optimize RTIO output interface
* reduce address to 8 bits
* merge core, channel and address into 32-bit pre-computable "target"
* merge we register into data register
2018-11-07 23:39:58 +08:00
Sebastien Bourdeauducq d38755feff drtio: implement destination state checks on operations 2018-09-15 15:55:45 +08:00
whitequark 38d60100ff firmware: optimize dma_record_output.
This removes a number of bounds checks and adds a fast path for
outputting exactly one word to DMA, which is the most common
operation.
2018-08-12 19:17:45 +00:00
whitequark 2648b1b7a1 firmware: migrate to Rust 1.28.0.
This also updates / is a prerequisite for updating smoltcp.

Rationale for changes made:
  * compiler_builtins is now shipped in the rust prefix.
  * rustc's libpanic_unwind no longer works for us because it
    has a hard dependency on Box (and it's a horrible hack);
    fortunately, we only ever needed a personality function
    from it.
  * panic and oom handlers are now set in a completely different
    way.
  * allocators are quite different (and finally stable).
  * NLL caused internal compiler errors in runtime, so code using
    NLL was rewritten to not rely on it and it was turned off.
2018-08-12 19:17:45 +00:00
whitequark a74958f01f ksupport: raise RuntimeError on reraise with no inflight exception.
Fixes #1123.
2018-08-07 05:53:13 +00:00
whitequark b6dd9c8bb0 runtime: support builds without RTIO DMA.
Fixes #1079.
2018-06-23 00:56:21 +00:00
whitequark b54926134c firmware: update the signature of #[lang="panic_fmt"]. 2018-05-15 15:05:19 +00:00
whitequark 140ca729aa firmware: rename io::Error::{UnexpectedEof→UnexpectedEnd}.
We don't even have files.
2018-05-15 08:27:45 +00:00
whitequark ce0593315b firmware: move {ProtoRead,ProtoWrite} to the root of libio. 2018-05-15 08:16:09 +00:00
whitequark ae50196186 firmware: rename libproto to libproto_artiq.
libproto_artiq only has ARTIQ-specific protocols.
2018-05-14 18:09:44 +00:00
whitequark 02b8426f60 firmware: rename libboard to libboard_misoc.
By analogy with libbuild_misoc. Hopefully one day it actually gets
moved to misoc...
2018-05-14 18:09:44 +00:00
whitequark 1ff42683d9 firmware: merge libamp into libboard_artiq.
All gateware interfaces live in libboard_artiq, but libamp predates
libboard_artiq.
2018-05-14 17:33:25 +00:00
whitequark 6a10d54432 firmware: migrate rpc_proto to new libio.
This closes an old and horrible issue in that some code in ksupport
may implicitly try to allocate and we'll never know until it crashes
at runtime inside liballoc_stub.

This also removes liballoc_stub.
This also removes ReadExt and WriteExt from libproto.
Hooray!
2018-05-14 17:26:59 +00:00
whitequark 623614f835 Update LLVM to 6.0.0 and Rust to 1.25.0. 2018-05-01 08:57:37 +00:00
Sebastien Bourdeauducq 928d5dc9b3 drtio: raise RTIOLinkError if operation fails due to link lost (#942) 2018-03-04 01:02:53 +08:00
Sebastien Bourdeauducq dc593ec0f0 Merge branch 'rtio-sed' into sed-merge 2018-01-10 12:04:54 +08:00
whitequark b8f3d28bc0 firmware: update compiler_builtins dependency and move it to libboard.
This is so that we only specify it once.
2017-12-31 09:16:11 +00:00
whitequark 7687a34285 firmware: remove dependency on compiler-rt. 2017-12-28 04:08:29 +00:00
whitequark 4dfe71676e firmware: remove dependency on libbase. 2017-12-28 04:03:27 +00:00
whitequark 3eec15c01d firmware: fix compatibility with newer rustc. NFC. 2017-12-25 17:16:05 +00:00
whitequark 2404a0d8c8 runtime: allow #[cfg(not(has_rtio))] builds. 2017-11-03 15:49:30 +00:00
whitequark 73c76ebb9a firmware: eliminate most transmutes and document the rest. NFC. 2017-10-02 03:09:46 +00:00
Sebastien Bourdeauducq 5437f0e3e3 rtio: make sequence errors consistently asychronous 2017-09-29 14:40:06 +08:00
whitequark 7799413a41 firmware: update Rust from 1.18.0 to 1.20.0. 2017-09-24 22:51:44 +00:00
Sebastien Bourdeauducq 8399f8893d add kernel access to non-realtime SPI buses (#740) 2017-06-18 12:45:07 +08:00
Sebastien Bourdeauducq fe05aede78 firmware: DmaPlayback → DMARetrieve 2017-04-19 11:11:42 +08:00