Commit Graph

150 Commits

Author SHA1 Message Date
whitequark a820ae98cf ksupport: avoid allocations on I/O error paths.
Fixes #715.
2017-04-21 17:20:50 +00:00
whitequark b913d1d6f2 runtime: make a copy of startup/idle kernel firmware before loading.
Fixes #716.
2017-04-21 16:46:40 +00:00
whitequark 726ee7370a runtime: update smoltcp.
This brings in correct TIME-WAIT handling. Fixes #722.
2017-04-21 16:08:04 +00:00
whitequark 0e68eaa879 runtime: print a heap dump on out-of-memory condition. 2017-04-21 14:48:10 +00:00
whitequark db494967c5 firmware use Rust 0.18.0. 2017-04-19 09:38:24 +00:00
Sebastien Bourdeauducq fe05aede78 firmware: DmaPlayback → DMARetrieve 2017-04-19 11:11:42 +08:00
whitequark c6e8d5c901 runtime: allow setting UART log level explicitly.
This is way more convenient than commenting out parts
of session.rs when debugging.
2017-04-15 08:27:18 +00:00
whitequark 0531dc45c3 DMA: erase trace before re-recording it.
Or we could needlessly OOM replacing a large trace.
2017-04-15 07:48:02 +00:00
whitequark 9dfe9c1248 DMA: improve recording performance.
This commit moves DMA serialization code to the kernel CPU
(to cope with the existence of rtio_output_wide) and batches
the resulting sequences. This results in less data being transferred
between kernel and comms CPUs (24 octets with one pointer before,
18 octets with no pointers now, for the common case of rtio_output),
but most importantly reduces cache flushes, which now happen
once per 64k octets.

On average, it now takes about 15us to record a single RTIO event
in a DMA trace.

