Compare commits

..

29 Commits

Author SHA1 Message Date
f6b0e25a3d fix dropping references 2025-02-06 13:47:21 +08:00
f8ec1c0f30 use C ABI for attribute writeback typeinfo 2025-02-06 13:47:21 +08:00
744e097505 silence static mut ref warns 2025-02-06 13:47:21 +08:00
0d54457543 flake dependencies 2025-02-06 13:47:21 +08:00
a5a876e5b4 cargo lockfile 2025-02-06 11:15:37 +08:00
2fea91b8ba silence dead code warn 2025-02-06 11:15:37 +08:00
aa770463ca remove unnecessary mut 2025-02-06 11:15:37 +08:00
96f9ad9893 remove stabilized nll, static_nobundle flags 2025-02-06 11:15:37 +08:00
59c0bb11c9 allow internal features 2025-02-06 11:15:37 +08:00
a2c5fc6d78 fix imports 2025-02-05 18:00:56 +08:00
a46b80318d fixup remove unnec imports 2025-02-05 18:00:56 +08:00
196e37549d renamed const_btree_new feature 2025-02-05 18:00:56 +08:00
d6a0640b63 remove unnecessary imports 2025-02-05 18:00:56 +08:00
12031c0be5 bump edition to 2021 2025-02-05 18:00:56 +08:00
b8229f6882 use resolver 2 2025-02-05 18:00:56 +08:00
5cab059b74 move target-features to silence warns 2025-02-05 18:00:56 +08:00
a0fb06fb47 bump llvm to 18 2025-02-05 18:00:56 +08:00
754fdedda3 flake to forked zynq 2025-02-05 18:00:56 +08:00
b2618b639c cursor write revert to memcpy 2025-02-05 18:00:39 +08:00
a0bb1ee071 flake lock 2025-02-05 18:00:37 +08:00
3e2e35f9b8 add dummy personality funcs 2025-02-05 17:59:18 +08:00
f8ffe9e257 remove enable_fpu from main_core1 2025-02-05 17:59:18 +08:00
4c1f81f44e prevent vectorizing copy_work_buffer 2025-02-05 17:59:18 +08:00
f806c0d56c remove unused asm feature flag 2025-02-05 17:59:18 +08:00
d022bc030f remove allow incomplete features 2025-02-05 17:59:18 +08:00
8312179912 fix missing asm macro 2025-02-05 17:59:18 +08:00
c21ca1b2b1 cargo lock 2025-02-05 17:59:18 +08:00
eede61d2ab fix xbuild flags 2025-02-05 17:59:18 +08:00
54bb604910 flake nix 2025-02-05 17:59:18 +08:00
38 changed files with 109 additions and 89 deletions

43
flake.lock generated
View File

