OpenFPGA/.travis/script.sh

67 lines
1.4 KiB
Bash
Raw Normal View History

2019-04-10 02:24:37 -05:00
#!/bin/bash
source .travis/common.sh
set -e
$SPACER
start_section "OpenFPGA.build" "${GREEN}Building..${NC}"
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
2019-05-04 00:18:31 -05:00
#make
mkdir build
2019-05-04 00:24:08 -05:00
cd build
2019-05-04 00:18:31 -05:00
cmake ..
make -j2
2019-04-10 02:24:37 -05:00
else
# For linux, we enable full package compilation
2019-05-04 00:18:31 -05:00
#make
mkdir build
2019-05-04 00:24:08 -05:00
cd build
2019-05-04 00:18:31 -05:00
cmake ..
make -j2
2019-04-10 02:24:37 -05:00
fi
2019-05-15 16:57:05 -05:00
# Begining of Verilog verification
# Set variables
set benchmark = test_modes
set include_netlists = _include_netlists.v
set compiled_file = compiled_$benchmark
set tb_formal_postfix = _top_formal_verification_random_tb
set verilog_output_dirname = ${benchmark}_Verilog
set log_file = ${benchmark}_sim.log
# Move to vpr folder
cd vpr7_x2p/vpr
# Remove former log file
rm $log_file
rm $compiled_file
# Start the script -> run the fpga generation -> run the simulation -> check the log file
source .regression_verilog.sh
iverilog -o $compiled_file $verilog_output_dirname/SRC/$benchmark$include_netlists -s $benchmark$tb_formal_postfix
vvp $compiled_file -j 16 >> $log_file
set result = `grep "Succeed" $log_file`
if ("$result" != "")then
echo "Verification succeed"
cd -
exit 0
else
set result = `grep "Failed" $log_file`
if ("$result" != "")then
echo "Verification failed"
cd -
exit 1
else
echo "Unexpected error, Verification didn't run"
cd -
exit 2
fi
fi
# End of Verilog verification
2019-04-10 02:24:37 -05:00
end_section "OpenFPGA.build"
$SPACER