Fixes #712.
2017-04-15 07:29:52 +00:00
whitequark ea753bed17 runtime: advise to set panic_reboot=1 on panic. 2017-04-15 07:29:36 +00:00
whitequark 296dc3b0c4 artiq_coreboot: allow hot-rebooting the device. 2017-04-11 03:24:24 +00:00
whitequark 14ae1cc100 runtime: advance now on DMA replay.
Fixes #700.
2017-04-05 18:34:36 +00:00
Sebastien Bourdeauducq 008678b741 drtio: add infrastructure for reporting busy/collision errors 2017-04-02 23:45:55 +08:00
Sebastien Bourdeauducq 0a687b7902 drtio: report satellite errors through firmware 2017-04-01 12:18:00 +08:00
whitequark d04d7ed120 runtime: show a more informative message for interrupted sessions.
Fixes #690.
2017-03-29 03:36:49 +00:00
whitequark 948ed6fb0a Extract core device management interface from session interface (#691). 2017-03-29 03:36:21 +00:00
Sebastien Bourdeauducq 2c3f720301 runtime: report asynchronous RTIO errors (collision, busy) in log. Closes #681 2017-03-27 17:14:14 +08:00
whitequark c586035caa runtime: add an option to reboot after a panic. 2017-03-14 09:02:28 +00:00
whitequark 5bbb05362b runtime: update smoltcp. 2017-03-07 11:36:28 +00:00
whitequark d52723d5bc runtime: allow setting log level in configuration. 2017-03-07 11:36:28 +00:00
whitequark 795a3e24d8 artiq_coreboot: block until hotswap image is actually received. 2017-03-07 11:36:28 +00:00
whitequark b0cdef3211 firmware: implement hotswap through artiq_coreboot tool. 2017-03-06 16:01:28 +00:00
whitequark 98454e9bda runtime: remove unnecessary dcache flush.
Data cache is write-through, so sending data to DMA doesn't need
a flush.
2017-03-04 09:46:55 +00:00
whitequark 924ae73000 firmware: fix DMA trace alignment and flush caches. 2017-03-04 09:40:22 +00:00
whitequark 4f94709e9f firmware: move packet dumps to the DEBUG log level. 2017-03-03 06:11:35 +00:00
whitequark e8c093deb3 Allow changing runtime log level without recompilation.
This shouldn't affect performance much, as the log crate guards
every log statement with a branch, adding just two instructions.
2017-03-03 06:06:26 +00:00
whitequark fe77fcc45f firmware: fix a warning. 2017-03-03 05:35:28 +00:00
whitequark 3070a2fac1 runtime: fix more bugs in DMA trace encoder. 2017-03-03 05:15:54 +00:00
whitequark a4ece19614 Implement DMA playback. 2017-02-28 21:28:40 +00:00
Sebastien Bourdeauducq 7481eaff52 moninj: use smaller network buffer 2017-02-27 11:44:29 +08:00
whitequark 88bf7d2233 firmware: specialize protocol read/write functions.
Before this commit, proto::io::{read,write}_* functions were taking
a &mut {Read,Write}. This means a lot of virtual dispatch.
After this commit, all these functions are specialized for
the specific IO trait.

This could be achieved with just changing the signature from
  fn read_x(reader: &mut Read)
to
  fn read_x<R: Read>(reader: &mut R)
but the functions were also grouped into ReadExt and WriteExt
traits as a refactoring.

Initially, it was expected that the generic traits from
the byteorder crate could be used, but they require endianness
to be specified on every call and thus aren't very ergonomic.
They also lack the equivalent to our read_string and read_bytes.

Thus, it seems fine to just define a slightly different extension
trait.

This also optimized the test_rpc_timing test: 1.7ms→1.2ms.
2017-02-26 18:24:37 +00:00
Sebastien Bourdeauducq dff23293c7 Merge branch 'master' of github.com:m-labs/artiq 2017-02-27 01:05:40 +08:00
whitequark 5d3b00cf12 Implement recording of DMA traces on the core device. 2017-02-26 02:50:20 +00:00
whitequark a07bd918f0 firmware: use Rust naming conventions for enum variants. 2017-02-25 22:34:11 +00:00
whitequark 2a81819eb0 firmware: restructure to avoid #[path = "..."] mod ...;
Such code is fragile, introduces mess in dependencies, and
inflates compile times.
2017-02-25 17:54:14 +00:00
Sebastien Bourdeauducq 5a16660aa2 runtime: new moninj protocol, TCP-based, with DRTIO support 2017-02-25 12:07:00 +08:00
whitequark 04ad267055 firmware: rewrite the dynamic linker in Rust. 2017-02-24 18:57:29 +00:00
Sebastien Bourdeauducq 016743f079 libdrtioaux: do not attempt to access non-existent DRTIO gateware 2017-02-22 16:45:02 +08:00
Sebastien Bourdeauducq 257527629a firmware: use aux ping to determine when DRTIO satellite is ready 2017-02-22 15:26:32 +08:00
Sebastien Bourdeauducq 9501d37378 firmware: wait longer for Si5324 lock + more monitoring 2017-02-18 17:24:46 +08:00
whitequark 52a046d0fd conda: roll cargo back to 0.11.0, then fix revision of compiler_builtins. 2017-02-05 15:25:43 +00:00
whitequark c39394b4d5 firmware: port the exception handling routines to Rust. 2017-02-04 08:21:07 +00:00
whitequark b9cbedceb1 firmware: migrate last vestiges of the old runtime build system. 2017-02-03 12:59:35 +00:00
whitequark cde2054926 firmware: do not link to C code in runtime and satman. 2017-02-03 12:12:41 +00:00
whitequark fd8b11532f compiler, firmware: use Pascal strings everywhere.
This removes a large amount of very ugly code, and also simplifies
the compiler and runtime.
2017-02-03 11:53:27 +00:00
whitequark 259319e456 firmware: use compiler_builtins crate instead of our compiler-rt.
This cannot be done for ksupport yet because compiler_builtins
misses most soft-float operations.
2017-02-02 10:55:35 +00:00
whitequark 44a9a79f96 firmware: port allocator to Rust. 2017-02-02 10:55:35 +00:00
whitequark 3b54736c02 firmware: port flash storage management to Rust. 2017-02-02 05:26:06 +00:00
whitequark 6fd149f048 Show a message when interrupting a running kernel (except idle kernel).
Fixes #625.
2017-01-31 22:53:38 +00:00
whitequark 7a14cf503b firmware: fix a warning. 2017-01-31 22:19:45 +00:00
whitequark 680a7067a8 firmware: use ? instead of try! everywhere. 2017-01-31 22:18:59 +00:00
whitequark ee1b2fa3ea compiler: swap the order of ptr/len fields in lists.
This is to make them match the Rust slices.
Once the cslice crate becomes #![no_std] we'll also use its (tidier)
conversion functions.
2017-01-31 22:11:13 +00:00
whitequark b95db4fa4e Use four ethmac buffers instead of two.
This should address an issue where the host sends a packet burst,
the second packet in a burst gets dropped, the rest also gets
dropped since smoltcp doesn't do reassembly, and the entire dance
is repeated on every retransmit.
2017-01-30 07:42:27 +00:00
Sebastien Bourdeauducq 54295b1699 firmware: use has_ad9154 instead of has_converter_spi for conditional compilation
DRTIO designs do not have a JESD core yet, so we need to support converter SPI buses with only the clock chip.
2017-01-30 11:03:55 +08:00
whitequark be0953d98f firmware: unbreak Io::sleep().
Fixes #663.
2017-01-27 18:18:02 +00:00
Sebastien Bourdeauducq 7b2eba9fbd firmware: misoc_registers -> misoc_cfg 2017-01-27 23:28:00 +08:00
whitequark 6891b5fcfd firmware: accept sessions even when startup kernel is running.
Fixes #625.
Fixes #649.
2017-01-27 13:46:32 +00:00
whitequark 24ce9a057b firmware: add missing try!. 2017-01-27 13:46:32 +00:00
whitequark 74b910e97d In case of a load error, pass the reason to host interpreter.
Fixes #654.
2017-01-27 12:49:48 +00:00
whitequark 50f234bea4 firmware: update smoltcp to take advantage of TCP MSS option. 2017-01-27 03:47:57 +00:00
whitequark b7f6bfffeb firmware: fix embedding of software version during build. 2017-01-26 17:40:29 +00:00
whitequark 31e5f9a810 firmware: read MAC/IP address configuration from flash. 2017-01-26 17:40:29 +00:00
whitequark 7b6de36d1d firmware: cap loglevel at DEBUG to increase RPC throughput ~3x. 2017-01-25 06:50:56 +00:00
whitequark 3c177c6d71 firmware: update smoltcp, to fix analyzer dump extraction. 2017-01-25 06:36:26 +00:00
whitequark 6721c1e82f firmware: update smoltcp. 2017-01-25 04:08:06 +00:00
whitequark 6414e40deb firmware: fix race condition between TCP listen and accept. 2017-01-25 00:17:46 +00:00
whitequark 2de3770c06 firmware: rewrite cache flushing code in Rust. 2017-01-24 23:07:28 +00:00
whitequark b29e2d5bfe Globally update UART baudrate to 921600. 2017-01-24 22:25:58 +00:00
whitequark 3633671656 firmware: factor out console and logging from runtime/satman. 2017-01-24 21:58:58 +00:00
whitequark 5604d9bb55 firmware: factor out build scripts from runtime/satman. 2017-01-24 21:15:41 +00:00
whitequark 4d05c70dfa firmware: update smoltcp. 2017-01-23 22:37:33 +00:00
whitequark 527b1e986c firmware: integrate smoltcp instead of lwip. 2017-01-23 13:59:34 +00:00
whitequark 0253e0a89d firmware: remove false dependency from runtime to ksupport.
This significantly speeds up no-change builds.
2017-01-23 13:57:08 +00:00
whitequark 971e4c3026 firmware: increase post-boot UART speed to 921600. 2017-01-23 13:57:08 +00:00
Sebastien Bourdeauducq ce31ffddb0 firmware: add satellite manager
The code duplication with the runtime should be cleaned up later.
2017-01-18 16:50:32 -06:00
Sebastien Bourdeauducq 6805feb494 drtio: report truncated packets 2017-01-12 23:44:45 -06:00
Sebastien Bourdeauducq 7c699e2f80 drtio: add FIFO space request count debug API 2017-01-11 13:48:14 -06:00
Sebastien Bourdeauducq c25186fae1 drtio: print packet error descriptions in log 2017-01-10 18:03:01 -06:00
Sebastien Bourdeauducq 7af152ed22 firmware: pass spawner around instead of scheduler 2017-01-10 16:15:39 -06:00
Sebastien Bourdeauducq d3d23d0d3b drtio: report get FIFO space timeouts to log 2017-01-10 16:12:46 -06:00
Sebastien Bourdeauducq fdfaa377db drtio: add debug syscalls 2017-01-08 15:06:14 -06:00
Sebastien Bourdeauducq 4f97d00e79 firmware: make i2c busno u8 2017-01-05 14:54:48 +01:00
Sebastien Bourdeauducq 082fdaf450 move i2c to libboard, do bit-banging on comms CPU 2017-01-04 21:04:38 +01:00
Sebastien Bourdeauducq 3dd9d54b22 firmware: fix compilation warning without moninj/analyzer 2017-01-04 21:04:08 +01:00
Sebastien Bourdeauducq c08fc8aae9 firmware: support moninj without DDS. Closes #650 2017-01-04 11:26:02 +01:00
Sebastien Bourdeauducq 455250b3f9 remove DDS_AD9914 and DDS_ONEHOT_SEL 2017-01-03 22:04:25 +01:00
Sebastien Bourdeauducq fbf5a4d4a2 Merge branch 'phaser2-rust-init' 2017-01-03 21:31:21 +01:00
whitequark c2d86c4f67 firmware: apply build flags globally, move --cfg handling to build.rs. 2017-01-03 20:12:56 +00:00
Sebastien Bourdeauducq 7ff77bceac move AD9616 and AD9154 initialization to firmware 2017-01-03 16:11:38 +01:00
Sebastien Bourdeauducq 26e7f68b5d firmware: move clock to libboard 2017-01-01 18:23:27 +01:00
whitequark 4bb7132848 firmware: prune stabilized and unused features. 2016-12-31 13:41:32 +00:00
whitequark 4480a1c2ff firmware: libbsp::board → libboard. 2016-12-31 13:41:32 +00:00
whitequark bd33dca203 firmware: extract liballoc_none into its own crate. 2016-12-31 13:41:32 +00:00
whitequark 010ce019b3 firmware: remove spurious build-dependency on winapi. 2016-12-29 13:06:40 +00:00
whitequark aed91292e2 firmware: remove cargo profiles.
These are specified per-workspace, and anyhow are mostly overridden
by our Makefile, so specify everything in it.
2016-12-29 13:06:40 +00:00
whitequark c45a170bb4 firmware: update for Rust 1.16.0. 2016-12-26 17:20:29 +00:00
whitequark 5f3033b518 firmware: remove max_level_debug.
Tracing to the core log isn't particularly slow, and is handy
when debugging.
2016-12-19 13:24:29 +00:00
whitequark 739da9f1b3 runtime: print trace level log messages to UART during startup.
There's no way to retrieve them otherwise if the startup kernel
hangs.

This commit was mistakenly removed in 88ad054.
2016-12-19 13:21:21 +00:00
Sebastien Bourdeauducq 9a564e07c0 firmware: make libbsp a crate 2016-12-16 21:28:25 +08:00
Sebastien Bourdeauducq 9967dfc5ca runtime: reorganize to support DRTIO satellite firmware 2016-12-16 19:11:19 +08:00