@ -11,11 +11,11 @@
"src-pythonparser": "src-pythonparser" "src-pythonparser": "src-pythonparser"
}, },
"locked": { "locked": {
"lastModified": 1739435991, "lastModified": 1738745577,
"narHash": "sha256-mmS2XPIh9EeUGvJQYmlHV0k/UCYmQ0HFmhhETKW/t2k=", "narHash": "sha256-3pOrZSUb9XHyR6zSG5Ykfo+1+piMXTUjf6RYu/JziNU=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "77029874364ff8493081e8000ef964c9ba1ca965", "rev": "9558dd20e1cf3aa0afcaf1acf29202350c040cdc",
"revCount": 9155, "revCount": 9146,
"type": "git", "type": "git",
"url": "https://github.com/m-labs/artiq.git" "url": "https://github.com/m-labs/artiq.git"
}, },
@ -70,11 +70,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1739214665, "lastModified": 1736883708,
"narHash": "sha256-26L8VAu3/1YRxS8MHgBOyOM8xALdo6N0I04PgorE7UM=", "narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "64e75cd44acf21c7933d61d7721e812eac1b5a0a", "rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -158,11 +158,11 @@
"src-migen": { "src-migen": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1738906518, "lastModified": 1737001477,
"narHash": "sha256-GproDJowtcgbccsT+I0mObzFhE483shcS8MSszKXwlc=", "narHash": "sha256-5Rv7R8OO/CsjdDreo+vCUO7dIrTD+70meV5rIvHOGDk=",
"owner": "m-labs", "owner": "m-labs",
"repo": "migen", "repo": "migen",
"rev": "2828df54594673653a641ab551caf6c6b1bfeee5", "rev": "28e913e7114dae485747ccd8f9fd436ada2195f0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -174,11 +174,11 @@
"src-misoc": { "src-misoc": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1739428011, "lastModified": 1737003678,
"narHash": "sha256-ymvkR6ldCp+Kj29YGnaVuoM9Vi2GNxaqPlK0DWOCcgQ=", "narHash": "sha256-YGswRUz5QH28FsVK0j4n/Op6ptFTPPdEOir0JkxfSa0=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "47a3d8096dfae234599fd5406807cf2d92b6a351", "rev": "3c2054c43309d2fa3b72c5435f90c2357f2908af",
"revCount": 2473, "revCount": 2465,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/m-labs/misoc.git" "url": "https://github.com/m-labs/misoc.git"
@ -229,17 +229,18 @@
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {
"lastModified": 1739437497, "lastModified": 1738820626,
"narHash": "sha256-hqsma8ZGBwAcr0OJBcqZLlT8EuhcCW7aYe96Nz153Bs=", "narHash": "sha256-VUyvopJ6QN/tnvU9BeoeA0Az5iQ3vpmThmbzGkvQYos=",
"ref": "refs/heads/master", "ref": "bump_to_llvm18",
"rev": "1c3912e34e43f087a8427509dfb3785b04b6a33e", "rev": "7c7c0f3752299b37d9fefaf55375b0ae1dcfda18",
"revCount": 679, "revCount": 690,
"type": "git", "type": "git",
"url": "https://git.m-labs.hk/m-labs/zynq-rs" "url": "https://git.m-labs.hk/srenblad/zynq-rs/"
}, },
"original": { "original": {
"ref": "bump_to_llvm18",
"type": "git", "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"; description = "ARTIQ port to the Zynq-7000 platform";
inputs.artiq.url = git+https://github.com/m-labs/artiq.git; 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_llvm18;
inputs.zynq-rs.inputs.nixpkgs.follows = "artiq/nixpkgs"; inputs.zynq-rs.inputs.nixpkgs.follows = "artiq/nixpkgs";
outputs = { self, zynq-rs, artiq }: outputs = { self, zynq-rs, artiq }:
@ -135,13 +135,13 @@
pkgs.gnumake pkgs.gnumake
(pkgs.python3.withPackages(ps: [ ps.jsonschema artiqpkgs.migen migen-axi artiqpkgs.misoc artiqpkgs.artiq ])) (pkgs.python3.withPackages(ps: [ ps.jsonschema artiqpkgs.migen migen-axi artiqpkgs.misoc artiqpkgs.artiq ]))
zynqpkgs.cargo-xbuild zynqpkgs.cargo-xbuild
pkgs.llvmPackages_14.llvm pkgs.llvmPackages_18.llvm
pkgs.llvmPackages_14.clang-unwrapped pkgs.llvmPackages_18.clang-unwrapped
]; ];
buildPhase = '' buildPhase = ''
export ZYNQ_REV=${zynqRev} export ZYNQ_REV=${zynqRev}
export XARGO_RUST_SRC="${rust}/lib/rustlib/src/rust/library" export XARGO_RUST_SRC="${rust}/lib/rustlib/src/rust/library"
export CLANG_EXTRA_INCLUDE_DIR="${pkgs.llvmPackages_14.clang-unwrapped.lib}/lib/clang/14.0.6/include" export CLANG_EXTRA_INCLUDE_DIR="${pkgs.llvmPackages_18.clang-unwrapped.lib}/lib/clang/18/include"
export CARGO_HOME=$(mktemp -d cargo-home.XXX) export CARGO_HOME=$(mktemp -d cargo-home.XXX)
export ZYNQ_RS=${zynq-rs} export ZYNQ_RS=${zynq-rs}
make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${fwtype} make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${fwtype}
@ -376,8 +376,8 @@
name = "artiq-zynq-dev-shell"; name = "artiq-zynq-dev-shell";
buildInputs = with pkgs; [ buildInputs = with pkgs; [
rust rust
llvmPackages_14.llvm llvmPackages_18.llvm
llvmPackages_14.clang-unwrapped llvmPackages_18.clang-unwrapped
gnumake gnumake
cacert cacert
zynqpkgs.cargo-xbuild zynqpkgs.cargo-xbuild
@ -392,7 +392,7 @@
]; ];
ZYNQ_REV="${zynqRev}"; ZYNQ_REV="${zynqRev}";
XARGO_RUST_SRC = "${rust}/lib/rustlib/src/rust/library"; XARGO_RUST_SRC = "${rust}/lib/rustlib/src/rust/library";
CLANG_EXTRA_INCLUDE_DIR = "${pkgs.llvmPackages_14.clang-unwrapped.lib}/lib/clang/14.0.6/include"; CLANG_EXTRA_INCLUDE_DIR = "${pkgs.llvmPackages_18.clang-unwrapped.lib}/lib/clang/18/include";
ZYNQ_RS = "${zynq-rs}"; ZYNQ_RS = "${zynq-rs}";
OPENOCD_ZYNQ = "${zynq-rs}/openocd"; OPENOCD_ZYNQ = "${zynq-rs}/openocd";
SZL = "${zynqpkgs.szl}"; SZL = "${zynqpkgs.szl}";

View File

@ -6,3 +6,6 @@ rustflags = [
[build] [build]
target = "armv7-none-eabihf.json" target = "armv7-none-eabihf.json"
[future-incompat-report]
frequency = "never"

33
src/Cargo.lock generated
View File

@ -25,7 +25,7 @@ checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.101",
] ]
[[package]] [[package]]
@ -82,9 +82,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "compiler_builtins" name = "compiler_builtins"
version = "0.1.70" version = "0.1.108"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80873f979f0a344a4ade87c2f70d9ccf5720b83b10c97ec7cd745895d021e85a" checksum = "d68bc55329711cd719c2687bb147bc06211b0521f97ef398280108ccb23227e9"
[[package]] [[package]]
name = "core_io" name = "core_io"
@ -190,7 +190,7 @@ checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.101",
] ]
[[package]] [[package]]
@ -426,13 +426,13 @@ dependencies = [
[[package]] [[package]]
name = "num-derive" name = "num-derive"
version = "0.3.3" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.96",
] ]
[[package]] [[package]]
@ -485,18 +485,18 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.43" version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.21" version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@ -599,6 +599,17 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]] [[package]]
name = "tar-no-std" name = "tar-no-std"
version = "0.1.8" version = "0.1.8"

