URL
https://opencores.org/ocsvn/radiohdl/radiohdl/trunk
Subversion Repositories radiohdl
[/] [radiohdl/] [trunk/] [quartus/] [run_regtest_synth] - Rev 4
Compare with Previous | Blame | View Log
#!/bin/bash -eu
# --------------------------------------------------------------------------
# Copyright (C) 2016
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
# Purpose:
# . Synthesize a list of designs
# Description:
# . TODO: Create cronjob; run every friday evening. SVN update this script in
# the cronjob before executing!
# . This script will exit to the shell immediately on any errors during
# run_qcomp.
# . Raw Binary Files (RBF) will be generated from each design as a final step.
# Usage:
# . ./run_regtest_synth
# Curly bracket used to log all following commands (up to the '}')
LOGFILE=${HOME}/run_regtest_synth.log
{
# Add search paths for executeables to $PATH
export PATH=${PATH}:\
${RADIOHDL_GEAR}/quartus
# Source generic.sh for functions such as hdl_info
. ${HOME}/HDL/radiohdl/generic.sh
# We're assuming the local 'SVN' dir is up to date. Copy it to a timestamped
# dirname and work with that.
SVN_DIR=${HOME}/SVN_$(date -d "today" +"%Y%m%d")
hdl_info $0 "Copying local SVN dir to ${SVN_DIR}"
hdl_exec $0 cp -r ${SVN}/ ${SVN_DIR}
export SVN=${SVN_DIR}
# Disable exit on hdl_error (used in hdl_exec)
NO_EXIT=True
# Setup RadioHDL environment for UniBoard2 and new UniBoard1 applications
hdl_info $0 "Setting up RadioHDL"
hdl_exec $0 . ${RADIOHDL_GEAR}/setup_radiohdl.sh
# Generate all IP
hdl_info $0 "Generating all IP"
hdl_exec $0 cd ${RADIOHDL_WORK}/libraries/technology/ip_stratixiv
#hdl_exec $0 sh generate-all-ip.sh
# Run quartus_config.py
hdl_info $0 "Creating Quartus project build directories"
hdl_exec $0 python ${RADIOHDL_GEAR}/oneclick/base/quartus_config.py
# Build our most important designs
# . KISS: just put the full commands here; no need for hard to maintain
# lookup-tables here.
hdl_info $0 "Building designs"
# unb1_minimal_qsys
#hdl_exec $0 run_sopc unb1 unb1_minimal_sopc
#hdl_exec $0 run_qsys unb1 unb1_minimal_qsys
#hdl_exec $0 run_qcomp unb1 unb1_minimal_qsys
#hdl_exec $0 run_rbf unb1 unb1_minimal_qsys
# apertif_unb1_bn_filterbank
hdl_exec $0 run_sopc unb1 apertif_unb1_bn_filterbank
hdl_exec $0 run_qcomp unb1 apertif_unb1_bn_filterbank
hdl_exec $0 run_rbf unb1 apertif_unb1_bn_filterbank
# Put all of the above commands in a logfile
} 2>&1 | tee ${LOGFILE}
# At this point, errors may or may not have occured. Perform checks here.
# Check if all RBF files have been generated
NOF_RBF_REQ=1
FOUND_RBF=$(find ${RADIOHDL_BUILD_DIR} -name *.rbf | grep "\-r")
NOF_RBF=$(echo ${FOUND_RBF} | grep -c "rbf")
RESULT=FAILED
if (( NOF_RBF == NOF_RBF_REQ )); then
RESULT=PASSED
fi
# Send an email with the result
RECIPIENTS=schuur@astron.nl,schuur@astron.nl
MESSAGE="\
${NOF_RBF_REQ} RBF files required\n\
${NOF_RBF} RBF files generated:\n\
${FOUND_RBF}\n"
# Cat the logfile and use Sed to get rid of color coding characters
LOG=$(cat ${LOGFILE} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")
SUBJECT="[REGTEST] Synthesis Result: ${RESULT}"
printf "${MESSAGE} \n ${LOG}" | mail -s "${SUBJECT}" ${RECIPIENTS}