Skip to content

Commit 175c9ba

Browse files
committed
test
1 parent 8e22624 commit 175c9ba

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

tests/riscv/riscv-vector-tests/gen-test.sh.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
XLEN=${XLEN:-"@XLEN@"}
44
TOOLDIR=${TOOLDIR:-"@TOOLDIR@"}
5+
RISCV_TOOLCHAIN_PATH64=${RISCV_TOOLCHAIN_PATH:-"$TOOLDIR/riscv64-gnu-toolchain"}
56
RISCV_TOOLCHAIN_PATH=${RISCV_TOOLCHAIN_PATH:-"$TOOLDIR/riscv$XLEN-gnu-toolchain"}
67
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
78
PREV_DIR=$(pwd)
@@ -10,7 +11,10 @@ sudo apt-get install device-tree-compiler
1011
wget -O- -q https://go.dev/dl/go1.24.0.linux-amd64.tar.gz | tar -xzf -
1112

1213
export RISCV=$RISCV_TOOLCHAIN_PATH
13-
export PATH=$PATH:$PREV_DIR/go/bin:$RISCV/bin
14+
export PATH=$PATH:$PREV_DIR/go/bin
15+
if [ "$XLEN" -ne 64 ]; then
16+
export PATH=$PATH:RISCV_TOOLCHAIN_PATH64/bin
17+
fi
1418

1519
git clone --recursive https://github.com/chipsalliance/riscv-vector-tests.git
1620
cd riscv-vector-tests

tests/riscv/riscv-vector-tests/run-test.sh.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,22 @@ for testcase in ${testcases[@]}; do
8383
rm -f "$testcase*.bin" "$testcase*.dump" "$testcase*.log" > /dev/null 2>&1
8484
done
8585

86-
export passed=0
87-
export failed=0
86+
passed=0
87+
failed=0
8888

8989
for testcase in ${testcases[@]}; do
9090
echo "Testcase: $testcase"
9191
find . -type f -name "${testcase}*" 2>/dev/null | while read -r f; do
9292
"$RISCV_TOOLCHAIN_PATH/bin/riscv$XLEN-unknown-elf-objdump" -D "$f" > "$f.dump"
9393
"$RISCV_TOOLCHAIN_PATH/bin/riscv$XLEN-unknown-elf-objcopy" -O binary "$f" "$f.bin"
9494
echo "running $SCRIPT_DIR/../../../sim/simx/simx -v $f.bin"
95-
"$SCRIPT_DIR/../../../sim/simx/simx" -v "$f.bin" > "$f.log"
95+
"$SCRIPT_DIR/../../../sim/simx/simx" -v "$f.bin" &> "$f.log"
9696
if [ $? -eq 1 ]; then
9797
echo "$f PASSED"
98-
export passed=$((passed+1))
98+
((passed++))
9999
else
100100
echo "$f FAILED"
101-
export failed=$((failed+1))
101+
((failed++))
102102
fi
103103
# REG_TESTS=1 informs the script to delete the previous binary after each vector test to save disk space
104104
# Otherwise, the vector regression tests would run out of disk space eventually

0 commit comments

Comments
 (0)