View File

@ -9,6 +9,7 @@ members = [
"runtime", "runtime",
"satman" "satman"
] ]
resolver = "2"
[profile.release] [profile.release]
panic = "abort" panic = "abort"

View File

@ -2,7 +2,7 @@
name = "libboard_artiq" name = "libboard_artiq"
version = "0.0.0" version = "0.0.0"
authors = ["M-Labs"] authors = ["M-Labs"]
edition = "2018" edition = "2021"
[lib] [lib]
name = "libboard_artiq" name = "libboard_artiq"

View File

@ -1,7 +1,7 @@
use core::{arch::asm, slice}; use core::slice;
use core::arch::asm;
use core_io::{Error as IoError, ErrorKind as IoErrorKind}; use core_io::{Error as IoError, ErrorKind as IoErrorKind};
use crc;
use io::{proto::{ProtoRead, ProtoWrite}, use io::{proto::{ProtoRead, ProtoWrite},
Cursor}; Cursor};
use libboard_zynq::{time::Milliseconds, timer::GlobalTimer}; use libboard_zynq::{time::Milliseconds, timer::GlobalTimer};

View File

@ -1,12 +1,10 @@
use core::slice; use core::slice;
use core_io::{Error as IoError, ErrorKind as IoErrorKind}; use core_io::{Error as IoError, ErrorKind as IoErrorKind};
use crc;
use io::{proto::{ProtoRead, ProtoWrite}, use io::{proto::{ProtoRead, ProtoWrite},
Cursor}; Cursor};
use libasync::{block_async, task}; use libasync::{block_async, task};
use libboard_zynq::{time::Milliseconds, timer::GlobalTimer}; use libboard_zynq::{time::Milliseconds, timer::GlobalTimer};
use nb;
use void::Void; use void::Void;
pub use crate::drtioaux_proto::{Packet, MAX_PACKET}; pub use crate::drtioaux_proto::{Packet, MAX_PACKET};

