Skip to content
Snippets Groups Projects

Resolve L2SDP-794

Merged Reinier van der Walle requested to merge L2SDP-794 into master
5 files
+ 349
10
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 39
10
@@ -37,16 +37,38 @@ exit_with_error() {
@@ -37,16 +37,38 @@ exit_with_error() {
cat <<@EndOfHelp@
cat <<@EndOfHelp@
Usage: $(basename $0) file
Usage: $(basename $0) file
Arguments: file Name of the file containing buildset, the project and revison names to build.
Arguments: file Name of the file containing buildset, the project and revison names to build.
 
Options: --out=* Path of directory to place bitstream files (default is in build directory).
The file should contain the buildset, project name followed by the revision name on each line.
The file should contain the buildset, project name followed by the revision name on each line.
Ex.
Ex.
unb2b lofar2_unb2b_sdp_station lofar2_unb2b_sdp_station_full_wg
unb2b lofar2_unb2b_sdp_station lofar2_unb2b_sdp_station_full_wg
unb2c lofar2_unb2c_sdp_station lofar2_unb2c_sdp_station_full
unb2c lofar2_unb2c_sdp_station lofar2_unb2c_sdp_station_full
@EndOfHelp@
@EndOfHelp@
exit 1
exit 1
}
}
 
# parse cmdline
 
POSITIONAL=()
 
out=
 
while [[ $# -gt 0 ]]
 
do
 
case $1 in
 
--out=*)
 
out=${1#*=}
 
;;
 
-*|--*)
 
exit_with_error "Unknown option: "$1
 
;;
 
*) POSITIONAL+=("$1")
 
;;
 
esac
 
shift
 
done
 
 
if [ ${#POSITIONAL[@]} -gt 0 ]; then
 
set -- "${POSITIONAL[@]}"
 
fi
 
# check the positional parameters
# check the positional parameters
if [ $# -lt 1 ]; then
if [ $# -lt 1 ]; then
exit_with_error "Wrong number of arguments specified."
exit_with_error "Wrong number of arguments specified."
@@ -57,13 +79,20 @@ readarray lines < <(sed -r '/^\s*$/d' $1)
@@ -57,13 +79,20 @@ readarray lines < <(sed -r '/^\s*$/d' $1)
# Build image for each line
# Build image for each line
for line in "${lines[@]}"
for line in "${lines[@]}"
do
do
BUILDSET=$(echo $line | cut -d " " -f1)
BUILDSET=$(echo $line | cut -d " " -f1)
PROJECT=$(echo $line | cut -d " " -f2)
PROJECT=$(echo $line | cut -d " " -f2)
REVISION=$(echo $line | cut -d " " -f3)
REVISION=$(echo $line | cut -d " " -f3)
if [ -z ${REVISION} ]; then
if [ -z ${REVISION} ]; then
build_image ${BUILDSET} ${PROJECT}
build_image ${BUILDSET} ${PROJECT}
else
else
build_image ${BUILDSET} ${PROJECT} --rev=${REVISION}
build_image ${BUILDSET} ${PROJECT} --rev=${REVISION}
 
fi
 
# Copy resulting bitstream to $out directory
 
if [ ! -z "${out}" ]; then
 
if [ ! -d "${out}" ]; then
 
mkdir "${out}"
fi
fi
done
cp "${RADIOHDL_BUILD_DIR}"/"${BUILDSET}"/quartus/"${REVISION}"/"${REVISION}"-* "${out}"
 
fi
 
done
Loading