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

changes in init files

parent b8cb8ce9
No related branches found
No related tags found
No related merge requests found
...@@ -34,29 +34,42 @@ if [[ "$_" == "${0}" ]]; then ...@@ -34,29 +34,42 @@ if [[ "$_" == "${0}" ]]; then
exit exit
fi fi
#
if [ -z "${ALTERA_DIR}" ]; then
echo "== environ variable 'ALTERA_DIR' not set. =="
echo "should be in your .bashrc file."
echo "if it is your .bashrc file but not active run bash in your terminal"
exit
fi
# Figure out where this script is located and set environment variables accordingly # Figure out where this script is located and set environment variables accordingly
export RADIOHDL_WORK="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export RADIOHDL_WORK="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "HDL environment will be setup for" $RADIOHDL_WORK
# setup paths to build and config dir if not already defined by the user. # setup paths to build and config dir if not already defined by the user.
export ARGS_WORK=${ARGS_WORK:-${RADIOHDL_WORK}}
export HDL_BUILD_DIR=${HDL_BUILD_DIR:-${RADIOHDL_WORK}/build} export HDL_BUILD_DIR=${HDL_BUILD_DIR:-${RADIOHDL_WORK}/build}
echo "HDL environment will be setup for" $RADIOHDL_WORK
# modelsim uses this sim dir for testing # modelsim uses this sim dir for testing
export HDL_IOFILE_SIM_DIR=${HDL_IOFILE_SIM_DIR:-${HDL_BUILD_DIR}/sim} export HDL_IOFILE_SIM_DIR=${HDL_IOFILE_SIM_DIR:-${HDL_BUILD_DIR}/sim}
if ! [[ -e HDL_IOFILE_SIM_DIR ]]; then if [[ ! -d "${HDL_IOFILE_SIM_DIR}" ]]; then
echo "make sim dir" echo "make sim dir"
mkdir ${HDL_BUILD_DIR}/sim mkdir "${HDL_IOFILE_SIM_DIR}"
fi
# if sim dir not empty, remove all files and dirs
if [ ! -z "$(ls -A ${HDL_IOFILE_SIM_DIR})" ]; then
echo "clear sim dir"
rm -r ${HDL_IOFILE_SIM_DIR}/*
fi fi
rm -r ${HDL_BUILD_DIR}/sim/*
# copy git user_componets.ipx into Altera dir's # copy git user_componets.ipx into Altera dir's
for altera_dir in ${ALTERA_DIR}/*; do for altera_dir in ${ALTERA_DIR}/*; do
if [[ -d ${altera_dir} ]] && [[ ! -h ${altera_dir} ]]; then if [[ -d "${altera_dir}" ]] && [[ ! -h "${altera_dir}" ]]; then
echo "copy git hdl_user_components.ipx to ${altera_dir}/ip/altera/user_components.ipx" echo "copy git hdl_user_components.ipx to ${altera_dir}/ip/altera/user_components.ipx"
cp ${RADIOHDL_WORK}/hdl_user_components.ipx $altera_dir/ip/altera/user_components.ipx cp ${RADIOHDL_WORK}/hdl_user_components.ipx $altera_dir/ip/altera/user_components.ipx
fi fi
done done
if [ -z "${RADIOHDL_GEAR}" ]; then # source also radiohdl and args tools
. ../radiohdl/init_radiohdl.sh . ../radiohdl/init_radiohdl.sh
fi . ../args/init_args.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment