Skip to content

Commit

Permalink
display returned instructions and clock cycle count after PASS status
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloJacobo committed Jun 23, 2022
1 parent 7092cc4 commit 4998ac0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /bin/bash

# Configurables
# INDIVIDUAL_TESTDIR=./riscv-tests/isa/rv32ui # directory of RISCV testcases used in debug mode (INDIVIDUAL TESTING)
INDIVIDUAL_TESTDIR=./extra # directory of RISCV testcases used in debug mode (INDIVIDUAL TESTING)
INDIVIDUAL_TESTDIR=./riscv-tests/isa/rv32ui # directory of RISCV testcases used in debug mode (INDIVIDUAL TESTING)
#INDIVIDUAL_TESTDIR=./extra # directory of RISCV testcases used in debug mode (INDIVIDUAL TESTING)

# Compilation parameters for RISC-V toolchain
PREFIX=riscv64-unknown-elf-
Expand Down Expand Up @@ -135,10 +135,11 @@ then
vlog -quiet ${rtlfiles} # current testfile will halt on both ebreak/ecall
fi

a=$(vsim -quiet -batch -G MEMORY="${MEMORY}" rv32i_soc_TB -do "run -all;exit" | grep "PASS:\|FAIL:\|UNKNOWN")
a=$(vsim -quiet -batch -G MEMORY="${MEMORY}" rv32i_soc_TB -do "run -all;exit" | grep "PASS:\|FAIL:\|UNKNOWN:" -A1)
if (( $(grep "PASS:" -c <<< $a) != 0 ))
then
printf "PASS!\n\n"
status=$(tail -n 1 <<< $a)
printf "PASS! $status\n\n"
countpassed=$((countpassed+1)) # increment number of PASSED
elif (( $(grep "FAIL:" -c <<< $a) != 0 ))
then
Expand Down Expand Up @@ -257,11 +258,12 @@ else # DEBUG MODE: first argument given is the assembly file to be tested and
vlog -quiet ${rtlfiles} # current testfile will halt on both ebreak/ecall
fi
vsim $2 -G MEMORY="${MEMORY}" rv32i_soc_TB -do "do wave.do;run -all"
a=$(vsim -batch -G MEMORY="${MEMORY}" rv32i_soc_TB -do "run -all;exit" | grep "PASS:\|FAIL:\|UNKNOWN")
a=$(vsim -batch -G MEMORY="${MEMORY}" rv32i_soc_TB -do "run -all;exit" | grep "PASS:\|FAIL:\|UNKNOWN:" -A1)
printf "##############################################################\n"
if (( $(grep "PASS:" -c <<< $a) != 0 ))
then
printf "PASS!\n\n"
then
status=$(tail -n 1 <<< $a)
printf "PASS! $status\n\n"
elif (( $(grep "FAIL:" -c <<< $a) != 0 ))
then
printf "\e[31m$a\n\n\e[0m" # red text for FAILED
Expand Down

0 comments on commit 4998ac0

Please sign in to comment.