#!/bin/sh
#
# Script to build firmware for FMC-based AIDA mini-TLU
#
# This script builds the bitstream using ISE and the ISE project generated
# by setup_workspace.sh
#
# cd to the working directory and execute this script....
#
# David Cussans, December 2013
#

export BOARD_TYPE=sp605
export ISE_VER=ise14

export FW_WORKSPACE=`pwd`
echo "Workspace directory = " ${FW_WORKSPACE}/workspace
TLUDir=`pwd`/fmc-mtlu
echo "Directory with TLU source files = ${TLUDir}"

pushd $FW_WORKSPACE/workspace

xtclsh $TLUDir/firmware/config/$ISE_VER/$BOARD_TYPE/build_bitstream.tcl

echo "Bitstream built in ${FW_WORKSPACE}/workspace"

popd
