Compare commits

..

8 Commits

18 changed files with 59 additions and 65 deletions

23
flake.lock generated
View File

@ -11,11 +11,11 @@
"src-pythonparser": "src-pythonparser"
},
"locked": {
"lastModified": 1734418848,
"narHash": "sha256-FiK84edtdmpJ3FUA58XAUmDDp4oVPgupmf1CcgJ6rC0=",
"lastModified": 1734333183,
"narHash": "sha256-iVzdaE3x5Ob2nArtF7S3xuUIVxXiO7RCmXKYgS4ltcs=",
"ref": "refs/heads/master",
"rev": "366bb0fc59dbe4d5f544908b0f3e31f8eb19f7c1",
"revCount": 9121,
"rev": "c65520ab0184149e57d6d9c104e334055186fd67",
"revCount": 9120,
"type": "git",
"url": "https://github.com/m-labs/artiq.git"
},
@ -229,17 +229,18 @@
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1734668221,
"narHash": "sha256-X0U2yPmlsD3VLBZQyfWv8qw04Qn0qFWIONJUPPigB0U=",
"ref": "refs/heads/master",
"rev": "213529cf7a50aa1b2d9ffdf575e3e38202ff9bd6",
"revCount": 666,
"lastModified": 1734336632,
"narHash": "sha256-Y87aN0z8B/KRUg8dgoKrTNHZTHtC9hEQKlxRx2+szNs=",
"ref": "bump_to_llvm15",
"rev": "f18cc91c1b5ebf0aadc59724d1f69f037da44c7f",
"revCount": 664,
"type": "git",
"url": "https://git.m-labs.hk/m-labs/zynq-rs"
"url": "https://git.m-labs.hk/srenblad/zynq-rs/"
},
"original": {
"ref": "bump_to_llvm15",
"type": "git",
"url": "https://git.m-labs.hk/m-labs/zynq-rs"
"url": "https://git.m-labs.hk/srenblad/zynq-rs/"
}
}
},

View File

@ -2,7 +2,7 @@
description = "ARTIQ port to the Zynq-7000 platform";
inputs.artiq.url = git+https://github.com/m-labs/artiq.git;
inputs.zynq-rs.url = git+https://git.m-labs.hk/m-labs/zynq-rs;
inputs.zynq-rs.url = git+https://git.m-labs.hk/srenblad/zynq-rs/?ref=bump_to_llvm15;
inputs.zynq-rs.inputs.nixpkgs.follows = "artiq/nixpkgs";
outputs = { self, zynq-rs, artiq }:
@ -126,8 +126,8 @@
outputHashes = {
"tar-no-std-0.1.8" = "sha256-xm17108v4smXOqxdLvHl9CxTCJslmeogjm4Y87IXFuM=";
"nalgebra-0.32.6" = "sha256-ZbQQZbM3A5cJ4QbujtUxkrI0/qGlI4UzfahtyQnvMZA=";
"core_io-0.1.0" = "sha256-0HINFWRiJx8pjMgUOL/CS336ih7SENSRh3Kah9LPRrw=";
"fatfs-0.3.6" = "sha256-Nz9hCq/1YgSXF8ltJ5ZawV0Hc8WV44KNK0tJdVnNb4U=";
"core_io-0.1.0" = "sha256-tepvvnkDTYDJ3uvuuSJISevYFkl802GHBHSwn1fXKJE=";
"fatfs-0.3.6" = "sha256-Z6iueATKemecxleUd5vzWMNq0PHS7hD422PXOiyDHUM=";
};
};

6
src/Cargo.lock generated
View File

