diff --git a/tools/modelsim/run_modelsim b/tools/modelsim/run_modelsim index 1599712b9cf078468caf096d6fc5aca1dd0716bc..79966e7889d674f13d30509b9e355bb871ebfec7 100755 --- a/tools/modelsim/run_modelsim +++ b/tools/modelsim/run_modelsim @@ -23,37 +23,8 @@ # General tool and project settings # - use '. <script>.sh' to have the settings apply in this shell, otherwise they get lost when <script>.sh returns -# Select target -TARGET=${1:-} -if [ "${TARGET}" = "" ]; then - TARGET="default" -fi -echo "Start Modelsim GUI for RadioHDL with target: ${TARGET}" - -# Select tool version -if [ "${TARGET}" = "default" ]; then - . ${RADIOHDL}/tools/quartus/quartus_version.sh 11.1 - . ${RADIOHDL}/tools/modelsim/modelsim_version.sh 6.6c -elif [ "${TARGET}" = "unb1" ]; then - . ${RADIOHDL}/tools/quartus/quartus_version.sh 11.1 - . ${RADIOHDL}/tools/modelsim/modelsim_version.sh 10.2c -elif [ "${TARGET}" = "unb2" ]; then - #. ${RADIOHDL}/tools/quartus/quartus_version.sh 13.1 - . ${RADIOHDL}/tools/quartus/quartus_version.sh 14.0a10 - . ${RADIOHDL}/tools/modelsim/modelsim_version.sh 10.2c -else - echo "error: unknown target" - exit 1 -fi - -# Remarks: -# - No need for MODELSIM_TCL environment variable and modelsim.tcl, because these are not preferred and instead call commands.do via -do argument. -# - No need for MODELSIM environment variable to point to a specific modelsim.ini file, because RADIOHDL can use the default modelsim.ini -# - For RADIOHDL the modelsim project files are created by a Python script. -# - The paths to the IEEE libraries are defined by the MODELTECH environment variable that gets defined by Modelsim itself when it starts -# - The paths to the FPGA technology libraries are defined in the [library] section in the modelsim project files using MODEL_TECH_ALTERA_LIB -# environment variable that gets defined in quartus_version.sh. Similar paths to generic libraries are defined using their absolute path. -# - Default modelsim.ini settings can be overruled by project specific settings in the [vsim] section in the modelsim project files. +# Tool settings for selected target "", "unb1", or "unb2" (where "" defaults to target "unb1") +. ${RADIOHDL}/tools/modelsim/set_modelsim ${1:-} # Start the Modelsim GUI $VSIM_DIR/vsim -do ${RADIOHDL}/tools/modelsim/commands.do diff --git a/tools/modelsim/set_modelsim b/tools/modelsim/set_modelsim new file mode 100755 index 0000000000000000000000000000000000000000..43bca77759a7b1c7052a906e3fa4e25cf9028674 --- /dev/null +++ b/tools/modelsim/set_modelsim @@ -0,0 +1,61 @@ +#!/bin/bash +############################################################################### +# +# Copyright (C) 2014 +# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.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: Map command line argument to a tool version +# Description: +# By using command line arguments like "", "unb1", "unb2" to select the tool +# version it is easier to manage combinations of tool versions. + +# General tool and project settings +# - use '. <script>.sh' to have the settings apply in this shell, otherwise they get lost when <script>.sh returns + +# Select target +TARGET=${1:-} +if [ "${TARGET}" = "" ]; then + TARGET="default" +fi +echo "Start Modelsim GUI for RadioHDL with target: ${TARGET}" + +# Select tool version +if [ "${TARGET}" = "default" ]; then + . ${RADIOHDL}/tools/quartus/quartus_version.sh 11.1 + . ${RADIOHDL}/tools/modelsim/modelsim_version.sh 6.6c +elif [ "${TARGET}" = "unb1" ]; then + . ${RADIOHDL}/tools/quartus/quartus_version.sh 11.1 + . ${RADIOHDL}/tools/modelsim/modelsim_version.sh 10.2c +elif [ "${TARGET}" = "unb2" ]; then + #. ${RADIOHDL}/tools/quartus/quartus_version.sh 13.1 + . ${RADIOHDL}/tools/quartus/quartus_version.sh 14.0a10 + . ${RADIOHDL}/tools/modelsim/modelsim_version.sh 10.2c +else + echo "error: unknown target" + exit 1 +fi + +# Remarks: +# - No need for MODELSIM_TCL environment variable and modelsim.tcl, because these are not preferred and instead call commands.do via -do argument. +# - No need for MODELSIM environment variable to point to a specific modelsim.ini file, because RADIOHDL can use the default modelsim.ini +# - For RADIOHDL the modelsim project files are created by a Python script. +# - The paths to the IEEE libraries are defined by the MODELTECH environment variable that gets defined by Modelsim itself when it starts +# - The paths to the FPGA technology libraries are defined in the [library] section in the modelsim project files using MODEL_TECH_ALTERA_LIB +# environment variable that gets defined in quartus_version.sh. Similar paths to generic libraries are defined using their absolute path. +# - Default modelsim.ini settings can be overruled by project specific settings in the [vsim] section in the modelsim project files.