From 44c2c0fe4d4cdb638e21eafca4a6d742c5efb3a1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 25 Jun 2021 17:03:55 +0800 Subject: [PATCH] support Kasli-SoC in run scripts --- local_run.sh | 16 +++++++++++++--- remote_run.sh | 4 +++- shell.nix | 3 +-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/local_run.sh b/local_run.sh index 0344dde..a423d41 100755 --- a/local_run.sh +++ b/local_run.sh @@ -13,9 +13,9 @@ fi impure=0 load_bitstream=1 -board_host="192.168.1.52" +board_type="kasli_soc" -while getopts "ilb:" opt; do +while getopts "ilb:t:" opt; do case "$opt" in \?) exit 1 ;; @@ -25,15 +25,25 @@ while getopts "ilb:" opt; do ;; b) board_host=$OPTARG ;; + t) board_type=$OPTARG + ;; esac done +if [ -z "$board_host" ]; then + case $board_type in + kasli_soc) board_host="192.168.1.56";; + zc706) board_host="192.168.1.52";; + *) echo "Unknown board type"; exit 1;; + esac +fi + load_bitstream_cmd="" build_dir=`pwd`/build result_dir=`pwd`/result cd $OPENOCD_ZYNQ -openocd -f zc706.cfg -c "load_image $SZL; resume 0; exit" +openocd -f $board_type.cfg -c "load_image $SZL/szl-$board_type.elf; resume 0; exit" sleep 5 if [ $impure -eq 1 ]; then if [ $load_bitstream -eq 1 ]; then diff --git a/remote_run.sh b/remote_run.sh index e8e8017..fe3e479 100755 --- a/remote_run.sh +++ b/remote_run.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# Only ZC706 supported for now. + set -e if [ -z "$OPENOCD_ZYNQ" ]; then @@ -46,7 +48,7 @@ echo "Creating $target_folder..." ssh $sshopts $target_host "mkdir -p $target_folder" echo "Copying files..." rsync -e "ssh $sshopts" -Lc $OPENOCD_ZYNQ/* $target_host:$target_folder -rsync -e "ssh $sshopts" -Lc $SZL $target_host:$target_folder +rsync -e "ssh $sshopts" -Lc $SZL/szl-zc706.elf $target_host:$target_folder/szl.elf if [ $impure -eq 1 ]; then if [ $load_bitstream -eq 1 ]; then load_bitstream_cmd="-g build/gateware/top.bit" diff --git a/shell.nix b/shell.nix index a4a9c57..cb95c25 100644 --- a/shell.nix +++ b/shell.nix @@ -6,7 +6,6 @@ let artiq-fast = ; artiqpkgs = import "${artiq-fast}/default.nix" { inherit pkgs; }; vivado = import "${artiq-fast}/vivado.nix" { inherit pkgs; }; - kasli_soc-szl = (import zynq-rs).kasli_soc-szl; in pkgs.stdenv.mkDerivation { name = "artiq-zynq-env"; @@ -32,5 +31,5 @@ in XARGO_RUST_SRC = "${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library"; CLANG_EXTRA_INCLUDE_DIR = "${pkgs.llvmPackages_9.clang-unwrapped.lib}/lib/clang/9.0.1/include"; OPENOCD_ZYNQ = "${zynq-rs}/openocd"; - SZL = "${kasli_soc-szl}/szl.elf"; + SZL = "${(import zynq-rs).szl}"; }