forked from M-Labs/nac3
1
0
Fork 0

support Kasli-SoC in run scripts

This commit is contained in:
Sebastien Bourdeauducq 2021-06-25 17:03:55 +08:00
parent 4c2c23fcdd
commit 44c2c0fe4d
3 changed files with 17 additions and 6 deletions

View File

@ -13,9 +13,9 @@ fi
impure=0 impure=0
load_bitstream=1 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 case "$opt" in
\?) exit 1 \?) exit 1
;; ;;
@ -25,15 +25,25 @@ while getopts "ilb:" opt; do
;; ;;
b) board_host=$OPTARG b) board_host=$OPTARG
;; ;;
t) board_type=$OPTARG
;;
esac esac
done 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="" load_bitstream_cmd=""
build_dir=`pwd`/build build_dir=`pwd`/build
result_dir=`pwd`/result result_dir=`pwd`/result
cd $OPENOCD_ZYNQ 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 sleep 5
if [ $impure -eq 1 ]; then if [ $impure -eq 1 ]; then
if [ $load_bitstream -eq 1 ]; then if [ $load_bitstream -eq 1 ]; then

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Only ZC706 supported for now.
set -e set -e
if [ -z "$OPENOCD_ZYNQ" ]; then if [ -z "$OPENOCD_ZYNQ" ]; then
@ -46,7 +48,7 @@ echo "Creating $target_folder..."
ssh $sshopts $target_host "mkdir -p $target_folder" ssh $sshopts $target_host "mkdir -p $target_folder"
echo "Copying files..." echo "Copying files..."
rsync -e "ssh $sshopts" -Lc $OPENOCD_ZYNQ/* $target_host:$target_folder 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 [ $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"

View File

@ -6,7 +6,6 @@ let
artiq-fast = <artiq-fast>; artiq-fast = <artiq-fast>;
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; };
kasli_soc-szl = (import zynq-rs).kasli_soc-szl;
in in
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
name = "artiq-zynq-env"; name = "artiq-zynq-env";
@ -32,5 +31,5 @@ in
XARGO_RUST_SRC = "${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library"; 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"; CLANG_EXTRA_INCLUDE_DIR = "${pkgs.llvmPackages_9.clang-unwrapped.lib}/lib/clang/9.0.1/include";
OPENOCD_ZYNQ = "${zynq-rs}/openocd"; OPENOCD_ZYNQ = "${zynq-rs}/openocd";
SZL = "${kasli_soc-szl}/szl.elf"; SZL = "${(import zynq-rs).szl}";
} }