View File

@ -1,8 +1,7 @@
use core::arch::asm;
use libboard_zynq::{println, stdio}; use libboard_zynq::{println, stdio};
use libcortex_a9::{interrupt_handler, regs::MPIDR}; use libcortex_a9::{interrupt_handler, regs::MPIDR};
use libregister::RegisterR; use libregister::RegisterR;
use core::arch::asm;
#[cfg(has_si549)] #[cfg(has_si549)]
use crate::si549; use crate::si549;

View File

@ -60,6 +60,7 @@ impl BufferLogger {
} }
} }
#[allow(static_mut_refs)]
pub unsafe fn get_logger() -> &'static mut Option<BufferLogger> { pub unsafe fn get_logger() -> &'static mut Option<BufferLogger> {
&mut LOGGER &mut LOGGER
} }

View File

@ -2,6 +2,7 @@
authors = ["M-Labs"] authors = ["M-Labs"]
name = "build_zynq" name = "build_zynq"
version = "0.0.0" version = "0.0.0"
edition = "2021"
[lib] [lib]
name = "build_zynq" name = "build_zynq"

View File

@ -2,7 +2,7 @@
name = "libc" name = "libc"
version = "0.1.0" version = "0.1.0"
authors = ["M-Labs"] authors = ["M-Labs"]
edition = "2018" edition = "2021"
build = "build.rs" build = "build.rs"
[dependencies] [dependencies]

View File

@ -3,7 +3,7 @@
authors = ["The Rust Project Developers"] authors = ["The Rust Project Developers"]
name = "dwarf" name = "dwarf"
version = "0.0.0" version = "0.0.0"
edition = "2018" edition = "2021"
[lib] [lib]
test = false test = false

View File

@ -2,6 +2,7 @@
authors = ["M-Labs"] authors = ["M-Labs"]
name = "dyld" name = "dyld"
version = "0.1.0" version = "0.1.0"
edition = "2021"
[lib] [lib]
name = "dyld" name = "dyld"

View File

@ -2,6 +2,7 @@
authors = ["M-Labs"] authors = ["M-Labs"]
name = "io" name = "io"
version = "0.0.0" version = "0.0.0"
edition = "2021"
[lib] [lib]
name = "io" name = "io"

View File

