Commit Graph

229 Commits

Author SHA1 Message Date
mwojcik 50262b3f0c runtime: link_thread -> link_task 2021-10-06 07:59:55 +02:00
mwojcik 827c6c1306 runtime: switch to libio/libboard_artiq, add DRTIO mastering support
Reviewed-on: #137
Co-authored-by: mwojcik <mw@m-labs.hk>
Co-committed-by: mwojcik <mw@m-labs.hk>
2021-10-06 13:05:45 +08:00
mwojcik e3d3cb2311 si5324: bring on par with mainline ARTIQ (#132)
si5324 driver in runtime should be now equal in function to the one in artiq.

kasli-soc has no way of doing a hard reset on the peripheral, but zc706 does.

Reviewed-on: #132
Co-authored-by: mwojcik <mw@m-labs.hk>
Co-committed-by: mwojcik <mw@m-labs.hk>
2021-08-04 09:12:38 +08:00
Sebastien Bourdeauducq f543501012 si5324: remove debug print 2021-08-02 14:14:59 +08:00
Sebastien Bourdeauducq 111ac0c716 runtime: clock Si5324 from its crystal 2021-07-30 17:07:58 +08:00
Sebastien Bourdeauducq 8128dc0b56 Revert "kasli-soc: work around I2C breakage (#130)"
This reverts commit f1fd55dee5.
2021-07-30 16:55:06 +08:00
Sebastien Bourdeauducq f1fd55dee5 kasli-soc: work around I2C breakage (#130) 2021-05-29 17:13:41 +08:00
Sebastien Bourdeauducq 21d98711c1 use new smoltcp error code 2021-05-29 17:13:22 +08:00
Sebastien Bourdeauducq 0ae2138034 kasli-soc: preliminary si5324 support 2021-05-29 16:15:27 +08:00
Sebastien Bourdeauducq 506c741238 support absence of gateware RTIO clock selection mux
Hydra zc706-hitl-tests Hydra build #130237 of artiq:zynq:zc706-hitl-tests Details
2021-02-15 21:41:30 +08:00
Astro fcb38fae6c runtime: disable TCP delayed ack
Hydra zc706-hitl-tests Hydra build #129074 of artiq:zynq:zc706-hitl-tests Details
2021-02-08 03:24:18 +01:00
pca006132 bb65074254 updated zynq-rs and IRQ handling
Hydra zc706-hitl-tests Hydra build #126930 of artiq:zynq:zc706-hitl-tests Details
2021-01-28 12:56:54 +08:00
pca006132 c2a6fb72f7 updated zynq-rs dependency
Hydra zc706-hitl-tests Hydra build #122988 of artiq:zynq:zc706-hitl-tests Details
2021-01-26 12:38:09 +08:00
pca006132 faa335461d runtime: modified protocols to use device endian 2021-01-22 13:36:38 +08:00
pca006132 be01fbd943 runtime/irq: use assembly for naked IRQ handler
and solves the bug introduced due to stack unwinding...
2021-01-18 17:08:04 +08:00
pca006132 9e8b554c6d runtime/kernel/core1: use correct ABI 2021-01-18 16:43:30 +08:00
pca006132 b4ff6dda24 runtime: use naked function for IRQ
non-naked IRQ would somehow trigger interrupts after several kernel
restarts, investigating
2021-01-18 10:38:50 +08:00
pca006132 35204d4716 fixed new compiler warnings 2021-01-15 17:55:58 +08:00
Sebastien Bourdeauducq 07b425a67a fix other compilation warnings 2020-11-16 14:57:20 +08:00
Sebastien Bourdeauducq 57ae8619f8 remove unnecessary no_mangle
no_mangle does nothing on extern items as per https://github.com/rust-lang/rust/issues/78989#issuecomment-726163973

Closes #115
2020-11-16 14:51:30 +08:00
Astro 9259cffeb2 i2c: add stubs for targets without i2c 2020-11-12 15:26:06 +01:00
David Nadlinger 7c336f7770 kernel/api: Add additional binary libm functions
Also factored out (f64, f64) -> f64 libm wrappers into
a macro, similar to the unary ones.
2020-11-11 01:24:44 +01:00
Sebastien Bourdeauducq 291a782db0 fix compiler warning
Feature is now stable.
2020-11-06 12:22:34 +08:00
pca006132 7dbffadf08 mgmt: implemented config write 2020-11-04 21:16:47 +08:00
pca006132 a374d8a02f runtime/kernel/dma: reduced replay overhead
We can just flush the cache once when we get the handle, instead of
everytime before replay.
2020-09-09 21:25:03 +08:00
pca006132 03d9827a5a acpki: working 2020-09-09 21:24:49 +08:00
Sebastien Bourdeauducq 2fe73505c8 improve i2c error reporting 2020-09-06 00:38:28 +08:00
Sebastien Bourdeauducq 36d8ffec3b expose i2c to kernels 2020-09-06 00:11:19 +08:00
pca006132 5e4bf8bbf7 runtime/comms: Faster RPC alloc
We do busy polling for some time before doing await, for small
allocations we could avoid the context switching and reduce the latency.
2020-09-03 16:58:44 +08:00
pca006132 cdc8ad8aee runtime/kernel/control: fixed memory leak 2020-09-03 16:51:51 +08:00
pca006132 ae07c05db4 runtime: optimize for speed and fix deadlock
The previous method of taking the channel could cause deadlock, we now
use semaphore to signal if the channel is available instead of busy
polling the mutex.
2020-09-02 10:15:52 +08:00
Sebastien Bourdeauducq b0706f470d runtime: set default log level to Info 2020-09-01 17:11:21 +08:00
pca006132 050b2457a4 runtime/main: removed bitstream loading code 2020-09-01 15:43:54 +08:00
pca006132 42f94487cf split config code into libconfig 2020-09-01 14:48:09 +08:00
pca006132 d474cf58a5 runtime/rpc: optimizations for list and arrays
Requires https://github.com/m-labs/artiq/pull/1510
This is the commit producing the result in the table.
2020-08-26 13:47:41 +08:00
pca006132 71427f8ec8 runtime/proto_async: simplify functions
And the compiler can use its intrinsic for byte rev.
2020-08-26 13:46:51 +08:00
pca006132 321a8e1522 runtime/kernel/core1: reset rtio after interrupted 2020-08-25 14:51:39 +08:00
pca006132 0fb278f7cb runtime/kernel/core1: allows getting backtrace when kernel is not loaded 2020-08-25 14:51:39 +08:00
pca006132 fa187fb37a runtime/kernel: use mutable static for shared channel
Mutex would prevent restart if we failed while waiting for RPC.
2020-08-25 14:51:39 +08:00
pca006132 e592efb2b8 enabled L2 cache and optimized ethernet 2020-08-25 14:51:39 +08:00
Astro 760f46a115 update dependencies 2020-08-17 19:17:42 +02:00
David Nadlinger 6ccd0cb389 runtime/kernel: Expose libm::atanh 2020-08-09 20:06:09 +01:00
David Nadlinger 63250240d2 runtime/kernel: Expose __powidf2 2020-08-09 19:17:38 +01:00
David Nadlinger 9f898dd2b8 runtime/rpc: Support new TArray layout (ndarrays)
This is a port of the respective commit in the main ARTIQ
repository.
2020-08-09 19:17:38 +01:00
Sebastien Bourdeauducq 8dabc8e6fd runtime: remove access to obsolete i_overflow_reset CSR 2020-08-06 20:23:36 +08:00
Sebastien Bourdeauducq 1eeee43d64 acpki: implement input interface 2020-08-06 18:15:34 +08:00
pca006132 0354699ae3 runtime/kernel/dma: fixed missing end of buffer marker.
The DMA transfer would halt before.
2020-08-06 14:00:20 +08:00
Sebastien Bourdeauducq 7873565917 runtime: expose libm tan 2020-08-06 11:45:41 +08:00
pca006132 05e1614313 runtime/kernel: fixed duration bug.
Fixes #89.
2020-08-06 11:12:24 +08:00
Sebastien Bourdeauducq 323191b9fc runtime: expose more libm functions 2020-08-06 10:32:20 +08:00
pca006132 5becf0af0a runtime/kernel: fixed memory corruption for cache and DMA. 2020-08-06 10:29:31 +08:00
pca006132 e7752a3d6d runtime/kernel: fixes core0 memory leak.
Fixes #85
2020-08-06 09:39:49 +08:00
Sebastien Bourdeauducq de2d7ecf48 typo 2020-08-05 18:52:08 +08:00
pca006132 c85e85aa6d runtime/logger: use blocking wait.
Fixes #84 using the first solution.

If the performance is considered too slow,
we can do the second option later.
2020-08-05 18:51:27 +08:00
pca006132 4b6c5d5679 runtime/kernel: store DMA and cache buffer on core0.
Closes #77.
2020-08-05 15:33:40 +08:00
Sebastien Bourdeauducq 72427dbebb runtime: cleanup core_log 2020-08-05 00:40:54 +08:00
Sebastien Bourdeauducq 6d654de3d5 runtime: implement core_log 2020-08-04 23:27:51 +08:00
Sebastien Bourdeauducq 3092bfc21a runtime: expose __aeabi_idivmod to kernel 2020-08-04 22:45:28 +08:00
Sebastien Bourdeauducq b915176b29 runtime: implement acpki RTIO output 2020-08-04 17:32:43 +08:00
pca006132 fc21fcc920 runtime/comms: removed sync_channel hack.
Fixes #80
2020-08-04 14:40:02 +08:00
pca006132 6a4d871917 runtime/irq: use spinlock functions instead of asm.
Closes #81
2020-08-04 14:40:02 +08:00
Sebastien Bourdeauducq 8337c9173e runtime: share rtio_log format function 2020-08-04 13:27:18 +08:00
Sebastien Bourdeauducq f8d4036451 add ACP kernel initiator
Based on work by Chris Ballance
https://github.com/m-labs/artiq/issues/1167#issuecomment-427188287
#55

Work-in-progress, only gateware part and build system, untested.
2020-08-04 13:15:26 +08:00
Sebastien Bourdeauducq c9bac028bf dma: call rtio module to get time cursor position
More portable across RTIO implementations.
2020-08-04 13:14:00 +08:00
pca006132 56e7cc822c runtime/comms: limited concurrent connections to 1 only. 2020-08-04 10:31:03 +08:00
pca006132 d58a3ef12c runtime/comms: restart core1 before kernel load. 2020-08-04 10:17:19 +08:00
pca006132 fa00ab211d Updated zc706 dependency and fixed compiler errors. 2020-08-04 10:15:57 +08:00
Sebastien Bourdeauducq 7caee2bf88 improve DMA logging 2020-07-30 22:25:49 +08:00
Sebastien Bourdeauducq 2e7090a359 remove unused import 2020-07-30 22:07:44 +08:00
Astro b388b529ad dyld: remove KERNEL_EXIDX_START/END globals, move dl_unwind_find_exidx() into runtime::kernel::core1
Gitea issue #16
2020-07-27 19:56:06 +02:00
Sebastien Bourdeauducq 7f983a453d implement core device cache 2020-07-25 17:04:40 +08:00
Sebastien Bourdeauducq 630dcc274e fix compilation warning with new rustc 2020-07-25 12:15:50 +08:00
Sebastien Bourdeauducq e64f59723c dma: use const initializer for manager 2020-07-25 12:12:56 +08:00
Sebastien Bourdeauducq 26874030fc retry RTIO PLL lock 2020-07-25 11:15:33 +08:00
pca006132 0ce45b145e kernel: proper type for static shared variables.
* Changed the KERNEL_CHANNEL_* to Mutex<T> with proper type, remove the
  need for unsafe.
* Exposed a const pointer to KernelImage, with UnsafeCell holding
  the library field for unbind with interior mutability.
2020-07-24 12:24:01 +08:00
pca006132 0310421085 RTIO DMA: Compiled but not working.
* Cache flush should be done before playback instead when getting the
  handler.
* `csr::rtio_dma::enable_read()` would loop forever, probably bug in the
  gateware.
2020-07-23 17:04:15 +08:00
pca006132 64dad88a32 Kernel exception: fixed top level finally. (#70)
Fixes #70.
2020-07-23 14:09:15 +08:00
Astro 4846f2891b use blocking timer api, update microseconds api 2020-07-22 23:58:55 +02:00
Sebastien Bourdeauducq 9b07468e50 add libm functions from legacy runtime 2020-07-21 22:58:56 +08:00
pca006132 d11e3fdad8 runtime/mgmt: mgmt.rs consistency
Closes #67.
2020-07-21 13:54:32 +08:00
Sebastien Bourdeauducq e0560a2db9 expose libm functions to kernel 2020-07-21 13:50:33 +08:00
Sebastien Bourdeauducq 21135c6a41 analyzer: report AXI bus errors 2020-07-20 19:51:22 +08:00
Sebastien Bourdeauducq 0b47ac75f0 comms,mgmt: log connections as soon as they arrive 2020-07-20 19:09:56 +08:00
Sebastien Bourdeauducq 8c60947291 moninj: better connection logging 2020-07-20 19:07:44 +08:00
Sebastien Bourdeauducq 4af29e8eca comms: report error on incorrect connection start pattern 2020-07-20 19:07:12 +08:00
Sebastien Bourdeauducq d65e893d1c more conservative RTIO PLL reset timing 2020-07-20 14:19:13 +08:00
Sebastien Bourdeauducq db2a8e7726 implement RTIO log 2020-07-20 14:10:46 +08:00
Sebastien Bourdeauducq f5db0e06f4 update dependencies, use new libasync smoltcp recv API 2020-07-19 16:16:39 +08:00
Sebastien Bourdeauducq 3ec9788eb1 proto_async: always consume one byte in recv 2020-07-19 16:07:55 +08:00
Sebastien Bourdeauducq 6e75741aa3 analyzer: remove debug print 2020-07-16 18:37:15 +08:00
pca006132 a9f725dd33 kernel: added error message after uncaught exception 2020-07-16 17:11:35 +08:00
pca006132 caef2a9f84 runtime/panic: prevent nested panic and added core ID in panic msg. 2020-07-16 17:11:35 +08:00
Sebastien Bourdeauducq 16158acfa9 analyzer: close connection gracefully 2020-07-16 17:10:24 +08:00
pca006132 84630d66e3 rpc: added `#[repr(C)]` for structs. 2020-07-16 15:48:17 +08:00
pca006132 4457af7277 rpc: Fixed alignment problem.
Fixes issue #42.

Previously there was no fix for the variable alignment.
We calculate the position of the variable based on the size
of the previous variable, so we could break the alignment requirement
for variables. For example, having a `i64` after `bool` could break
the alignment required for `i64` and trigger DataAbort or data
corruption.

However, this requires the same data layout and LLVM type for the
variables. If this cannot be maintained, this would break the alignment
on the other side of the RPC, either from host to kernel or kernel to
host.
2020-07-16 14:06:39 +08:00
Sebastien Bourdeauducq 2e10922715 analyzer: implement firmware part 2020-07-16 11:47:55 +08:00
Sebastien Bourdeauducq b62fbce826 mgmt: log incoming connection 2020-07-16 11:36:26 +08:00
pca006132 92405ffe91 logger: changed from RefCell to Mutex. 2020-07-15 17:04:16 +08:00
pca006132 2568d62865 mgmt: fixed pull log 2020-07-15 16:05:00 +08:00
pca006132 8e3574080c core1: added cache flush and barriers. 2020-07-14 10:53:35 +08:00