Skip to content
Snippets Groups Projects
Commit ebee00a8 authored by Pieter Donker's avatar Pieter Donker
Browse files

L2SDP-888, cleaned up bash file

parent 34329692
No related branches found
No related tags found
1 merge request!15Resolve L2SDP-888
...@@ -84,7 +84,7 @@ def mkdir(path): ...@@ -84,7 +84,7 @@ def mkdir(path):
expand_path = os.path.expandvars(path) # support using environment variables in the file path expand_path = os.path.expandvars(path) # support using environment variables in the file path
expand_path = os.path.expanduser(expand_path) # support using ~ in the file path expand_path = os.path.expanduser(expand_path) # support using ~ in the file path
if not os.path.exists(expand_path): if not os.path.exists(expand_path):
print("expand_path=%s", expand_path) print("expand_path=%s" % expand_path)
os.makedirs(expand_path) os.makedirs(expand_path)
......
...@@ -451,8 +451,7 @@ class TestBenchWorker(multiprocessing.Process): ...@@ -451,8 +451,7 @@ class TestBenchWorker(multiprocessing.Process):
if not os.path.exists(sim_dir): if not os.path.exists(sim_dir):
os.mkdir(sim_dir) os.mkdir(sim_dir)
os.environ["HDL_IOFILE_SIM_DIR"] = sim_dir os.environ["HDL_IOFILE_SIM_DIR"] = sim_dir
# logger.debug("%s", str(os.environ))
logger.info("%s", str(os.environ))
terminal = Terminal(print_stdout_on_timeout=True) terminal = Terminal(print_stdout_on_timeout=True)
terminal.run_cmd(f"rm -rf {sim_dir}/*") terminal.run_cmd(f"rm -rf {sim_dir}/*")
......
...@@ -46,19 +46,19 @@ set -e ...@@ -46,19 +46,19 @@ set -e
. "${HOME}"/git/radiohdl/generic.sh . "${HOME}"/git/radiohdl/generic.sh
buildset_filename="${1:-}" buildset_filename="${1:-}"
hdl_info "$0" "Do regressiontest for buildsets in file: ${buildset_filename}" echo ".. Do regressiontest for buildsets in file: ${buildset_filename}"
# go to the hdl firmware repository, exit if not excisting # go to the hdl firmware repository, exit if not excisting
hdl_exec "$0" cd "${HOME}"/git/hdl || exit cd "${HOME}"/git/hdl || exit
# init hdl # init hdl
echo "initialize hdl" echo ".. initialize hdl"
. ./init_hdl.sh . ./init_hdl.sh
# update hdl from repository, # update hdl from repository,
echo "update hdl repository" echo ".. Update hdl repository"
hdl_exec "$0" git reset --hard git reset --hard
hdl_exec "$0" git pull git pull
# get hash from last test if file excists # get hash from last test if file excists
git_prev_hash="none" git_prev_hash="none"
...@@ -67,58 +67,60 @@ git_hash_filename="${RADIOHDL_LOG_DIR}"/modelsim_previous_git_hash.txt ...@@ -67,58 +67,60 @@ git_hash_filename="${RADIOHDL_LOG_DIR}"/modelsim_previous_git_hash.txt
git_active_hash=$(git rev-parse HEAD) git_active_hash=$(git rev-parse HEAD)
# make clean modelsim_build_list from given buildset_filename, skip lines starting with # # make clean modelsim_build_list from given buildset_filename, skip lines starting with #
grep -v '^#' < "${buildset_filename}" > modelsim_used_buildset_list.txt echo ".. Read buildsets to check from: ${buildset_filename}"
echo " and make a clean list in: ${RADIOHDL_LOG_DIR}/modelsim_used_buildset_list.txt"
grep -v '^#' < "${buildset_filename}" > "${RADIOHDL_LOG_DIR}/modelsim_used_buildset_list.txt"
# Modelsim test for each line in 'modelsim_used_buildset_list.txt' # Modelsim test for each line in 'modelsim_used_buildset_list.txt'
while read -r line; do while read -r line; do
echo ". Next line in 'modelsim_used_buildset_list.txt' is '${line}'"
if [ -n "${line}" ]; then if [ -n "${line}" ]; then
buildset=$(echo "${line}" | cut -d " " -f1) buildset=$(echo "${line}" | cut -d " " -f1)
hdl_info "$0" "Do all regressiontests for ${buildset}" echo ".. Do all regressiontests for ${buildset}"
logfile="${RADIOHDL_LOG_DIR}/${buildset}/modelsim_regressiontest.log" logfile="${RADIOHDL_LOG_DIR}/${buildset}/modelsim_regressiontest.log"
# Using > will start a new file
echo "Do all regressiontests for ${buildset}" > "${logfile}"
# Delete tempory modelsim files '/tmp/VSOUT*' # Delete tempory modelsim files '/tmp/VSOUT*'
hdl_exec "$0" rm -f /tmp/VSOUT* echo ".. Remove old /tmp/VSOUT* files"
hdl_exec "$0" rm -f /tmp/VSOUT* 1>> "${logfile}" 2>&1
if [ "${git_active_hash}" == "${git_prev_hash}" ]; then if [ "${git_active_hash}" == "${git_prev_hash}" ]; then
hdl_info "$0" "Skip regression test NO change in repository" echo ".. Skip regression test, NO change in repository"
# Send nothing changed mail (-n option) # Send nothing changed mail (-n option)
hdl_info "$0" "call modelsim_regression_test_vhdl_mail" echo ".. Call modelsim_regression_test_vhdl_mail --nochange"
hdl_exec "$0" modelsim_regression_test_vhdl_mail.py "${buildset}" --nochange 1>> "${logfile}" 2>&1 hdl_exec "$0" modelsim_regression_test_vhdl_mail.py "${buildset}" --nochange 1>> "${logfile}" 2>&1
continue continue
fi fi
# Delete any previous log files
if [ -f "${logfile}" ]; then
hdl_exec "$0" rm -f "${logfile}"
fi
echo "cleanup last build"
# Cleanup last build if exists # Cleanup last build if exists
hdl_exec "$0" rm -rf "${HDL_BUILD_DIR:?}"/"${buildset}" echo ".. Cleanup last build ${buildset}"
hdl_exec "$0" rm -rf "${HDL_BUILD_DIR:?}"/"${buildset}" 1>> "${logfile}" 2>&1
# Build all IP # Build all IP
echo "call compile_altera_simlibs" echo ".. Call compile_altera_simlibs"
hdl_exec "$0" compile_altera_simlibs "${buildset}" 1>> "${logfile}" 2>&1 hdl_exec "$0" compile_altera_simlibs "${buildset}" 1>> "${logfile}" 2>&1
echo "call generate_ip_libs" echo ".. Call generate_ip_libs"
hdl_exec "$0" generate_ip_libs "${buildset}" 1>> "${logfile}" 2>&1 hdl_exec "$0" generate_ip_libs "${buildset}" 1>> "${logfile}" 2>&1
# re-create it with modelsim_config and quartus_config # re-create it with modelsim_config and quartus_config
echo "call modelsim_config" echo ".. Call modelsim_config"
hdl_exec "$0" modelsim_config "${buildset}" 1>> "${logfile}" 2>&1 hdl_exec "$0" modelsim_config "${buildset}" 1>> "${logfile}" 2>&1
echo "call quartus_config" echo ".. Call quartus_config"
hdl_exec "$0" quartus_config "${buildset}" 1>> "${logfile}" 2>&1 hdl_exec "$0" quartus_config "${buildset}" 1>> "${logfile}" 2>&1
# Perform the regression test and put the output in a log file # Perform the regression test and put the output in a log file
# -p 4: number of simultaneously test processes, each process needs a license # -p 4: number of simultaneously test processes, each process needs a license
echo "call modelsim_regression_test_vhdl" echo ".. Call modelsim_regression_test_vhdl"
hdl_exec "$0" modelsim_regression_test_vhdl.py "${buildset}" -p 4 1>> "${logfile}" 2>&1 hdl_exec "$0" modelsim_regression_test_vhdl.py "${buildset}" -p 4 1>> "${logfile}" 2>&1
# Read the log file en send the result email # Read the log file en send the result email
echo "call modelsim_regression_test_vhdl_mail" echo ".. Call modelsim_regression_test_vhdl_mail"
hdl_exec "$0" modelsim_regression_test_vhdl_mail.py "${buildset}" 1>> "${logfile}" 2>&1 hdl_exec "$0" modelsim_regression_test_vhdl_mail.py "${buildset}" 1>> "${logfile}" 2>&1
fi fi
done < modelsim_used_buildset_list.txt done < "${RADIOHDL_LOG_DIR}/modelsim_used_buildset_list.txt"
# save hash for next run # save hash for next run
echo "${git_active_hash}" > "${git_hash_filename}" echo "${git_active_hash}" > "${git_hash_filename}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment