run.sh (631B)
1 #!/bin/sh 2 3 script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) 4 test_dir="$script_dir/perilus-rv32i/elfs/rv32i/I" 5 test_stems=$(find "$test_dir" -name "*.elf" | xargs -L 1 basename -s .elf | sort) 6 tmp_dir="/tmp/perilus" 7 8 if [ ! -d $tmp_dir ] 9 then 10 mkdir "$tmp_dir" 11 fi 12 13 exit_code=0 14 for test_stem in $test_stems 15 do 16 echo -en "$test_stem:\t" 17 riscv64-none-elf-objcopy -O binary "$test_dir/$test_stem.elf" "$tmp_dir/$test_stem.bin" 18 if cd "$script_dir/../sim" && cargo run --release -q -p sim-cli -- test "$tmp_dir/$test_stem.bin" 19 then 20 echo -e "PASS" 21 else 22 exit_code=1 23 fi 24 done 25 26 exit $exit_code