@ -62,12 +62,8 @@ impl Write for Cursor<&mut [u8]> {
fn write(&mut self, buf: &[u8]) -> Result<usize, IoError> { fn write(&mut self, buf: &[u8]) -> Result<usize, IoError> {
let data = &mut self.inner[self.pos..]; let data = &mut self.inner[self.pos..];
let len = buf.len().min(data.len()); let len = buf.len().min(data.len());
for i in 0..len { // as long as 'copy_work_buffer' is used in drtioaux, memcpy here is allowed
unsafe { data[..len].copy_from_slice(&buf[..len]);
asm!("", options(preserves_flags, nostack, readonly));
}
data[i] = buf[i];
}
self.pos += len; self.pos += len;
Ok(len) Ok(len)
} }

View File

@ -3,7 +3,7 @@ name = "ksupport"
description = "Kernel support for Zynq-based platforms" description = "Kernel support for Zynq-based platforms"
version = "0.1.0" version = "0.1.0"
authors = ["M-Labs"] authors = ["M-Labs"]
edition = "2018" edition = "2021"
[build-dependencies] [build-dependencies]
build_zynq = { path = "../libbuild_zynq" } build_zynq = { path = "../libbuild_zynq" }

View File

@ -1,4 +1,4 @@
use libboard_zynq; #![allow(static_mut_refs)]
use crate::artiq_raise; use crate::artiq_raise;

View File

@ -1,9 +1,9 @@
use core::{arch::asm, use core::sync::atomic::{AtomicBool, Ordering};
sync::atomic::{AtomicBool, Ordering}};
use libboard_zynq::{gic, mpcore, println, stdio}; use libboard_zynq::{gic, mpcore, println, stdio};
use libcortex_a9::{asm, interrupt_handler, notify_spin_lock, regs::MPIDR, spin_lock_yield}; use libcortex_a9::{asm, interrupt_handler, notify_spin_lock, regs::MPIDR, spin_lock_yield};
use libregister::RegisterR; use libregister::RegisterR;
use core::arch::asm;
extern "C" { extern "C" {
static mut __stack1_start: u32; static mut __stack1_start: u32;

View File

@ -2,7 +2,6 @@ use alloc::vec;
use core::{ffi::VaList, ptr, str}; use core::{ffi::VaList, ptr, str};
use libc::{c_char, c_int, size_t}; use libc::{c_char, c_int, size_t};
use libm;
use log::{info, warn}; use log::{info, warn};
#[cfg(has_drtio)] #[cfg(has_drtio)]

View File

@ -4,7 +4,7 @@ use alloc::borrow::ToOwned;
use core::{cell::UnsafeCell, mem, ptr}; use core::{cell::UnsafeCell, mem, ptr};
use cslice::CSlice; use cslice::CSlice;
use dyld::{self, elf::EXIDX_Entry, Library}; use dyld::{elf::EXIDX_Entry, Library};
use libboard_zynq::{gic, mpcore}; use libboard_zynq::{gic, mpcore};
use libcortex_a9::{asm::{dsb, isb}, use libcortex_a9::{asm::{dsb, isb},
cache::{bpiall, dcci_slice, iciallu}, cache::{bpiall, dcci_slice, iciallu},

View File

@ -23,6 +23,7 @@ pub struct DmaRecorder {
static mut RECORDER: Option<DmaRecorder> = None; static mut RECORDER: Option<DmaRecorder> = None;
#[allow(static_mut_refs)]
pub unsafe fn init_dma_recorder() { pub unsafe fn init_dma_recorder() {
// as static would remain after restart, we have to reset it, // as static would remain after restart, we have to reset it,
// without running its destructor. // without running its destructor.
@ -80,6 +81,7 @@ pub extern "C" fn dma_record_stop(duration: i64, enable_ddma: bool) {
} }
#[inline(always)] #[inline(always)]
#[allow(static_mut_refs)]
unsafe fn dma_record_output_prepare(timestamp: i64, target: i32, words: usize) { unsafe fn dma_record_output_prepare(timestamp: i64, target: i32, words: usize) {
// See gateware/rtio/dma.py. // 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;
@ -117,6 +119,7 @@ pub extern "C" fn dma_record_output(target: i32, word: i32) {
} }
} }
#[allow(static_mut_refs)]
pub extern "C" fn dma_record_output_wide(target: i32, words: &CSlice<i32>) { pub extern "C" fn dma_record_output_wide(target: i32, words: &CSlice<i32>) {
assert!(words.len() <= 16); // enforce the hardware limit assert!(words.len() <= 16); // enforce the hardware limit

View File

@ -1,6 +1,6 @@
#![no_std] #![no_std]
#![feature(c_variadic)] #![feature(c_variadic)]
#![feature(const_btree_new)] #![feature(const_btree_len)]
#![feature(inline_const)] #![feature(inline_const)]
#![feature(naked_functions)] #![feature(naked_functions)]
@ -151,6 +151,7 @@ fn _resolve_channel_name(channel: u32, device_map: &BTreeMap<u32, String>) -> St
} }
} }
#[allow(static_mut_refs)]
pub fn resolve_channel_name(channel: u32) -> String { pub fn resolve_channel_name(channel: u32) -> String {
_resolve_channel_name(channel, unsafe { &RTIO_DEVICE_MAP }) _resolve_channel_name(channel, unsafe { &RTIO_DEVICE_MAP })
} }

View File

@ -57,7 +57,7 @@ where
let ptr = storage as *mut u32; let ptr = storage as *mut u32;
let dest = core::slice::from_raw_parts_mut(ptr as *mut u8, length * 4); let dest = core::slice::from_raw_parts_mut(ptr as *mut u8, length * 4);
reader.read_exact(dest)?; reader.read_exact(dest)?;
drop(dest); let _ = dest;
let dest = core::slice::from_raw_parts_mut(ptr, length); let dest = core::slice::from_raw_parts_mut(ptr, length);
NativeEndian::from_slice_u32(dest); NativeEndian::from_slice_u32(dest);
} }
@ -65,7 +65,7 @@ where
let ptr = storage as *mut u64; let ptr = storage as *mut u64;
let dest = core::slice::from_raw_parts_mut(ptr as *mut u8, length * 8); let dest = core::slice::from_raw_parts_mut(ptr as *mut u8, length * 8);
reader.read_exact(dest)?; reader.read_exact(dest)?;
drop(dest); let _ = dest;
let dest = core::slice::from_raw_parts_mut(ptr, length); let dest = core::slice::from_raw_parts_mut(ptr, length);
NativeEndian::from_slice_u64(dest); NativeEndian::from_slice_u64(dest);
} }

