Initial Chisel core implementation
This commit is contained in:
61
sim/scripts/run_tests.sh
Executable file
61
sim/scripts/run_tests.sh
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
|
||||
TESTBENCH="../verilator/obj_dir/VCore"
|
||||
TESTS_DIR="../../riscv-tests/isa"
|
||||
RESULTS_FILE="test_results.txt"
|
||||
|
||||
if [ ! -x "$TESTBENCH" ]; then
|
||||
echo "Error: Testbench not found. Run 'make compile' first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running RISC-V tests..." > $RESULTS_FILE
|
||||
echo "====================" >> $RESULTS_FILE
|
||||
|
||||
PASS=0
|
||||
FAIL=0
|
||||
TIMEOUT=0
|
||||
|
||||
for test in $TESTS_DIR/rv64ui-p-* $TESTS_DIR/rv64um-p-* $TESTS_DIR/rv64ua-p-*; do
|
||||
# Skip dump files
|
||||
[[ $test == *.dump ]] && continue
|
||||
[ ! -f "$test" ] && continue
|
||||
|
||||
testname=$(basename $test)
|
||||
echo -n "Running $testname... "
|
||||
|
||||
# Run with 5 second timeout
|
||||
output=$(timeout 5s $TESTBENCH $test 2>&1)
|
||||
exitcode=$?
|
||||
|
||||
if [ $exitcode -eq 0 ]; then
|
||||
echo "PASS"
|
||||
echo "$testname: PASS" >> $RESULTS_FILE
|
||||
((PASS++))
|
||||
elif [ $exitcode -eq 124 ]; then
|
||||
echo "TIMEOUT"
|
||||
echo "$testname: TIMEOUT" >> $RESULTS_FILE
|
||||
((TIMEOUT++))
|
||||
else
|
||||
echo "FAIL (exit code $exitcode)"
|
||||
echo "$testname: FAIL" >> $RESULTS_FILE
|
||||
((FAIL++))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "" >> $RESULTS_FILE
|
||||
echo "====================" >> $RESULTS_FILE
|
||||
echo "Summary:" >> $RESULTS_FILE
|
||||
echo " PASS: $PASS" >> $RESULTS_FILE
|
||||
echo " FAIL: $FAIL" >> $RESULTS_FILE
|
||||
echo " TIMEOUT: $TIMEOUT" >> $RESULTS_FILE
|
||||
echo " TOTAL: $((PASS + FAIL + TIMEOUT))" >> $RESULTS_FILE
|
||||
|
||||
echo ""
|
||||
echo "Summary:"
|
||||
echo " PASS: $PASS"
|
||||
echo " FAIL: $FAIL"
|
||||
echo " TIMEOUT: $TIMEOUT"
|
||||
echo " TOTAL: $((PASS + FAIL + TIMEOUT))"
|
||||
echo ""
|
||||
echo "Results saved to $RESULTS_FILE"
|
||||
Reference in New Issue
Block a user