infrastructure fixes

This commit is contained in:
Sebastien Bourdeauducq 2020-10-14 21:34:49 +08:00
parent 51c4de4347
commit 42c0c16648
4 changed files with 17 additions and 17 deletions

View File

@ -3,7 +3,7 @@ let
pkgs = import <nixpkgs> { overlays = [ (import "${zynq-rs}/nix/mozilla-overlay.nix") ]; }; pkgs = import <nixpkgs> { overlays = [ (import "${zynq-rs}/nix/mozilla-overlay.nix") ]; };
rustPlatform = (import "${zynq-rs}/nix/rust-platform.nix" { inherit pkgs; }); rustPlatform = (import "${zynq-rs}/nix/rust-platform.nix" { inherit pkgs; });
cargo-xbuild = (import zynq-rs).cargo-xbuild; cargo-xbuild = (import zynq-rs).cargo-xbuild;
rust-pitaya-szl = (import zynq-rs).rust-pitaya-szl; redpitaya-szl = (import zynq-rs).redpitaya-szl;
mkbootimage = import "${zynq-rs}/nix/mkbootimage.nix" { inherit pkgs; }; mkbootimage = import "${zynq-rs}/nix/mkbootimage.nix" { inherit pkgs; };
artiqpkgs = import <artiq-fast/default.nix> { inherit pkgs; }; artiqpkgs = import <artiq-fast/default.nix> { inherit pkgs; };
vivado = import <artiq-fast/vivado.nix> { inherit pkgs; }; vivado = import <artiq-fast/vivado.nix> { inherit pkgs; };
@ -12,7 +12,7 @@ in rec {
name = "rust-pitaya-firmware"; name = "rust-pitaya-firmware";
src = ./src; src = ./src;
cargoSha256 = "097f4y54cc5m0pib08ypzwbf221knj5a079izixkhhz66g5fmgsq"; cargoSha256 = "173013gdlk8mljps6lar892zqgxrmxa7fkv8is3wgvgf7dnifjzs";
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.gnumake pkgs.gnumake
@ -29,7 +29,7 @@ in rec {
installPhase = '' installPhase = ''
mkdir -p $out $out/nix-support mkdir -p $out $out/nix-support
cp ../build/runtime.bin $out/firmware.bin cp ../build/firmware.bin $out/firmware.bin
cp ../build/firmware/armv7-none-eabihf/release/firmware $out/firmware.elf cp ../build/firmware/armv7-none-eabihf/release/firmware $out/firmware.elf
echo file binary-dist $out/firmware.bin >> $out/nix-support/hydra-build-products echo file binary-dist $out/firmware.bin >> $out/nix-support/hydra-build-products
echo file binary-dist $out/firmware.elf >> $out/nix-support/hydra-build-products echo file binary-dist $out/firmware.elf >> $out/nix-support/hydra-build-products
@ -46,7 +46,7 @@ in rec {
]; ];
} }
'' ''
python ${./src/gateware}/zc706.py -g build python ${./src/gateware}/rust-pitaya.py -g build
mkdir -p $out $out/nix-support mkdir -p $out $out/nix-support
cp build/top.bit $out cp build/top.bit $out
echo file binary-dist $out/top.bit >> $out/nix-support/hydra-build-products echo file binary-dist $out/top.bit >> $out/nix-support/hydra-build-products
@ -56,7 +56,7 @@ in rec {
rust-pitaya-jtag = pkgs.runCommand "rust-pitaya-jtag" {} rust-pitaya-jtag = pkgs.runCommand "rust-pitaya-jtag" {}
'' ''
mkdir $out mkdir $out
ln -s ${rust-pitaya-szl}/szl.elf $out ln -s ${redpitaya-szl}/szl.elf $out
ln -s ${rust-pitaya-firmware}/firmware.bin $out ln -s ${rust-pitaya-firmware}/firmware.bin $out
ln -s ${rust-pitaya-gateware}/top.bit $out ln -s ${rust-pitaya-gateware}/top.bit $out
''; '';
@ -69,15 +69,15 @@ in rec {
# can't write software (mkbootimage will segfault). # can't write software (mkbootimage will segfault).
bifdir=`mktemp -d` bifdir=`mktemp -d`
cd $bifdir cd $bifdir
ln -s ${rust-pitaya-szl}/szl.elf szl.elf ln -s ${redpitaya-szl}/szl.elf szl.elf
ln -s ${rust-pitaya-firmware}/runtime.elf runtime.elf ln -s ${rust-pitaya-firmware}/firmware.elf firmware.elf
ln -s ${rust-pitaya-gateware}/top.bit top.bit ln -s ${rust-pitaya-gateware}/top.bit top.bit
cat > boot.bif << EOF cat > boot.bif << EOF
the_ROM_image: the_ROM_image:
{ {
[bootloader]szl.elf [bootloader]szl.elf
top.bit top.bit
runtime.elf firmware.elf
} }
EOF EOF
mkdir $out $out/nix-support mkdir $out $out/nix-support

View File

@ -39,10 +39,10 @@ if [ $impure -eq 1 ]; then
if [ $load_bitstream -eq 1 ]; then if [ $load_bitstream -eq 1 ]; then
load_bitstream_cmd="-g $build_dir/gateware/top.bit" load_bitstream_cmd="-g $build_dir/gateware/top.bit"
fi fi
artiq_netboot $load_bitstream_cmd -f $build_dir/runtime.bin -b $board_host artiq_netboot $load_bitstream_cmd -f $build_dir/firmware.bin -b $board_host
else else
if [ $load_bitstream -eq 1 ]; then if [ $load_bitstream -eq 1 ]; then
load_bitstream_cmd="-g $result_dir/top.bit" load_bitstream_cmd="-g $result_dir/top.bit"
fi fi
artiq_netboot $load_bitstream_cmd -f $result_dir/runtime.bin -b $board_host artiq_netboot $load_bitstream_cmd -f $result_dir/firmware.bin -b $board_host
fi fi

View File

@ -17,7 +17,7 @@ pure_dir="result"
impure_dir="build" impure_dir="build"
sshopts="" sshopts=""
load_bitstream=1 load_bitstream=1
board_host="192.168.1.52" board_host="192.168.1.55"
while getopts "h:id:o:l" opt; do while getopts "h:id:o:l" opt; do
case "$opt" in case "$opt" in
@ -51,14 +51,14 @@ if [ $impure -eq 1 ]; then
if [ $load_bitstream -eq 1 ]; then if [ $load_bitstream -eq 1 ]; then
load_bitstream_cmd="-g build/gateware/top.bit" load_bitstream_cmd="-g build/gateware/top.bit"
fi fi
firmware="build/runtime.bin" firmware="build/firmware.bin"
else else
if [ $load_bitstream -eq 1 ]; then if [ $load_bitstream -eq 1 ]; then
load_bitstream_cmd="-g $pure_dir/top.bit" load_bitstream_cmd="-g $pure_dir/top.bit"
fi fi
firmware="$pure_dir/runtime.bin" firmware="$pure_dir/firmware.bin"
fi fi
echo "Programming board..." echo "Programming board..."
ssh $sshopts $target_host "cd $target_folder; openocd -f zc706.cfg -c'load_image szl.elf; resume 0; exit'" ssh $sshopts $target_host "cd $target_folder; openocd -f redpitaya.cfg -c'load_image szl.elf; resume 0; exit'"
sleep 5 sleep 5
artiq_netboot $load_bitstream_cmd -f $firmware -b $board_host artiq_netboot $load_bitstream_cmd -f $firmware -b $board_host

6
src/Cargo.lock generated
View File

@ -26,14 +26,14 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]] [[package]]
name = "compiler_builtins" name = "compiler_builtins"
version = "0.1.36" version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cd0782e0a7da7598164153173e5a5d4d9b1da094473c98dce0ff91406112369" checksum = "e3fcd8aba10d17504c87ef12d4f62ef404c6a4703d16682a9eb5543e6cf24455"
[[package]] [[package]]
name = "core_io" name = "core_io"
version = "0.1.20200410" version = "0.1.20200410"
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#6266d280951c3fe5d4963a4b1ca45ce369d6b773" source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#80d12d57802b9b78aa45b821a147f71444d401f0"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]