View File

@ -3,7 +3,7 @@ authors = ["The Rust Project Developers"]
name = "unwind" name = "unwind"
version = "0.0.0" version = "0.0.0"
build = "build.rs" build = "build.rs"
edition = "2018" edition = "2021"
include = [ include = [
'/libunwind/*', '/libunwind/*',
] ]

View File

@ -1,8 +1,6 @@
#![no_std] #![no_std]
#![feature(link_cfg)] #![feature(link_cfg)]
#![feature(nll)]
#![feature(c_unwind)] #![feature(c_unwind)]
#![feature(static_nobundle)]
#![cfg_attr(not(target_env = "msvc"), feature(libc))] #![cfg_attr(not(target_env = "msvc"), feature(libc))]
cfg_if::cfg_if! { cfg_if::cfg_if! {
@ -24,7 +22,7 @@ cfg_if::cfg_if! {
extern "C" {} extern "C" {}
#[cfg(target_os = "redox")] #[cfg(target_os = "redox")]
#[link(name = "gcc_eh", kind = "static-nobundle", cfg(target_feature = "crt-static"))] #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
extern "C" {} extern "C" {}

View File

@ -3,7 +3,7 @@ name = "runtime"
description = "ARTIQ runtime on Zynq" description = "ARTIQ runtime on Zynq"
version = "0.1.0" version = "0.1.0"
authors = ["M-Labs"] authors = ["M-Labs"]
edition = "2018" edition = "2021"
[features] [features]
target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706", "libconfig/target_zc706", "libboard_artiq/target_zc706"] target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706", "libconfig/target_zc706", "libboard_artiq/target_zc706"]
@ -16,7 +16,7 @@ build_zynq = { path = "../libbuild_zynq" }
[dependencies] [dependencies]
num-traits = { version = "0.2", default-features = false } num-traits = { version = "0.2", default-features = false }
num-derive = "0.3" num-derive = "0.4"
cslice = "0.3" cslice = "0.3"
log = "0.4" log = "0.4"
embedded-hal = "0.2" embedded-hal = "0.2"

View File

@ -2,8 +2,9 @@
#![no_main] #![no_main]
#![recursion_limit = "1024"] // for futures_util::select! #![recursion_limit = "1024"] // for futures_util::select!
#![feature(alloc_error_handler)] #![feature(alloc_error_handler)]
#![feature(const_btree_new)] #![feature(const_btree_len)]
#![feature(panic_info_message)] #![feature(panic_info_message)]
#![allow(internal_features)]
#![feature(lang_items)] #![feature(lang_items)]
#[macro_use] #[macro_use]
@ -12,7 +13,6 @@ extern crate alloc;
#[cfg(all(feature = "target_kasli_soc", has_virtual_leds))] #[cfg(all(feature = "target_kasli_soc", has_virtual_leds))]
use core::cell::RefCell; use core::cell::RefCell;
use ksupport;
use libasync::task; use libasync::task;
#[cfg(has_drtio_eem)] #[cfg(has_drtio_eem)]
use libboard_artiq::drtio_eem; use libboard_artiq::drtio_eem;
@ -44,6 +44,11 @@ extern "C" {
static __exceptions_start: u32; static __exceptions_start: u32;
} }
// linker may complain about missing rust_eh_personality but it is unused
#[lang = "eh_personality"]
#[allow(unused)]
pub fn dummy_personality() { }
#[cfg(all(feature = "target_kasli_soc", has_virtual_leds))] #[cfg(all(feature = "target_kasli_soc", has_virtual_leds))]
async fn io_expanders_service( async fn io_expanders_service(
i2c_bus: RefCell<&mut libboard_zynq::i2c::I2c>, i2c_bus: RefCell<&mut libboard_zynq::i2c::I2c>,

View File

@ -71,7 +71,3 @@ fn soft_panic(info: &core::panic::PanicInfo) -> ! {
}; };
soft_panic_main(timer, cfg); soft_panic_main(timer, cfg);
} }
#[lang = "eh_personality"]
#[no_mangle]
pub extern "C" fn rust_eh_personality() {}