@ -89,7 +89,7 @@ checksum = "20b1438ef42c655665a8ab2c1c6d605a305f031d38d9be689ddfef41a20f3aa2"
[[package]]
name = "core_io"
version = "0.1.0"
source = "git+https://git.m-labs.hk/M-Labs/rs-core_io.git?rev=e9d3edf027#e9d3edf0272502b0dd6c26e8a4869c2912657615"
source = "git+https://git.m-labs.hk/srenblad/rs-core_io.git?branch=main#0af646fef07b2e2ac90b5aae998fd28c93efdbc1"
[[package]]
name = "crc"
@ -138,7 +138,7 @@ dependencies = [
[[package]]
name = "fatfs"
version = "0.3.6"
source = "git+https://git.m-labs.hk/M-Labs/rust-fatfs.git?rev=4b5e420084#4b5e420084fd1c4a9c105680b687523909b6469c"
source = "git+https://git.m-labs.hk/srenblad/rust-fatfs.git?branch=main#62a8cafc1561eda34448ed2fcedaf87f26a63030"
dependencies = [
"bitflags",
"byteorder",
@ -390,7 +390,7 @@ checksum = "c75de51135344a4f8ed3cfe2720dc27736f7711989703a0b43aadf3753c55577"
[[package]]
name = "nalgebra"
version = "0.32.6"
source = "git+https://git.m-labs.hk/M-Labs/nalgebra.git?rev=ad42410ab0#ad42410ab0abb014229e3ff6bc6ccd39ca92d5d1"
source = "git+https://git.m-labs.hk/srenblad/nalgebra.git?rev=ad42410ab0#ad42410ab0abb014229e3ff6bc6ccd39ca92d5d1"
dependencies = [
"approx",
"num-complex",

View File

@ -1,4 +1,12 @@
{
"abi-blacklist": [
"stdcall",
"fastcall",
"vectorcall",
"thiscall",
"win64",
"sysv64"
],
"arch": "arm",
"data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64",
"emit-debug-gdb-scripts": false,
@ -13,6 +21,7 @@
"os": "none",
"panic-strategy": "abort",
"requires-uwtable": true,
"force-unwind-tables": "yes",
"relocation-model": "static",
"target-c-int-width": "32",
"target-endian": "little",

View File

@ -20,7 +20,7 @@ build_zynq = { path = "../libbuild_zynq" }
log = "0.4"
log_buffer = { version = "1.2" }
crc = { version = "1.7", default-features = false }
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
core_io = { git = "https://git.m-labs.hk/srenblad/rs-core_io.git", branch = "main" }
embedded-hal = "0.2"
nb = "1.0"
void = { version = "1", default-features = false }

View File

@ -5,8 +5,7 @@ pub const MAX_PACKET: usize = 1024;
// maximum size of arbitrary payloads
// used by satellite -> master analyzer, subkernel exceptions
pub const SAT_PAYLOAD_MAX_SIZE: usize = /*max size*/
MAX_PACKET - /*CRC*/4 - /*packet ID*/1 - /*last*/1 - /*length*/2;
pub const SAT_PAYLOAD_MAX_SIZE: usize = /*max size*/MAX_PACKET - /*CRC*/4 - /*packet ID*/1 - /*last*/1 - /*length*/2;
// used by DDMA, subkernel program data (need to provide extra ID and destination)
pub const MASTER_PAYLOAD_MAX_SIZE: usize = SAT_PAYLOAD_MAX_SIZE - /*source*/1 - /*destination*/1 - /*ID*/4;

View File

@ -8,7 +8,7 @@ name = "io"
path = "lib.rs"
[dependencies]
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
core_io = { git = "https://git.m-labs.hk/srenblad/rs-core_io.git", branch = "main" }
byteorder = { version = "1.0", default-features = false, optional = true }
libsupport_zynq = { path = "@@ZYNQ_RS@@/libsupport_zynq", default-features = false, features = ["alloc_core"] }

View File

@ -1,6 +1,5 @@
#[cfg(feature = "alloc")]
use alloc::vec::Vec;
use core::arch::asm;
use core_io::{Error as IoError, Read, Write};
@ -48,9 +47,6 @@ impl<T: AsRef<[u8]>> Read for Cursor<T> {
let len = buf.len().min(data.len());
// ``copy_from_slice`` generates AXI bursts, use a regular loop instead
for i in 0..len {
unsafe {
asm!("", options(preserves_flags, nostack, readonly));
}
buf[i] = data[i];
}
self.pos += len;
@ -63,9 +59,6 @@ impl Write for Cursor<&mut [u8]> {
let data = &mut self.inner[self.pos..];
let len = buf.len().min(data.len());
for i in 0..len {
unsafe {
asm!("", options(preserves_flags, nostack, readonly));
}
data[i] = buf[i];
}
self.pos += len;

View File

@ -1,6 +1,5 @@
#![no_std]
#![feature(never_type)]
#![feature(asm)]
#[cfg(feature = "alloc")]
extern crate alloc;

View File

@ -12,7 +12,7 @@ build_zynq = { path = "../libbuild_zynq" }
cslice = "0.3"
log = "0.4"
nb = "0.1"
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
core_io = { git = "https://git.m-labs.hk/srenblad/rs-core_io.git", branch = "main" }
byteorder = { version = "1.3", default-features = false }
void = { version = "1", default-features = false }
log_buffer = { version = "1.2" }
@ -34,7 +34,7 @@ io = { path = "../libio" }
libboard_artiq = { path = "../libboard_artiq" }
[dependencies.nalgebra]
git = "https://git.m-labs.hk/M-Labs/nalgebra.git"
git = "https://git.m-labs.hk/srenblad/nalgebra.git"
rev = "ad42410ab0"
default-features = false
features = ["libm", "alloc"]

View File

@ -96,36 +96,30 @@ struct ExceptionBuffer {
}
static mut EXCEPTION_BUFFER: ExceptionBuffer = ExceptionBuffer {
uw_exceptions: [const {
uw::_Unwind_Exception {
exception_class: EXCEPTION_CLASS,
exception_cleanup: cleanup,
private: [0; uw::unwinder_private_data_size],
}
}; MAX_INFLIGHT_EXCEPTIONS],
uw_exceptions: [const { uw::_Unwind_Exception {
exception_class: EXCEPTION_CLASS,
exception_cleanup: cleanup,
private: [0; uw::unwinder_private_data_size],
}}; MAX_INFLIGHT_EXCEPTIONS],
exceptions: [None; MAX_INFLIGHT_EXCEPTIONS + 1],
exception_stack: [-1; MAX_INFLIGHT_EXCEPTIONS + 1],
backtrace: [(0, 0); MAX_BACKTRACE_SIZE],
backtrace_size: 0,
stack_pointers: [const {
StackPointerBacktrace {
stack_pointer: 0,
initial_backtrace_size: 0,
current_backtrace_size: 0,
}
}; MAX_INFLIGHT_EXCEPTIONS + 1],
stack_pointers: [const { StackPointerBacktrace {
stack_pointer: 0,
initial_backtrace_size: 0,
current_backtrace_size: 0,
}}; MAX_INFLIGHT_EXCEPTIONS + 1],
exception_count: 0,
};
pub unsafe extern "C" fn reset_exception_buffer() {
trace!("reset exception buffer");
EXCEPTION_BUFFER.uw_exceptions = [const {
uw::_Unwind_Exception {
exception_class: EXCEPTION_CLASS,
exception_cleanup: cleanup,
private: [0; uw::unwinder_private_data_size],
}
}; MAX_INFLIGHT_EXCEPTIONS];
EXCEPTION_BUFFER.uw_exceptions = [const { uw::_Unwind_Exception {
exception_class: EXCEPTION_CLASS,
exception_cleanup: cleanup,
private: [0; uw::unwinder_private_data_size],
}}; MAX_INFLIGHT_EXCEPTIONS];
EXCEPTION_BUFFER.exceptions = [None; MAX_INFLIGHT_EXCEPTIONS + 1];
EXCEPTION_BUFFER.exception_stack = [-1; MAX_INFLIGHT_EXCEPTIONS + 1];
EXCEPTION_BUFFER.backtrace_size = 0;

View File

@ -82,7 +82,7 @@ pub extern "C" fn dma_record_stop(duration: i64, enable_ddma: bool) {
#[inline(always)]
unsafe fn dma_record_output_prepare(timestamp: i64, target: i32, words: usize) {
// See gateware/rtio/dma.py.
const HEADER_LENGTH: usize = /*length*/ 1 + /*channel*/3 + /*timestamp*/8 + /*address*/1;
const HEADER_LENGTH: usize = /*length*/1 + /*channel*/3 + /*timestamp*/8 + /*address*/1;
let length = HEADER_LENGTH + /*data*/words * 4;
let buffer = &mut RECORDER.as_mut().unwrap().buffer;

View File

@ -1,5 +1,4 @@
#![no_std]
#![allow(incomplete_features)]
#![feature(c_variadic)]
#![feature(const_btree_new)]
#![feature(inline_const)]

View File

@ -20,7 +20,7 @@ num-derive = "0.3"
cslice = "0.3"
log = "0.4"
embedded-hal = "0.2"
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
core_io = { git = "https://git.m-labs.hk/srenblad/rs-core_io.git", branch = "main" }
crc = { version = "1.7", default-features = false }
byteorder = { version = "1.3", default-features = false }
void = { version = "1", default-features = false }

View File

@ -10,11 +10,15 @@ use io::Cursor;
#[cfg(has_drtio)]
use ksupport::rpc;
use ksupport::{kernel, resolve_channel_name};
#[cfg(has_drtio)]
use libasync::delay;
use libasync::{smoltcp::{Sockets, TcpStream},
task};
use libboard_artiq::drtio_routing;
#[cfg(feature = "target_kasli_soc")]
use libboard_zynq::error_led::ErrorLED;
#[cfg(has_drtio)]
use libboard_zynq::time::Milliseconds;
use libboard_zynq::{self as zynq,
smoltcp::{self,
iface::{EthernetInterfaceBuilder, NeighborCache},

View File

@ -54,7 +54,7 @@ use_field_init_shorthand = false
force_explicit_abi = true
condense_wildcard_suffixes = false
color = "Auto"
required_version = "1.4.37"
required_version = "1.4.32"
unstable_features = false
disable_all_formatting = false
skip_children = false

View File

@ -16,7 +16,7 @@ build_zynq = { path = "../libbuild_zynq" }
[dependencies]
log = { version = "0.4", default-features = false }
byteorder = { version = "1.3", default-features = false }
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
core_io = { git = "https://git.m-labs.hk/srenblad/rs-core_io.git", branch = "main" }
crc = { version = "1.7", default-features = false }
cslice = "0.3"
embedded-hal = "0.2"

View File

@ -396,13 +396,9 @@ impl<'a> Manager<'_> {
self.session = Session::new(id);
self.control.restart();
self.control.tx.send(kernel::Message::LoadRequest(
self.kernels
.get(&id)
.ok_or_else(|| Error::KernelNotFound)?
.library
.clone(),
));
self.control
.tx
.send(kernel::Message::LoadRequest(self.kernels.get(&id).ok_or_else(|| Error::KernelNotFound)?.library.clone()));
let reply = self.control.rx.recv();
match reply {
kernel::Message::LoadCompleted => Ok(()),