2019-05-16 10:05:30 -05:00
|
|
|
#!/bin/bash
|
|
|
|
# Regression test version 1.0
|
|
|
|
|
|
|
|
# Set variables
|
2019-06-11 15:28:58 -05:00
|
|
|
my_pwd=$PWD
|
|
|
|
fpga_flow_scripts=${my_pwd}/fpga_flow/scripts
|
|
|
|
vpr_path=${my_pwd}/vpr7_x2p/vpr
|
2019-05-16 15:30:16 -05:00
|
|
|
benchmark="test_modes"
|
|
|
|
include_netlists="_include_netlists.v"
|
|
|
|
compiled_file="compiled_$benchmark"
|
|
|
|
tb_formal_postfix="_top_formal_verification_random_tb"
|
|
|
|
verilog_output_dirname="${benchmark}_Verilog"
|
|
|
|
log_file="${benchmark}_sim.log"
|
2019-06-14 12:44:44 -05:00
|
|
|
new_reg_sh="my_regression.sh"
|
2019-05-16 10:05:30 -05:00
|
|
|
|
2019-06-04 16:21:15 -05:00
|
|
|
|
2019-06-11 15:28:58 -05:00
|
|
|
cd $fpga_flow_scripts
|
2019-06-04 16:21:15 -05:00
|
|
|
|
2019-06-14 12:44:44 -05:00
|
|
|
perl rewrite_path_in_file.pl -i $vpr_path/regression_verilog.sh -o $vpr_path/$new_reg_sh
|
2019-06-11 15:28:58 -05:00
|
|
|
|
|
|
|
cd $my_pwd
|
2019-06-04 16:21:15 -05:00
|
|
|
|
2019-05-16 10:05:30 -05:00
|
|
|
# Move to vpr folder
|
2019-06-11 15:28:58 -05:00
|
|
|
cd $vpr_path
|
2019-05-16 10:05:30 -05:00
|
|
|
|
|
|
|
# Remove former log file
|
2019-05-16 15:30:16 -05:00
|
|
|
rm -f $log_file
|
|
|
|
rm -f $compiled_file
|
2019-05-16 10:05:30 -05:00
|
|
|
|
|
|
|
# Start the script -> run the fpga generation -> run the simulation -> check the log file
|
2019-06-14 12:44:44 -05:00
|
|
|
source $new_reg_sh
|
2019-05-16 10:05:30 -05:00
|
|
|
iverilog -o $compiled_file $verilog_output_dirname/SRC/$benchmark$include_netlists -s $benchmark$tb_formal_postfix
|
|
|
|
vvp $compiled_file -j 16 >> $log_file
|
|
|
|
|
2019-05-16 15:30:16 -05:00
|
|
|
result=`grep "Succeed" $log_file`
|
|
|
|
if ["$result" = ""]; then
|
|
|
|
result=`grep "Failed" $log_file`
|
|
|
|
if ["$result" = ""]; then
|
|
|
|
echo "Unexpected error, Verification didn't run"
|
2019-06-11 15:28:58 -05:00
|
|
|
cd $my_pwd
|
2019-05-16 10:05:30 -05:00
|
|
|
exit 1
|
|
|
|
else
|
2019-05-16 15:30:16 -05:00
|
|
|
echo "Verification failed"
|
2019-06-11 15:28:58 -05:00
|
|
|
cd $my_pwd
|
2019-05-16 10:05:30 -05:00
|
|
|
exit 2
|
|
|
|
fi
|
2019-05-16 15:30:16 -05:00
|
|
|
else
|
|
|
|
echo "Verification succeed"
|
2019-06-11 15:28:58 -05:00
|
|
|
cd $my_pwd
|
2019-05-16 10:05:30 -05:00
|
|
|
fi
|