Commit Graph

103 Commits

Author SHA1 Message Date
whitequark 668928a16c runtime: fix a lifetime issue in lwip::Pbuf.
This would have allowed a use-after-move (or -free) to typecheck.
2016-12-05 05:24:27 +00:00
Sebastien Bourdeauducq 88ad054ab6 Merge branch 'drtio' 2016-12-03 23:25:17 +08:00
Sebastien Bourdeauducq 617f6897a4 runtime: more concise message 2016-12-03 11:17:47 +08:00
whitequark 5b7e068157 runtime: clear async RPC queue when kernel stops (fixes #631). 2016-11-29 14:00:43 +00:00
Sebastien Bourdeauducq d37b73fd31 drtio: FIFO timeout is handled in gateware + give remote side more time 2016-11-28 14:33:06 +08:00
whitequark ea25856d92 runtime: match argument signedness between ARTIQ Python and ksupport.
This is only required when reading the ABI very strictly, but better
be conservative here than spend time debugging silly stuff.
2016-11-26 07:25:22 +00:00
whitequark cf12a888e7 runtime: refactor rtio_output_list. 2016-11-26 07:25:22 +00:00
whitequark 79e70fa465 runtime: use correct ABI when accepting ARTIQ lists. 2016-11-26 07:25:22 +00:00
Robert Jördens fbf60108a8 moninj.rs: force u32 dds_ftws 2016-11-23 16:39:08 +01:00
Robert Jördens 0d5f962d0c runtime.rs/rtio.rs: style 2016-11-23 23:27:59 +08:00
Robert Jördens eab18d8e34 runtime.rs: wide rtio data 2016-11-23 23:27:46 +08:00
Robert Jördens a964cf24f2 runtime.rs/rtio.rs: style 2016-11-23 15:03:36 +01:00
Robert Jördens 8cce5d2fcd runtime.rs: wide rtio data 2016-11-23 15:03:36 +01:00
whitequark 4df7941a97 runtime: don't attempt to perform writeback if disabled in kernel.
Otherwise, the startup kernel session hangs.
2016-11-23 13:53:40 +00:00
whitequark cd7527b701 runtime: print trace level log messages to UART during startup.
There's no way to retrieve them otherwise if the startup kernel
hangs.
2016-11-23 13:53:40 +00:00
Sebastien Bourdeauducq cd334c0ecf Merge branch 'master' into drtio 2016-11-23 12:40:18 +08:00
Sebastien Bourdeauducq 0443f83d5e runtime: support for targets without RTIO log channel 2016-11-23 10:50:55 +08:00
Sebastien Bourdeauducq cd40d5b107 runtime: support for targets without I2C 2016-11-23 10:50:55 +08:00
Sebastien Bourdeauducq 0c49679984 runtime: support for targets without RTIO log channel 2016-11-23 10:48:26 +08:00
Sebastien Bourdeauducq 3c5a62243d runtime: support for targets without I2C 2016-11-23 10:43:33 +08:00
Sebastien Bourdeauducq 9acc7d135e gateware: common RTIO interface 2016-11-22 22:46:50 +08:00
whitequark 965fdd35e5 runtime: show a prompt to erase startup/idle kernels. 2016-11-22 14:45:40 +00:00
Sebastien Bourdeauducq 7498c8bba0 Merge branch 'master' into drtio 2016-11-22 16:07:30 +08:00
Sebastien Bourdeauducq 3459793586 Merge branch 'master' into drtio 2016-11-22 15:15:22 +08:00
whitequark 1d1e821a74 runtime: replace a (deliberate) memory leak with an interner. 2016-11-21 19:47:56 +00:00
whitequark 18b7ccea4e runtime: rewrite i2c support code in Rust. 2016-11-21 18:25:43 +00:00
whitequark a825584ac0 runtime: rewrite rtio support code in Rust. 2016-11-21 17:13:09 +00:00
whitequark 5e8888d5f3 Fully drop AD9858 and kc705-nist_qc1 support (closes #576). 2016-11-21 15:14:17 +00:00
Sebastien Bourdeauducq abd1b2a94e drtio: wait longer for remote (bruteforce clock aligner can be slow) 2016-11-19 11:01:09 +08:00
Sebastien Bourdeauducq 381e58434f drtio: handle link restarts at transceiver level 2016-11-19 10:46:56 +08:00
Sebastien Bourdeauducq 4d07974a34 drtio: reset link from CPU 2016-11-18 17:45:33 +08:00
whitequark c7844d5223 runtime: use proper format for git commit.
Fixes #620.
2016-11-17 15:20:21 +00:00
Sebastien Bourdeauducq bb047aabe9 drtio: simpler link layer 2016-11-17 22:32:39 +08:00
whitequark 18c394976e runtime: disable the Nagle algorithm entirely.
See also commit feed91d; that commit fixed the test_rpc_timing test,
but caused frequent hangs elsewhere, which were also caused by buggy
Nagle implementation. Just disable this entirely, as with our
explicit buffering it provides no benefit anyway.
2016-11-13 00:33:24 +00:00
whitequark feed91d8b2 runtime: buffer RPC send packets.
This brings mean RPC time from ~45ms to ~2ms.

The cause of the slowness without buffering is, primarily, that lwip
is severely pessimized by small writes, whether with Nagle on or off.
(In fact, disabling Nagle makes it function *better* on many small
writes, which begs the question of what's the point of having Nagle
there in the first place.) In practical terms, the slowness appears
only when writing a 4-byte buffer (the synchronization segment);
writing buffers of other sizes does not trigger the problem.

This all is extremely confusing and the fix is partly palliative,
but since it seems to work reliably and we're migrating off lwip
I think it is unwise to spend any more time debugging this.
2016-11-12 23:06:33 +00:00
whitequark 3ce1826891 runtime: don't print debug messages to the UART.
It takes ~4ms to print an empty log line because of how slow
the UART is. This makes the log timestamps useless for debugging
performance problems.

After this commit, it takes ~75us to print an empty log line instead,
which pessimizes test_rpc_timing by less than 2ms with tracing
enabled.
2016-11-12 20:26:32 +00:00
whitequark acc5e53b32 runtime: print microsecond timestamps in debug messages. 2016-11-12 20:26:32 +00:00
Sebastien Bourdeauducq 863934c4fa drtio: more reliable link layer init 2016-11-09 22:03:47 +08:00
Sebastien Bourdeauducq 99ad9b5917 add has_dds, use config flags 2016-11-08 23:33:03 +08:00
whitequark a8fd697d41 runtime: unbreak 453e8b7.
Running
  rustc --cfg 'foo="1"'
does not result in a statement of the form
  do_thing()
to be compilex in.
2016-11-08 12:57:06 +00:00
whitequark 798a5f70df Revert "runtime: remove some redundant libm functions copied inline."
This reverts commit fee75bd50f.

LLVM does not have lround as a libcall and this inhibits LICM.
2016-11-08 11:54:17 +00:00
Sebastien Bourdeauducq 78f18a12eb runtime: basic DRTIO init code 2016-11-07 19:34:34 +08:00
Sebastien Bourdeauducq 453e8b7eb3 runtime: support configurations without moninj, log or dds 2016-11-06 23:53:10 +08:00
Sebastien Bourdeauducq 266ae292d9 runtime: support configurations without moninj, log or dds 2016-11-06 23:52:27 +08:00
whitequark b30734a105 runtime: fix a race condition with async RPCs.
session.rs has code like:

    while !rpc_queue::empty() {
        try!(process_kern_queued_rpc(stream, &mut session))
    }

    // A

    if mailbox::receive() != 0 {
        try!(process_kern_message(waiter, Some(stream), &mut session));
    }

If both an async and a mailbox RPC (async or large sync) are posted
at point A then they will be processed out of order.
This commit fixes the issue by flushing the async RPC queue before
posting any RPC to the mailbox.
2016-11-01 13:22:22 +00:00
whitequark 6fcd57a41a runtime: fix remaining async RPC bugs. 2016-11-01 10:33:57 +00:00
whitequark 2095d01b84 runtime: dirty hacks to remove allocations in ksupport. 2016-11-01 08:55:49 +00:00
whitequark c1e6d4b67c runtime: fix multiple async RPC bugs. 2016-11-01 06:51:44 +00:00
whitequark 898a716b91 runtime: work around mor1kx ignoring low bits of reset address.
Fixes #599.
2016-10-31 18:13:15 +00:00
whitequark 2ac85cd40f runtime: implement prototype background RPCs. 2016-10-29 21:34:25 +00:00