forked from M-Labs/artiq-zynq
Compare commits
13 Commits
fix_unused
...
master
Author | SHA1 | Date | |
---|---|---|---|
a0281e4989 | |||
850e783139 | |||
8fd8cae9d5 | |||
7acf8af7f7 | |||
13264d9992 | |||
8d07f006f2 | |||
97e15d51f2 | |||
0021a01bdf | |||
16801a35f4 | |||
81eba30a29 | |||
7d6d40a785 | |||
ffe3020788 | |||
8f510b5ca6 |
28
flake.lock
generated
28
flake.lock
generated
@ -11,11 +11,11 @@
|
|||||||
"src-pythonparser": "src-pythonparser"
|
"src-pythonparser": "src-pythonparser"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733894986,
|
"lastModified": 1734418848,
|
||||||
"narHash": "sha256-zwMs87eUiVURXqavNYL42ZGi+INA7AXHUkx+go9dCLs=",
|
"narHash": "sha256-FiK84edtdmpJ3FUA58XAUmDDp4oVPgupmf1CcgJ6rC0=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "3db8d2310cb45989a7fb4408508013ea1c03f7b9",
|
"rev": "366bb0fc59dbe4d5f544908b0f3e31f8eb19f7c1",
|
||||||
"revCount": 9113,
|
"revCount": 9121,
|
||||||
"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": 1733759999,
|
"lastModified": 1733940404,
|
||||||
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
|
"narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
|
"rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -142,11 +142,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733319649,
|
"lastModified": 1734267097,
|
||||||
"narHash": "sha256-ATJV2UV9FXEiTF6/1BvZ2HmB0goF5TZ2ytgRBwD/BGg=",
|
"narHash": "sha256-aWg7XDiOlWnkXfDbKrBn9ITR46/JXfndvYHxFJ1vN78=",
|
||||||
"owner": "m-labs",
|
"owner": "m-labs",
|
||||||
"repo": "sipyco",
|
"repo": "sipyco",
|
||||||
"rev": "27312727bdb8a182bd6e222e4cbdd3f39ae41d4e",
|
"rev": "430978ada3fefe32de01f1b884b3031e48aaef96",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -229,11 +229,11 @@
|
|||||||
"rust-overlay": "rust-overlay_2"
|
"rust-overlay": "rust-overlay_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731749494,
|
"lastModified": 1734668221,
|
||||||
"narHash": "sha256-WGigAhvVCGN5YZ1dHPyvoqAh47W1Gtph036O1aKFlLE=",
|
"narHash": "sha256-X0U2yPmlsD3VLBZQyfWv8qw04Qn0qFWIONJUPPigB0U=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "12975de2e110d7948bf47b768559f727d0abc8fc",
|
"rev": "213529cf7a50aa1b2d9ffdf575e3e38202ff9bd6",
|
||||||
"revCount": 655,
|
"revCount": 666,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.m-labs.hk/m-labs/zynq-rs"
|
"url": "https://git.m-labs.hk/m-labs/zynq-rs"
|
||||||
},
|
},
|
||||||
|
17
flake.nix
17
flake.nix
@ -10,7 +10,6 @@
|
|||||||
pkgs = import artiq.inputs.nixpkgs { system = "x86_64-linux"; overlays = [ (import zynq-rs.inputs.rust-overlay) ]; };
|
pkgs = import artiq.inputs.nixpkgs { system = "x86_64-linux"; overlays = [ (import zynq-rs.inputs.rust-overlay) ]; };
|
||||||
zynqpkgs = zynq-rs.packages.x86_64-linux;
|
zynqpkgs = zynq-rs.packages.x86_64-linux;
|
||||||
artiqpkgs = artiq.packages.x86_64-linux;
|
artiqpkgs = artiq.packages.x86_64-linux;
|
||||||
llvmPackages_11 = zynq-rs.llvmPackages_11;
|
|
||||||
zynqRev = self.sourceInfo.rev or "unknown";
|
zynqRev = self.sourceInfo.rev or "unknown";
|
||||||
|
|
||||||
rust = zynq-rs.rust;
|
rust = zynq-rs.rust;
|
||||||
@ -126,7 +125,9 @@
|
|||||||
lockFile = src/Cargo.lock;
|
lockFile = src/Cargo.lock;
|
||||||
outputHashes = {
|
outputHashes = {
|
||||||
"tar-no-std-0.1.8" = "sha256-xm17108v4smXOqxdLvHl9CxTCJslmeogjm4Y87IXFuM=";
|
"tar-no-std-0.1.8" = "sha256-xm17108v4smXOqxdLvHl9CxTCJslmeogjm4Y87IXFuM=";
|
||||||
"nalgebra-0.32.6" = "sha256-L/YudkVOtfGYoNQKBD7LMk/sMYgRDzPDdpGL5rO7G2I=";
|
"nalgebra-0.32.6" = "sha256-ZbQQZbM3A5cJ4QbujtUxkrI0/qGlI4UzfahtyQnvMZA=";
|
||||||
|
"core_io-0.1.0" = "sha256-0HINFWRiJx8pjMgUOL/CS336ih7SENSRh3Kah9LPRrw=";
|
||||||
|
"fatfs-0.3.6" = "sha256-Nz9hCq/1YgSXF8ltJ5ZawV0Hc8WV44KNK0tJdVnNb4U=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -134,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
|
||||||
llvmPackages_11.llvm
|
pkgs.llvmPackages_13.llvm
|
||||||
llvmPackages_11.clang-unwrapped
|
pkgs.llvmPackages_13.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="${llvmPackages_11.clang-unwrapped.lib}/lib/clang/11.1.0/include"
|
export CLANG_EXTRA_INCLUDE_DIR="${pkgs.llvmPackages_13.clang-unwrapped.lib}/lib/clang/13.0.1/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}
|
||||||
@ -375,8 +376,8 @@
|
|||||||
name = "artiq-zynq-dev-shell";
|
name = "artiq-zynq-dev-shell";
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
rust
|
rust
|
||||||
llvmPackages_11.llvm
|
llvmPackages_13.llvm
|
||||||
llvmPackages_11.clang-unwrapped
|
llvmPackages_13.clang-unwrapped
|
||||||
gnumake
|
gnumake
|
||||||
cacert
|
cacert
|
||||||
zynqpkgs.cargo-xbuild
|
zynqpkgs.cargo-xbuild
|
||||||
@ -391,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 = "${llvmPackages_11.clang-unwrapped.lib}/lib/clang/11.1.0/include";
|
CLANG_EXTRA_INCLUDE_DIR = "${pkgs.llvmPackages_13.clang-unwrapped.lib}/lib/clang/13.0.1/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}";
|
||||||
|
43
src/Cargo.lock
generated
43
src/Cargo.lock
generated
@ -58,9 +58,9 @@ version = "0.0.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byteorder"
|
name = "byteorder"
|
||||||
version = "1.4.3"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
checksum = "60f0b0d4c0a382d2734228fd12b5a6b5dac185c60e938026fd31b265b94f9bd2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
@ -82,18 +82,14 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "compiler_builtins"
|
name = "compiler_builtins"
|
||||||
version = "0.1.39"
|
version = "0.1.49"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3748f82c7d366a0b4950257d19db685d4958d2fa27c6d164a3f069fec42b748b"
|
checksum = "20b1438ef42c655665a8ab2c1c6d605a305f031d38d9be689ddfef41a20f3aa2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core_io"
|
name = "core_io"
|
||||||
version = "0.1.20210325"
|
version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://git.m-labs.hk/M-Labs/rs-core_io.git?rev=e9d3edf027#e9d3edf0272502b0dd6c26e8a4869c2912657615"
|
||||||
checksum = "97f8932064288cc79feb4d343a399d353a6f6f001e586ece47fe518a9e8507df"
|
|
||||||
dependencies = [
|
|
||||||
"rustc_version",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc"
|
name = "crc"
|
||||||
@ -141,9 +137,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fatfs"
|
name = "fatfs"
|
||||||
version = "0.3.5"
|
version = "0.3.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://git.m-labs.hk/M-Labs/rust-fatfs.git?rev=4b5e420084#4b5e420084fd1c4a9c105680b687523909b6469c"
|
||||||
checksum = "e18f80a87439240dac45d927fd8f8081b6f1e34c03e97271189fa8a8c2e96c8f"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
@ -373,9 +368,9 @@ checksum = "822add9edb1860698b79522510da17bef885171f75aa395cff099d770c609c24"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.17"
|
version = "0.4.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
|
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
]
|
]
|
||||||
@ -395,7 +390,7 @@ checksum = "c75de51135344a4f8ed3cfe2720dc27736f7711989703a0b43aadf3753c55577"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "nalgebra"
|
name = "nalgebra"
|
||||||
version = "0.32.6"
|
version = "0.32.6"
|
||||||
source = "git+https://git.m-labs.hk/M-Labs/nalgebra.git?rev=dd00f9b#dd00f9b46046e0b931d1b470166db02fd29591be"
|
source = "git+https://git.m-labs.hk/M-Labs/nalgebra.git?rev=ad42410ab0#ad42410ab0abb014229e3ff6bc6ccd39ca92d5d1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"approx",
|
"approx",
|
||||||
"num-complex",
|
"num-complex",
|
||||||
@ -520,6 +515,7 @@ dependencies = [
|
|||||||
"build_zynq",
|
"build_zynq",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"core_io",
|
"core_io",
|
||||||
|
"crc",
|
||||||
"cslice",
|
"cslice",
|
||||||
"dwarf",
|
"dwarf",
|
||||||
"dyld",
|
"dyld",
|
||||||
@ -545,15 +541,6 @@ dependencies = [
|
|||||||
"void",
|
"void",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustc_version"
|
|
||||||
version = "0.1.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
|
|
||||||
dependencies = [
|
|
||||||
"semver",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "satman"
|
name = "satman"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
@ -578,12 +565,6 @@ dependencies = [
|
|||||||
"unwind",
|
"unwind",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "semver"
|
|
||||||
version = "0.1.20"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "simba"
|
name = "simba"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
{
|
{
|
||||||
"abi-blacklist": [
|
|
||||||
"stdcall",
|
|
||||||
"fastcall",
|
|
||||||
"vectorcall",
|
|
||||||
"thiscall",
|
|
||||||
"win64",
|
|
||||||
"sysv64"
|
|
||||||
],
|
|
||||||
"arch": "arm",
|
"arch": "arm",
|
||||||
"data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64",
|
"data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64",
|
||||||
"emit-debug-gdb-scripts": false,
|
"emit-debug-gdb-scripts": false,
|
||||||
@ -21,7 +13,6 @@
|
|||||||
"os": "none",
|
"os": "none",
|
||||||
"panic-strategy": "abort",
|
"panic-strategy": "abort",
|
||||||
"requires-uwtable": true,
|
"requires-uwtable": true,
|
||||||
"force-unwind-tables": "yes",
|
|
||||||
"relocation-model": "static",
|
"relocation-model": "static",
|
||||||
"target-c-int-width": "32",
|
"target-c-int-width": "32",
|
||||||
"target-endian": "little",
|
"target-endian": "little",
|
||||||
|
@ -20,7 +20,7 @@ build_zynq = { path = "../libbuild_zynq" }
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
log_buffer = { version = "1.2" }
|
log_buffer = { version = "1.2" }
|
||||||
crc = { version = "1.7", default-features = false }
|
crc = { version = "1.7", default-features = false }
|
||||||
core_io = { version = "0.1", features = ["collections"] }
|
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
|
||||||
embedded-hal = "0.2"
|
embedded-hal = "0.2"
|
||||||
nb = "1.0"
|
nb = "1.0"
|
||||||
void = { version = "1", default-features = false }
|
void = { version = "1", default-features = false }
|
||||||
|
@ -5,7 +5,8 @@ pub const MAX_PACKET: usize = 1024;
|
|||||||
|
|
||||||
// maximum size of arbitrary payloads
|
// maximum size of arbitrary payloads
|
||||||
// used by satellite -> master analyzer, subkernel exceptions
|
// 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)
|
// 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;
|
pub const MASTER_PAYLOAD_MAX_SIZE: usize = SAT_PAYLOAD_MAX_SIZE - /*source*/1 - /*destination*/1 - /*ID*/4;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ name = "io"
|
|||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
core_io = { version = "0.1", features = ["collections"] }
|
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
|
||||||
byteorder = { version = "1.0", default-features = false, optional = true }
|
byteorder = { version = "1.0", default-features = false, optional = true }
|
||||||
|
|
||||||
libsupport_zynq = { path = "@@ZYNQ_RS@@/libsupport_zynq", default-features = false, features = ["alloc_core"] }
|
libsupport_zynq = { path = "@@ZYNQ_RS@@/libsupport_zynq", default-features = false, features = ["alloc_core"] }
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
|
use core::arch::asm;
|
||||||
|
|
||||||
use core_io::{Error as IoError, Read, Write};
|
use core_io::{Error as IoError, Read, Write};
|
||||||
|
|
||||||
@ -47,6 +48,9 @@ impl<T: AsRef<[u8]>> Read for Cursor<T> {
|
|||||||
let len = buf.len().min(data.len());
|
let len = buf.len().min(data.len());
|
||||||
// ``copy_from_slice`` generates AXI bursts, use a regular loop instead
|
// ``copy_from_slice`` generates AXI bursts, use a regular loop instead
|
||||||
for i in 0..len {
|
for i in 0..len {
|
||||||
|
unsafe {
|
||||||
|
asm!("", options(preserves_flags, nostack, readonly));
|
||||||
|
}
|
||||||
buf[i] = data[i];
|
buf[i] = data[i];
|
||||||
}
|
}
|
||||||
self.pos += len;
|
self.pos += len;
|
||||||
@ -59,6 +63,9 @@ impl Write for Cursor<&mut [u8]> {
|
|||||||
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 {
|
for i in 0..len {
|
||||||
|
unsafe {
|
||||||
|
asm!("", options(preserves_flags, nostack, readonly));
|
||||||
|
}
|
||||||
data[i] = buf[i];
|
data[i] = buf[i];
|
||||||
}
|
}
|
||||||
self.pos += len;
|
self.pos += len;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
|
#![feature(asm)]
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
@ -12,7 +12,7 @@ build_zynq = { path = "../libbuild_zynq" }
|
|||||||
cslice = "0.3"
|
cslice = "0.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
nb = "0.1"
|
nb = "0.1"
|
||||||
core_io = { version = "0.1", features = ["collections"] }
|
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
|
||||||
byteorder = { version = "1.3", default-features = false }
|
byteorder = { version = "1.3", default-features = false }
|
||||||
void = { version = "1", default-features = false }
|
void = { version = "1", default-features = false }
|
||||||
log_buffer = { version = "1.2" }
|
log_buffer = { version = "1.2" }
|
||||||
@ -35,6 +35,6 @@ libboard_artiq = { path = "../libboard_artiq" }
|
|||||||
|
|
||||||
[dependencies.nalgebra]
|
[dependencies.nalgebra]
|
||||||
git = "https://git.m-labs.hk/M-Labs/nalgebra.git"
|
git = "https://git.m-labs.hk/M-Labs/nalgebra.git"
|
||||||
rev = "dd00f9b"
|
rev = "ad42410ab0"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["libm", "alloc"]
|
features = ["libm", "alloc"]
|
||||||
|
@ -96,29 +96,35 @@ struct ExceptionBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static mut EXCEPTION_BUFFER: ExceptionBuffer = ExceptionBuffer {
|
static mut EXCEPTION_BUFFER: ExceptionBuffer = ExceptionBuffer {
|
||||||
uw_exceptions: [uw::_Unwind_Exception {
|
uw_exceptions: [const {
|
||||||
exception_class: EXCEPTION_CLASS,
|
uw::_Unwind_Exception {
|
||||||
exception_cleanup: cleanup,
|
exception_class: EXCEPTION_CLASS,
|
||||||
private: [0; uw::unwinder_private_data_size],
|
exception_cleanup: cleanup,
|
||||||
|
private: [0; uw::unwinder_private_data_size],
|
||||||
|
}
|
||||||
}; MAX_INFLIGHT_EXCEPTIONS],
|
}; MAX_INFLIGHT_EXCEPTIONS],
|
||||||
exceptions: [None; MAX_INFLIGHT_EXCEPTIONS + 1],
|
exceptions: [None; MAX_INFLIGHT_EXCEPTIONS + 1],
|
||||||
exception_stack: [-1; MAX_INFLIGHT_EXCEPTIONS + 1],
|
exception_stack: [-1; MAX_INFLIGHT_EXCEPTIONS + 1],
|
||||||
backtrace: [(0, 0); MAX_BACKTRACE_SIZE],
|
backtrace: [(0, 0); MAX_BACKTRACE_SIZE],
|
||||||
backtrace_size: 0,
|
backtrace_size: 0,
|
||||||
stack_pointers: [StackPointerBacktrace {
|
stack_pointers: [const {
|
||||||
stack_pointer: 0,
|
StackPointerBacktrace {
|
||||||
initial_backtrace_size: 0,
|
stack_pointer: 0,
|
||||||
current_backtrace_size: 0,
|
initial_backtrace_size: 0,
|
||||||
|
current_backtrace_size: 0,
|
||||||
|
}
|
||||||
}; MAX_INFLIGHT_EXCEPTIONS + 1],
|
}; MAX_INFLIGHT_EXCEPTIONS + 1],
|
||||||
exception_count: 0,
|
exception_count: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub unsafe extern "C" fn reset_exception_buffer() {
|
pub unsafe extern "C" fn reset_exception_buffer() {
|
||||||
trace!("reset exception buffer");
|
trace!("reset exception buffer");
|
||||||
EXCEPTION_BUFFER.uw_exceptions = [uw::_Unwind_Exception {
|
EXCEPTION_BUFFER.uw_exceptions = [const {
|
||||||
exception_class: EXCEPTION_CLASS,
|
uw::_Unwind_Exception {
|
||||||
exception_cleanup: cleanup,
|
exception_class: EXCEPTION_CLASS,
|
||||||
private: [0; uw::unwinder_private_data_size],
|
exception_cleanup: cleanup,
|
||||||
|
private: [0; uw::unwinder_private_data_size],
|
||||||
|
}
|
||||||
}; MAX_INFLIGHT_EXCEPTIONS];
|
}; MAX_INFLIGHT_EXCEPTIONS];
|
||||||
EXCEPTION_BUFFER.exceptions = [None; MAX_INFLIGHT_EXCEPTIONS + 1];
|
EXCEPTION_BUFFER.exceptions = [None; MAX_INFLIGHT_EXCEPTIONS + 1];
|
||||||
EXCEPTION_BUFFER.exception_stack = [-1; MAX_INFLIGHT_EXCEPTIONS + 1];
|
EXCEPTION_BUFFER.exception_stack = [-1; MAX_INFLIGHT_EXCEPTIONS + 1];
|
||||||
|
@ -82,7 +82,7 @@ pub extern "C" fn dma_record_stop(duration: i64, enable_ddma: bool) {
|
|||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
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;
|
||||||
let length = HEADER_LENGTH + /*data*/words * 4;
|
let length = HEADER_LENGTH + /*data*/words * 4;
|
||||||
|
|
||||||
let buffer = &mut RECORDER.as_mut().unwrap().buffer;
|
let buffer = &mut RECORDER.as_mut().unwrap().buffer;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
|
#![allow(incomplete_features)]
|
||||||
#![feature(c_variadic)]
|
#![feature(c_variadic)]
|
||||||
#![feature(const_btree_new)]
|
#![feature(const_btree_new)]
|
||||||
#![feature(const_in_array_repeat_expressions)]
|
#![feature(inline_const)]
|
||||||
#![feature(naked_functions)]
|
#![feature(naked_functions)]
|
||||||
#![feature(asm)]
|
#![feature(asm)]
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(link_cfg)]
|
#![feature(link_cfg)]
|
||||||
#![feature(nll)]
|
#![feature(nll)]
|
||||||
#![feature(unwind_attributes)]
|
#![feature(c_unwind)]
|
||||||
#![feature(static_nobundle)]
|
#![feature(static_nobundle)]
|
||||||
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
|
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
|
||||||
|
|
||||||
|
@ -77,8 +77,7 @@ pub type _Unwind_Exception_Cleanup_Fn =
|
|||||||
all(feature = "llvm-libunwind", any(target_os = "fuchsia", target_os = "linux")),
|
all(feature = "llvm-libunwind", any(target_os = "fuchsia", target_os = "linux")),
|
||||||
link(name = "unwind", kind = "static")
|
link(name = "unwind", kind = "static")
|
||||||
)]
|
)]
|
||||||
extern "C" {
|
extern "C-unwind" {
|
||||||
#[unwind(allowed)]
|
|
||||||
pub fn _Unwind_Resume(exception: *mut _Unwind_Exception) -> !;
|
pub fn _Unwind_Resume(exception: *mut _Unwind_Exception) -> !;
|
||||||
pub fn _Unwind_DeleteException(exception: *mut _Unwind_Exception);
|
pub fn _Unwind_DeleteException(exception: *mut _Unwind_Exception);
|
||||||
pub fn _Unwind_GetLanguageSpecificData(ctx: *mut _Unwind_Context) -> *mut c_void;
|
pub fn _Unwind_GetLanguageSpecificData(ctx: *mut _Unwind_Context) -> *mut c_void;
|
||||||
@ -226,8 +225,7 @@ if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
|
|||||||
#[cfg_attr(all(feature = "llvm-libunwind",
|
#[cfg_attr(all(feature = "llvm-libunwind",
|
||||||
any(target_os = "fuchsia", target_os = "linux")),
|
any(target_os = "fuchsia", target_os = "linux")),
|
||||||
link(name = "unwind", kind = "static"))]
|
link(name = "unwind", kind = "static"))]
|
||||||
extern "C" {
|
extern "C-unwind" {
|
||||||
#[unwind(allowed)]
|
|
||||||
pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
|
pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
|
||||||
pub fn _Unwind_Backtrace(trace: _Unwind_Trace_Fn,
|
pub fn _Unwind_Backtrace(trace: _Unwind_Trace_Fn,
|
||||||
trace_argument: *mut c_void)
|
trace_argument: *mut c_void)
|
||||||
@ -238,8 +236,7 @@ if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
|
|||||||
#[cfg_attr(all(feature = "llvm-libunwind",
|
#[cfg_attr(all(feature = "llvm-libunwind",
|
||||||
any(target_os = "fuchsia", target_os = "linux")),
|
any(target_os = "fuchsia", target_os = "linux")),
|
||||||
link(name = "unwind", kind = "static"))]
|
link(name = "unwind", kind = "static"))]
|
||||||
extern "C" {
|
extern "C-unwind" {
|
||||||
#[unwind(allowed)]
|
|
||||||
pub fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
|
pub fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ num-derive = "0.3"
|
|||||||
cslice = "0.3"
|
cslice = "0.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
embedded-hal = "0.2"
|
embedded-hal = "0.2"
|
||||||
core_io = { version = "0.1", features = ["collections"] }
|
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
|
||||||
crc = { version = "1.7", default-features = false }
|
crc = { version = "1.7", default-features = false }
|
||||||
byteorder = { version = "1.3", default-features = false }
|
byteorder = { version = "1.3", default-features = false }
|
||||||
void = { version = "1", default-features = false }
|
void = { version = "1", default-features = false }
|
||||||
|
@ -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.32"
|
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
|
||||||
|
@ -16,7 +16,7 @@ build_zynq = { path = "../libbuild_zynq" }
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
log = { version = "0.4", default-features = false }
|
log = { version = "0.4", default-features = false }
|
||||||
byteorder = { version = "1.3", default-features = false }
|
byteorder = { version = "1.3", default-features = false }
|
||||||
core_io = { version = "0.1", features = ["collections"] }
|
core_io = { git = "https://git.m-labs.hk/M-Labs/rs-core_io.git", rev = "e9d3edf027", features = ["collections"] }
|
||||||
crc = { version = "1.7", default-features = false }
|
crc = { version = "1.7", default-features = false }
|
||||||
cslice = "0.3"
|
cslice = "0.3"
|
||||||
embedded-hal = "0.2"
|
embedded-hal = "0.2"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(alloc_error_handler, try_trait, never_type, panic_info_message)]
|
#![feature(alloc_error_handler, never_type, panic_info_message)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
@ -2,7 +2,7 @@ use alloc::{collections::BTreeMap,
|
|||||||
format,
|
format,
|
||||||
string::{String, ToString},
|
string::{String, ToString},
|
||||||
vec::Vec};
|
vec::Vec};
|
||||||
use core::{option::NoneError, slice, str};
|
use core::{slice, str};
|
||||||
|
|
||||||
use core_io::{Error as IoError, Write};
|
use core_io::{Error as IoError, Write};
|
||||||
use cslice::AsCSlice;
|
use cslice::AsCSlice;
|
||||||
@ -65,12 +65,6 @@ pub enum Error {
|
|||||||
DmaError(DmaError),
|
DmaError(DmaError),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<NoneError> for Error {
|
|
||||||
fn from(_: NoneError) -> Error {
|
|
||||||
Error::KernelNotFound
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<IoError> for Error {
|
impl From<IoError> for Error {
|
||||||
fn from(_value: IoError) -> Error {
|
fn from(_value: IoError) -> Error {
|
||||||
Error::SubkernelIoError
|
Error::SubkernelIoError
|
||||||
@ -316,7 +310,7 @@ impl<'a> Manager<'_> {
|
|||||||
complete: false,
|
complete: false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
self.kernels.get_mut(&id)?
|
self.kernels.get_mut(&id).ok_or_else(|| Error::KernelNotFound)?
|
||||||
} else {
|
} else {
|
||||||
kernel
|
kernel
|
||||||
}
|
}
|
||||||
@ -329,7 +323,7 @@ impl<'a> Manager<'_> {
|
|||||||
complete: false,
|
complete: false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
self.kernels.get_mut(&id)?
|
self.kernels.get_mut(&id).ok_or_else(|| Error::KernelNotFound)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
kernel.library.extend(&data[0..data_len]);
|
kernel.library.extend(&data[0..data_len]);
|
||||||
@ -396,15 +390,19 @@ impl<'a> Manager<'_> {
|
|||||||
if self.session.id == id && self.session.kernel_state == KernelState::Loaded {
|
if self.session.id == id && self.session.kernel_state == KernelState::Loaded {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
if !self.kernels.get(&id)?.complete {
|
if !self.kernels.get(&id).ok_or_else(|| Error::KernelNotFound)?.complete {
|
||||||
return Err(Error::KernelNotFound);
|
return Err(Error::KernelNotFound);
|
||||||
}
|
}
|
||||||
self.session = Session::new(id);
|
self.session = Session::new(id);
|
||||||
self.control.restart();
|
self.control.restart();
|
||||||
|
|
||||||
self.control
|
self.control.tx.send(kernel::Message::LoadRequest(
|
||||||
.tx
|
self.kernels
|
||||||
.send(kernel::Message::LoadRequest(self.kernels.get(&id)?.library.clone()));
|
.get(&id)
|
||||||
|
.ok_or_else(|| Error::KernelNotFound)?
|
||||||
|
.library
|
||||||
|
.clone(),
|
||||||
|
));
|
||||||
let reply = self.control.rx.recv();
|
let reply = self.control.rx.recv();
|
||||||
match reply {
|
match reply {
|
||||||
kernel::Message::LoadCompleted => Ok(()),
|
kernel::Message::LoadCompleted => Ok(()),
|
||||||
|
Loading…
Reference in New Issue
Block a user