Compare commits
29 Commits
master
...
bump_to_ll
Author | SHA1 | Date | |
---|---|---|---|
f6b0e25a3d | |||
f8ec1c0f30 | |||
744e097505 | |||
0d54457543 | |||
a5a876e5b4 | |||
2fea91b8ba | |||
aa770463ca | |||
96f9ad9893 | |||
59c0bb11c9 | |||
a2c5fc6d78 | |||
a46b80318d | |||
196e37549d | |||
d6a0640b63 | |||
12031c0be5 | |||
b8229f6882 | |||
5cab059b74 | |||
a0fb06fb47 | |||
754fdedda3 | |||
b2618b639c | |||
a0bb1ee071 | |||
3e2e35f9b8 | |||
f8ffe9e257 | |||
4c1f81f44e | |||
f806c0d56c | |||
d022bc030f | |||
8312179912 | |||
c21ca1b2b1 | |||
eede61d2ab | |||
54bb604910 |
15
flake.lock
generated
15
flake.lock
generated
@ -229,17 +229,18 @@
|
|||||||
"rust-overlay": "rust-overlay_2"
|
"rust-overlay": "rust-overlay_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736951160,
|
"lastModified": 1738820626,
|
||||||
"narHash": "sha256-bOiSeKEIwSJb62qjT7mqb0JQiqSEYMt6eFuDdGi+7Cw=",
|
"narHash": "sha256-VUyvopJ6QN/tnvU9BeoeA0Az5iQ3vpmThmbzGkvQYos=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "bump_to_llvm18",
|
||||||
"rev": "19efdafce7b212cce95ea9b3a20e6f1d388aba9e",
|
"rev": "7c7c0f3752299b37d9fefaf55375b0ae1dcfda18",
|
||||||
"revCount": 667,
|
"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/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
14
flake.nix
14
flake.nix
@ -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_13.llvm
|
pkgs.llvmPackages_18.llvm
|
||||||
pkgs.llvmPackages_13.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_13.clang-unwrapped.lib}/lib/clang/13.0.1/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_13.llvm
|
llvmPackages_18.llvm
|
||||||
llvmPackages_13.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_13.clang-unwrapped.lib}/lib/clang/13.0.1/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}";
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
[target.armv7-none-eabihf]
|
[target.armv7-none-eabihf]
|
||||||
rustflags = [
|
rustflags = [
|
||||||
"-C", "link-arg=-Tlink.x",
|
"-C", "link-arg=-Tlink.x",
|
||||||
"-C", "target-feature=a9,armv7-a,neon",
|
|
||||||
"-C", "target-cpu=cortex-a9",
|
"-C", "target-cpu=cortex-a9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
target = "armv7-none-eabihf.json"
|
target = "armv7-none-eabihf.json"
|
||||||
|
|
||||||
|
[future-incompat-report]
|
||||||
|
frequency = "never"
|
||||||
|
33
src/Cargo.lock
generated
33
src/Cargo.lock
generated
@ -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.49"
|
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 = "20b1438ef42c655665a8ab2c1c6d605a305f031d38d9be689ddfef41a20f3aa2"
|
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"
|
||||||
|
@ -9,6 +9,7 @@ members = [
|
|||||||
"runtime",
|
"runtime",
|
||||||
"satman"
|
"satman"
|
||||||
]
|
]
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"emit-debug-gdb-scripts": false,
|
"emit-debug-gdb-scripts": false,
|
||||||
"env": "",
|
"env": "",
|
||||||
"executables": true,
|
"executables": true,
|
||||||
"features": "+v7,+vfp3,-d32,+thumb2,-neon",
|
"features": "+v7,+vfp3,-d32,+thumb2,+neon,+a9,+armv7-a",
|
||||||
"is-builtin": false,
|
"is-builtin": false,
|
||||||
"linker": "rust-lld",
|
"linker": "rust-lld",
|
||||||
"linker-flavor": "ld.lld",
|
"linker-flavor": "ld.lld",
|
||||||
|
@ -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"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use core::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};
|
||||||
@ -39,6 +39,7 @@ pub fn copy_work_buffer(src: *mut u32, dst: *mut u32, len: isize) {
|
|||||||
// fix for artiq-zynq#344
|
// fix for artiq-zynq#344
|
||||||
unsafe {
|
unsafe {
|
||||||
for i in 0..(len / 4) {
|
for i in 0..(len / 4) {
|
||||||
|
asm!("", options(preserves_flags, nostack, readonly));
|
||||||
*dst.offset(i) = *src.offset(i);
|
*dst.offset(i) = *src.offset(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
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;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
#![feature(naked_functions)]
|
#![feature(naked_functions)]
|
||||||
#![feature(asm)]
|
|
||||||
|
|
||||||
extern crate core_io;
|
extern crate core_io;
|
||||||
extern crate crc;
|
extern crate crc;
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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"
|
||||||
|
@ -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]
|
||||||
|
@ -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
|
||||||
|
@ -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"
|
||||||
|
@ -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"
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
#![feature(asm)]
|
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
@ -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" }
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use libboard_zynq;
|
#![allow(static_mut_refs)]
|
||||||
|
|
||||||
use crate::artiq_raise;
|
use crate::artiq_raise;
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ use core::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;
|
||||||
|
@ -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)]
|
||||||
|
@ -4,11 +4,11 @@ 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},
|
||||||
enable_fpu, sync_channel};
|
sync_channel};
|
||||||
use libsupport_zynq::ram;
|
use libsupport_zynq::ram;
|
||||||
use log::{debug, error, info};
|
use log::{debug, error, info};
|
||||||
|
|
||||||
@ -25,12 +25,14 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn attribute_writeback(typeinfo: *const ()) {
|
unsafe fn attribute_writeback(typeinfo: *const ()) {
|
||||||
|
#[repr(C)]
|
||||||
struct Attr {
|
struct Attr {
|
||||||
offset: usize,
|
offset: usize,
|
||||||
tag: CSlice<'static, u8>,
|
tag: CSlice<'static, u8>,
|
||||||
name: CSlice<'static, u8>,
|
name: CSlice<'static, u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[repr(C)]
|
||||||
struct Type {
|
struct Type {
|
||||||
attributes: *const *const Attr,
|
attributes: *const *const Attr,
|
||||||
objects: *const *const (),
|
objects: *const *const (),
|
||||||
@ -126,7 +128,6 @@ impl KernelImage {
|
|||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn main_core1() {
|
pub extern "C" fn main_core1() {
|
||||||
enable_fpu();
|
|
||||||
debug!("Core1 started");
|
debug!("Core1 started");
|
||||||
|
|
||||||
ram::init_alloc_core1();
|
ram::init_alloc_core1();
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![allow(incomplete_features)]
|
|
||||||
#![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)]
|
||||||
#![feature(asm)]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
@ -153,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 })
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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/*',
|
||||||
]
|
]
|
||||||
|
@ -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" {}
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
@ -2,8 +2,10 @@
|
|||||||
#![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)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
@ -11,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;
|
||||||
@ -43,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>,
|
||||||
|
@ -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)]
|
||||||
|
@ -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,
|
||||||
|
@ -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,
|
||||||
|
@ -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"]
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(alloc_error_handler, never_type, panic_info_message)]
|
#![allow(internal_features)]
|
||||||
|
#![feature(alloc_error_handler, never_type, panic_info_message, lang_items)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
@ -61,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 });
|
||||||
|
@ -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 {
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user