You've already forked gitified_old_clb_svn
171 lines
5.0 KiB
Bash
Executable File
171 lines
5.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
DO_FPGA=1
|
|
DO_KM3NET=1
|
|
DO_WRPC=1
|
|
DO_REMOTE=1
|
|
DBG=""
|
|
|
|
while true
|
|
do
|
|
case "$1" in
|
|
--help ) echo "./build_all [--no-fpga] [--no-km3net] [--no-wrpc] [--no-remote]"; exit 0 ;;
|
|
--no-fpga ) DO_FPGA=0; shift ;;
|
|
--no-km3net ) DO_KM3NET=0; shift ;;
|
|
--no-wrpc ) DO_WRPC=0; shift ;;
|
|
--no-remote ) DO_REMOTE=0; shift ;;
|
|
--debug ) DBG="DEBUG=1"; shift ;;
|
|
"" ) break ;;
|
|
* ) echo "Unknown option '$1'"; exit 1 ;;
|
|
esac
|
|
done
|
|
|
|
TARGET=CLBV2_2_1
|
|
THREADS=$((`nproc`+1))
|
|
BASE_DIR=`pwd`
|
|
|
|
function check_artifact {
|
|
if [ ! -f "$1" ]; then
|
|
echo "Expected artifact $1"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
if [ $DO_FPGA -eq 1 ]; then
|
|
echo "========================================================"
|
|
echo "Generating FPGA image"
|
|
echo "========================================================"
|
|
|
|
# Best efford removal of binary products
|
|
cd $BASE_DIR/fw/CLBv2_Design/clb/syn/v2_2_1/bash
|
|
|
|
rm -f fpga.bit
|
|
rm -f fpga_bd.bmm
|
|
rm -f ../fpga.bit
|
|
rm -f ../fpga_bd.bmm
|
|
# redirect output log-file also to console (does not work for docker)
|
|
# tail -n0 --pid=$$ -F fpga-xilinx.log 2>&1 &
|
|
# build
|
|
./do_xilinx.sh $BASE_DIR v2_2_1
|
|
|
|
check_artifact ../fpga.bit
|
|
check_artifact ../fpga_bd.bmm
|
|
|
|
if ! grep -q "All constraints were met." "fpga-xilinx.log"; then
|
|
echo "Contraint failure, FPGA logging:"
|
|
cat fpga-xilinx.log
|
|
exit 1
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ $DO_WRPC -eq 1 ]; then
|
|
echo "========================================================"
|
|
echo "Building WR PTP core"
|
|
echo "========================================================"
|
|
cd $BASE_DIR/sw/embedded/WRPC
|
|
# Remove binary products
|
|
rm -f wrc_mac.elf
|
|
rm -f wrc_broadcast.elf
|
|
# Build
|
|
make km3net_defconfig
|
|
make clean
|
|
make
|
|
mv wrc_mac.elf wrc_mac.elf.bak
|
|
make broadcast clean
|
|
make broadcast
|
|
mv wrc_mac.elf.bak wrc_mac.elf
|
|
|
|
check_artifact wrc_mac.elf
|
|
check_artifact wrc_broadcast.elf
|
|
fi
|
|
|
|
if [ $DO_KM3NET -eq 1 ]; then
|
|
echo "========================================================"
|
|
echo "2nd LM32 code + final images"
|
|
echo "========================================================"
|
|
cd $BASE_DIR/sw/embedded/CLBv2_App/build
|
|
rm -rf artifacts
|
|
# Make release dir
|
|
mkdir -p artifacts/debug
|
|
|
|
|
|
function build {
|
|
echo "-----------------------------------------------------------------------------"
|
|
echo "Building $2 ($TARGET) with $THREADS thread(s) (args=$3 $4 $5)"
|
|
echo "-----------------------------------------------------------------------------"
|
|
echo "$1" >> artifacts/imageinfo.txt
|
|
cd $2
|
|
# Remove artifacts
|
|
rm -rf exe lst obj
|
|
# Remove anything left... if at all
|
|
make TARGET=$TARGET clean
|
|
# Build
|
|
make -j$THREADS TARGET=$TARGET $3 $4 $5
|
|
make TARGET=$TARGET update $3 $4 $5
|
|
|
|
# Clean temporary stuff
|
|
rm exe/tmp*
|
|
mv exe/*.elf.bin ../artifacts/debug/.
|
|
mv exe/*.bin exe/*.mcs exe/*.bit ../artifacts/.
|
|
mv lst/* ../artifacts/debug/.
|
|
cd ..
|
|
}
|
|
|
|
echo "The following images are included:" > artifacts/imageinfo.txt
|
|
echo "" >> artifacts/imageinfo.txt
|
|
build " * clbv2base - Base version 1" base $DBG
|
|
build " * clbv2base3 - Base version 3" base BPS_V3=1 $DBG
|
|
build " * clbv2dom - DOM image (*no* WR broadcast!)" runtime $DBG
|
|
build " * clbv2dom_bc - DOM image (with WR broadcast!)" runtime MAC_BROADCAST=1 $DBG
|
|
build " * clbv2gold - Golden image (*no* WR broadcast!)" golden $DBG
|
|
build " * clbv2gold_bc - Golden image (with WR broadcast!)" golden MAC_BROADCAST=1 $DBG
|
|
echo "" >> artifacts/imageinfo.txt
|
|
echo ".bit = direct programming on FPGA" >> artifacts/imageinfo.txt
|
|
echo ".bin = programming with flasher tool" >> artifacts/imageinfo.txt
|
|
echo ".mcs = programming SPI with Xilinx tool (Impact)" >> artifacts/imageinfo.txt
|
|
|
|
cd $BASE_DIR/sw/embedded/CLBv2_App/build/artifacts
|
|
check_artifact clbv2base_v221.bit
|
|
check_artifact clbv2base3_v221.bit
|
|
check_artifact clbv2dom_v221.bit
|
|
check_artifact clbv2dom_v221_bc.bit
|
|
check_artifact clbv2gold_v221.bit
|
|
check_artifact clbv2gold_v221_bc.bit
|
|
|
|
check_artifact clbv2base_v221.bin
|
|
check_artifact clbv2base3_v221.bin
|
|
check_artifact clbv2dom_v221.bin
|
|
check_artifact clbv2dom_v221_bc.bin
|
|
check_artifact clbv2gold_v221.bin
|
|
check_artifact clbv2gold_v221_bc.bin
|
|
|
|
check_artifact clbv2base_v221.mcs
|
|
check_artifact clbv2base3_v221.mcs
|
|
check_artifact clbv2dom_v221.mcs
|
|
check_artifact clbv2dom_v221_bc.mcs
|
|
check_artifact clbv2gold_v221.mcs
|
|
check_artifact clbv2gold_v221_bc.mcs
|
|
|
|
|
|
echo "========================================================"
|
|
echo "Building documentation"
|
|
echo "========================================================"
|
|
cd $BASE_DIR/sw/embedded/CLBv2_App
|
|
rm -rf doc/generated
|
|
doxygen
|
|
fi
|
|
|
|
if [ $DO_REMOTE -eq 1 ]; then
|
|
|
|
echo "========================================================"
|
|
echo "Building ClbRemote"
|
|
echo "========================================================"
|
|
cd $BASE_DIR/sw/standard/CLBv2_Remote
|
|
rm -rf bin
|
|
rm -f clbv2remote.jar
|
|
ant
|
|
check_artifact clbv2remote.jar
|
|
ant javadoc
|
|
fi
|