View File

@ -442,6 +442,7 @@ fn set_fclk0_freq(clk: RtioClock, cfg: &Config) {
); );
} }
#[allow(static_mut_refs)]
pub fn init(timer: &mut GlobalTimer, cfg: &Config) { pub fn init(timer: &mut GlobalTimer, cfg: &Config) {
let clk = get_rtio_clock_cfg(cfg); let clk = get_rtio_clock_cfg(cfg);
#[cfg(has_si5324)] #[cfg(has_si5324)]

View File

@ -144,7 +144,7 @@ pub mod remote_dma {
pub async fn playback_done(&mut self, source: u8, error: u8, channel: u32, timestamp: u64) { pub async fn playback_done(&mut self, source: u8, error: u8, channel: u32, timestamp: u64) {
let mut traces_locked = self.traces.async_lock().await; let mut traces_locked = self.traces.async_lock().await;
let mut trace = traces_locked.get_mut(&source).unwrap(); let trace = traces_locked.get_mut(&source).unwrap();
trace.state = RemoteState::PlaybackEnded { trace.state = RemoteState::PlaybackEnded {
error: error, error: error,
channel: channel, channel: channel,

View File

@ -40,6 +40,7 @@ impl From<DrtioError> for Error {
} }
} }
#[allow(dead_code)]
pub struct SubkernelFinished { pub struct SubkernelFinished {
pub id: u32, pub id: u32,
pub status: FinishStatus, pub status: FinishStatus,

View File

@ -19,7 +19,7 @@ fn_single_line = false
where_single_line = true where_single_line = true
imports_indent = "Visual" imports_indent = "Visual"
imports_layout = "Mixed" imports_layout = "Mixed"
imports_granularity = "Crate" merge_imports = true
group_imports = "StdExternalCrate" group_imports = "StdExternalCrate"
reorder_imports = true reorder_imports = true
reorder_modules = true reorder_modules = true
@ -54,7 +54,7 @@ use_field_init_shorthand = false
force_explicit_abi = true force_explicit_abi = true
condense_wildcard_suffixes = false condense_wildcard_suffixes = false
color = "Auto" color = "Auto"
required_version = "1.4.38" required_version = "1.4.37"
unstable_features = false unstable_features = false
disable_all_formatting = false disable_all_formatting = false
skip_children = false skip_children = false

View File

@ -3,6 +3,7 @@ authors = ["M-Labs"]
name = "satman" name = "satman"
version = "0.0.0" version = "0.0.0"
build = "build.rs" build = "build.rs"
edition = "2021"
[features] [features]
target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706", "libconfig/target_zc706", "libboard_artiq/target_zc706"] target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706", "libconfig/target_zc706", "libboard_artiq/target_zc706"]

View File

@ -6,8 +6,8 @@ use libboard_artiq::{drtio_routing::RoutingTable,
drtioaux_proto::{Packet, PayloadStatus, MASTER_PAYLOAD_MAX_SIZE}, drtioaux_proto::{Packet, PayloadStatus, MASTER_PAYLOAD_MAX_SIZE},
pl::csr}; pl::csr};
use libcortex_a9::cache::dcci_slice; use libcortex_a9::cache::dcci_slice;
use routing::{Router, Sliceable}; use crate::routing::{Router, Sliceable};
use subkernel::Manager as KernelManager; use crate::subkernel::Manager as KernelManager;
const ALIGNMENT: usize = 64; const ALIGNMENT: usize = 64;

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#![feature(alloc_error_handler, never_type, panic_info_message)] #![allow(internal_features)]
#![feature(lang_items)] #![feature(alloc_error_handler, never_type, panic_info_message, lang_items)]
#[macro_use] #[macro_use]
extern crate log; extern crate log;
@ -62,6 +62,11 @@ extern "C" {
static __exceptions_start: u32; static __exceptions_start: u32;
} }
// linker may complain about missing rust_eh_personality but it is unused
#[lang = "eh_personality"]
#[allow(unused)]
pub fn dummy_personality() { }
fn drtiosat_reset(reset: bool) { fn drtiosat_reset(reset: bool) {
unsafe { unsafe {
csr::drtiosat::reset_write(if reset { 1 } else { 0 }); csr::drtiosat::reset_write(if reset { 1 } else { 0 });
@ -1811,7 +1816,3 @@ pub fn panic_fmt(info: &core::panic::PanicInfo) -> ! {
loop {} loop {}
} }
#[lang = "eh_personality"]
#[no_mangle]
pub extern "C" fn rust_eh_personality() {}

View File

@ -6,7 +6,7 @@ use libboard_artiq::{drtio_routing, drtioaux};
#[cfg(has_drtio_routing)] #[cfg(has_drtio_routing)]
use libboard_zynq::time::Milliseconds; use libboard_zynq::time::Milliseconds;
use libboard_zynq::timer::GlobalTimer; use libboard_zynq::timer::GlobalTimer;
use routing::Router; use crate::routing::Router;
#[cfg(has_drtio_routing)] #[cfg(has_drtio_routing)]
fn rep_link_rx_up(repno: u8) -> bool { fn rep_link_rx_up(repno: u8) -> bool {

View File

@ -6,7 +6,7 @@ use core::{slice, str};
use core_io::{Error as IoError, Write}; use core_io::{Error as IoError, Write};
use cslice::AsCSlice; use cslice::AsCSlice;
use dma::{Error as DmaError, Manager as DmaManager}; use crate::dma::{Error as DmaError, Manager as DmaManager};
use io::{Cursor, ProtoWrite}; use io::{Cursor, ProtoWrite};
use ksupport::{eh_artiq, kernel, rpc, rtio}; use ksupport::{eh_artiq, kernel, rpc, rtio};
use libboard_artiq::{drtio_routing::RoutingTable, use libboard_artiq::{drtio_routing::RoutingTable,
@ -16,7 +16,7 @@ use libboard_artiq::{drtio_routing::RoutingTable,
use libboard_zynq::{time::Milliseconds, timer::GlobalTimer}; use libboard_zynq::{time::Milliseconds, timer::GlobalTimer};
use libcortex_a9::sync_channel::Receiver; use libcortex_a9::sync_channel::Receiver;
use log::warn; use log::warn;
use routing::{Router, SliceMeta, Sliceable}; use crate::routing::{Router, SliceMeta, Sliceable};
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
enum KernelState { enum KernelState {
@ -53,6 +53,7 @@ enum KernelState {
} }
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
pub enum Error { pub enum Error {
Load(String), Load(String),
KernelNotFound, KernelNotFound,