Try update Rust

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2023-02-15 10:03:00 +08:00
parent 800c12e794
commit a48b600866
10 changed files with 52 additions and 131 deletions

View File

@ -11,11 +11,11 @@
"src-pythonparser": "src-pythonparser"
},
"locked": {
"lastModified": 1672816435,
"narHash": "sha256-cH2i+1eoJ+K9rAxctVjUR5oNWi54USjbtXPYj5a0j7A=",
"lastModified": 1675160655,
"narHash": "sha256-4qRwBKDMtuIOxM1yEAn8CkRZnIr2ehco/AEJGYg0mn8=",
"ref": "refs/heads/master",
"rev": "1be7e2a2e1d142802a52792865b19c8874fd0e9d",
"revCount": 8257,
"rev": "07d684a35d98ae4e133023f124de8122260ba9f0",
"revCount": 8309,
"type": "git",
"url": "https://github.com/m-labs/artiq.git"
},
@ -68,11 +68,11 @@
"mozilla-overlay": {
"flake": false,
"locked": {
"lastModified": 1664789696,
"narHash": "sha256-UGWJHQShiwLCr4/DysMVFrYdYYHcOqAOVsWNUu+l6YU=",
"lastModified": 1672878308,
"narHash": "sha256-0+fl6PHokhtSV+w58z2QD2rTf8QhcOGsT9o4LwHHZHE=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "80627b282705101e7b38e19ca6e8df105031b072",
"rev": "d38863db88e100866b3e494a651ee4962b762fcc",
"type": "github"
},
"original": {
@ -84,11 +84,11 @@
"mozilla-overlay_2": {
"flake": false,
"locked": {
"lastModified": 1672878308,
"narHash": "sha256-0+fl6PHokhtSV+w58z2QD2rTf8QhcOGsT9o4LwHHZHE=",
"lastModified": 1675354105,
"narHash": "sha256-ZAJGIZ7TjOCU7302lSUabNDz+rxM4If0l8/ZbE/7R5U=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "d38863db88e100866b3e494a651ee4962b762fcc",
"rev": "85eb0ba7d8e5d6d4b79e5b0180aadbdd25d76404",
"type": "github"
},
"original": {
@ -115,11 +115,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1669735802,
"narHash": "sha256-qtG/o/i5ZWZLmXw108N2aPiVsxOcidpHJYNkT45ry9Q=",
"lastModified": 1673345971,
"narHash": "sha256-4DfFcKLRfVUTyuGrGNNmw37IeIZSoku9tgTVmu/iD98=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "731cc710aeebecbf45a258e977e8b68350549522",
"rev": "54644f409ab471e87014bb305eac8c50190bcf48",
"type": "github"
},
"original": {
@ -144,11 +144,11 @@
]
},
"locked": {
"lastModified": 1669369686,
"narHash": "sha256-YHez+S3PTUgtuliUNB5WM+RXcj8RKLbHVRvOgELSkwU=",
"lastModified": 1673433867,
"narHash": "sha256-a7Oq35YoDzPtISbqAsaT+2/v15HZ7G1q0ukXmKWdb7Q=",
"owner": "m-labs",
"repo": "sipyco",
"rev": "98db6eacb084c2c5280fb653bee3d313e3ca6df8",
"rev": "38f8f4185d7db6b68bd7f71546da9077b1e2561c",
"type": "github"
},
"original": {
@ -160,11 +160,11 @@
"src-migen": {
"flake": false,
"locked": {
"lastModified": 1662111470,
"narHash": "sha256-IPyhoFZLhY8d3jHB8jyvGdbey7V+X5eCzBZYSrJ18ec=",
"lastModified": 1673433200,
"narHash": "sha256-ribBG06gsucz5oBS+O6aL8s2oJjx+qfl+vXmspts8gg=",
"owner": "m-labs",
"repo": "migen",
"rev": "639e66f4f453438e83d86dc13491b9403bbd8ec6",
"rev": "f3e9145c9825514a1b4225378936569da4df8e12",
"type": "github"
},
"original": {
@ -176,11 +176,11 @@
"src-misoc": {
"flake": false,
"locked": {
"lastModified": 1669779825,
"narHash": "sha256-l3lyy6dmbivo9Tppb08KHSyU89ZZG1CCcSjPlNRD210=",
"ref": "master",
"rev": "2c255775f732a41ba1a512ab3d2547af4e25f674",
"revCount": 2435,
"lastModified": 1671158014,
"narHash": "sha256-50w0K2E2ympYrG1Tte/HVbsp4FS2U+yohqZByXTOo4I=",
"ref": "refs/heads/master",
"rev": "26f039f9f6931a20a04ccd0f0a5402f67f553916",
"revCount": 2436,
"submodules": true,
"type": "git",
"url": "https://github.com/m-labs/misoc.git"
@ -216,17 +216,18 @@
]
},
"locked": {
"lastModified": 1669819016,
"narHash": "sha256-WvNMUekL4Elc55RdqX8XP43QPnBrK8Rbd0bsoI61E5U=",
"ref": "refs/heads/master",
"rev": "67dbb5932fa8ff5f143983476f741f945871d286",
"revCount": 624,
"lastModified": 1675845406,
"narHash": "sha256-2hwf7SOcqGWBETymimQuVwWtVemg6rbPGU3CqL5uIpw=",
"ref": "102-update-rust",
"rev": "755e7d6aae141510763502da07167393ecc1cc4b",
"revCount": 627,
"type": "git",
"url": "https://git.m-labs.hk/m-labs/zynq-rs"
"url": "https://git.m-labs.hk/esavkin/zynq-rs"
},
"original": {
"ref": "102-update-rust",
"type": "git",
"url": "https://git.m-labs.hk/m-labs/zynq-rs"
"url": "https://git.m-labs.hk/esavkin/zynq-rs"
}
}
},

View File

@ -3,7 +3,7 @@
inputs.artiq.url = git+https://github.com/m-labs/artiq.git;
inputs.mozilla-overlay = { url = github:mozilla/nixpkgs-mozilla; flake = false; };
inputs.zynq-rs.url = git+https://git.m-labs.hk/m-labs/zynq-rs;
inputs.zynq-rs.url = git+https://git.m-labs.hk/esavkin/zynq-rs?ref=102-update-rust;
inputs.zynq-rs.inputs.nixpkgs.follows = "artiq/nixpkgs";
outputs = { self, mozilla-overlay, zynq-rs, artiq }:
@ -123,6 +123,7 @@
lockFile = src/Cargo.lock;
outputHashes = {
"libasync-0.0.0" = "sha256-WvNMUekL4Elc55RdqX8XP43QPnBrK8Rbd0bsoI61E5U=";
"core_io-0.1.20221029" = "sha256-WvNMUekL4Elc55RdqX8XP43QPnBrK8Rbd0bsoI61E5U=";
};
};
@ -144,7 +145,7 @@
installPhase = ''
mkdir -p $out $out/nix-support
cp ../build/${fwtype}.bin $out/${fwtype}.bin
cp ../build/firmware/armv7-none-eabihf/release/${fwtype} $out/${fwtype}.elf
cp ../build/firmware/armv7a-none-eabihf/release/${fwtype} $out/${fwtype}.elf
echo file binary-dist $out/${fwtype}.bin >> $out/nix-support/hydra-build-products
echo file binary-dist $out/${fwtype}.elf >> $out/nix-support/hydra-build-products
'';

View File

@ -1,4 +1,4 @@
[target.armv7-none-eabihf]
[target.armv7a-none-eabihf]
rustflags = [
"-C", "link-arg=-Tlink.x",
"-C", "target-feature=a9,armv7-a,neon",
@ -6,4 +6,4 @@ rustflags = [
]
[build]
target = "armv7-none-eabihf.json"
target = "armv7a-none-eabihf.json"

89
src/Cargo.lock generated
View File

@ -73,9 +73,8 @@ checksum = "3748f82c7d366a0b4950257d19db685d4958d2fa27c6d164a3f069fec42b748b"
[[package]]
name = "core_io"
version = "0.1.20210325"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97f8932064288cc79feb4d343a399d353a6f6f001e586ece47fe518a9e8507df"
version = "0.1.20221029"
source = "git+https://github.com/thomasfire/rust-core_io.git#b33eedf99f3c4b417e354aa370858332a00e24e9"
dependencies = [
"rustc_version",
]
@ -124,17 +123,6 @@ dependencies = [
"void",
]
[[package]]
name = "fatfs"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e18f80a87439240dac45d927fd8f8081b6f1e34c03e97271189fa8a8c2e96c8f"
dependencies = [
"bitflags",
"byteorder",
"core_io",
"log",
]
[[package]]
name = "futures"
@ -218,17 +206,7 @@ dependencies = [
"libsupport_zynq",
]
[[package]]
name = "libasync"
version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#67dbb5932fa8ff5f143983476f741f945871d286"
dependencies = [
"embedded-hal",
"libcortex_a9",
"nb 1.0.0",
"pin-utils",
"smoltcp",
]
[[package]]
name = "libboard_artiq"
@ -250,22 +228,7 @@ dependencies = [
"void",
]
[[package]]
name = "libboard_zynq"
version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#67dbb5932fa8ff5f143983476f741f945871d286"
dependencies = [
"bit_field",
"embedded-hal",
"libasync",
"libcortex_a9",
"libregister",
"log",
"nb 0.1.3",
"smoltcp",
"void",
"volatile-register",
]
[[package]]
name = "libc"
@ -275,56 +238,12 @@ dependencies = [
"libboard_zynq",
]
[[package]]
name = "libconfig"
version = "0.1.0"
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#67dbb5932fa8ff5f143983476f741f945871d286"
dependencies = [
"core_io",
"fatfs",
"libboard_zynq",
"log",
]
[[package]]
name = "libcortex_a9"
version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#67dbb5932fa8ff5f143983476f741f945871d286"
dependencies = [
"bit_field",
"libregister",
"volatile-register",
]
[[package]]
name = "libm"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
[[package]]
name = "libregister"
version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#67dbb5932fa8ff5f143983476f741f945871d286"
dependencies = [
"bit_field",
"vcell",
"volatile-register",
]
[[package]]
name = "libsupport_zynq"
version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#67dbb5932fa8ff5f143983476f741f945871d286"
dependencies = [
"cc",
"compiler_builtins",
"libboard_zynq",
"libcortex_a9",
"libregister",
"linked_list_allocator",
"r0",
]
[[package]]
name = "linked_list_allocator"

View File

@ -13,22 +13,22 @@ satman: ../build/satman.bin
mkdir -p ../build
python gateware/$(TARGET).py -r ../build/pl.rs -c ../build/rustc-cfg -m ../build/mem.rs $(GWARGS)
../build/firmware/armv7-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(shell find . -type f -print)
../build/firmware/armv7a-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(shell find . -type f -print)
cd runtime && \
XBUILD_SYSROOT_PATH=`pwd`/../../build/sysroot \
cargo xbuild --release \
--target-dir ../../build/firmware \
--no-default-features --features=target_$(TARGET)
../build/runtime.bin: ../build/firmware/armv7-none-eabihf/release/runtime
llvm-objcopy -O binary ../build/firmware/armv7-none-eabihf/release/runtime ../build/runtime.bin
../build/runtime.bin: ../build/firmware/armv7a-none-eabihf/release/runtime
llvm-objcopy -O binary ../build/firmware/armv7a-none-eabihf/release/runtime ../build/runtime.bin
../build/firmware/armv7-none-eabihf/release/satman: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(shell find . -type f -print)
../build/firmware/armv7a-none-eabihf/release/satman: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(shell find . -type f -print)
cd satman && \
XBUILD_SYSROOT_PATH=`pwd`/../../build/sysroot \
cargo xbuild --release \
--target-dir ../../build/firmware \
--no-default-features --features=target_$(TARGET)
../build/satman.bin: ../build/firmware/armv7-none-eabihf/release/satman
llvm-objcopy -O binary ../build/firmware/armv7-none-eabihf/release/satman ../build/satman.bin
../build/satman.bin: ../build/firmware/armv7a-none-eabihf/release/satman
llvm-objcopy -O binary ../build/firmware/armv7a-none-eabihf/release/satman ../build/satman.bin

View File

@ -18,7 +18,7 @@ build_zynq = { path = "../libbuild_zynq" }
log = "0.4"
log_buffer = { version = "1.2" }
crc = { version = "1.7", default-features = false }
core_io = { version = "0.1", features = ["collections"] }
core_io = { version = "0.1", features = ["collections"], git = "https://github.com/thomasfire/rust-core_io.git" }
embedded-hal = "0.2"
nb = "1.0"
void = { version = "1", default-features = false }

View File

@ -22,7 +22,7 @@ mod libc {
cfg.flag(&("-isystem".to_owned() + &extra_include));
}
cfg.flag("-fno-stack-protector");
cfg.flag("--target=armv7-none-eabihf");
cfg.flag("--target=armv7a-none-eabihf");
cfg.flag("-O2");
cfg.flag("-std=c99");

View File

@ -8,7 +8,7 @@ name = "io"
path = "lib.rs"
[dependencies]
core_io = { version = "0.1", features = ["collections"] }
core_io = { version = "0.1", features = ["collections"], git = "https://github.com/thomasfire/rust-core_io.git" }
byteorder = { version = "1.0", default-features = false, optional = true }
libsupport_zynq = { default-features = false, features = ["alloc_core"], git = "https://git.m-labs.hk/M-Labs/zynq-rs.git" }

View File

@ -21,7 +21,7 @@ mod llvm_libunwind {
cfg.flag(&("-isystem".to_owned() + &extra_include));
}
cfg.flag("-fno-stack-protector");
cfg.flag("--target=armv7-none-eabihf");
cfg.flag("--target=armv7a-none-eabihf");
cfg.flag("-O2");
cfg.flag("-flto");

View File

@ -20,7 +20,7 @@ cslice = "0.3"
log = "0.4"
nb = "0.1"
embedded-hal = "0.2"
core_io = { version = "0.1", features = ["collections"] }
core_io = { version = "0.1", features = ["collections"], git = "https://github.com/thomasfire/rust-core_io.git" }
byteorder = { version = "1.3", default-features = false }
void = { version = "1", default-features = false }
futures = { version = "0.3", default-features = false, features = ["async-await"] }