aboutsummaryrefslogtreecommitdiffstats
path: root/fpga
diff options
context:
space:
mode:
authorWade Fife <wade.fife@ettus.com>2021-06-09 13:29:10 -0500
committerWade Fife <wade.fife@ettus.com>2021-06-17 08:16:59 -0500
commit08473776b28a949027ec8cf2596d8d1b438b979b (patch)
tree7ee23b58eefcabf20ee88d49318f4cf61d03de4b /fpga
parent5a4f0470919440819ab71f44fbc6f5f89a671e41 (diff)
downloaduhd-08473776b28a949027ec8cf2596d8d1b438b979b.tar.gz
uhd-08473776b28a949027ec8cf2596d8d1b438b979b.tar.bz2
uhd-08473776b28a949027ec8cf2596d8d1b438b979b.zip
fpga: tools: Add modelsim.ini to ModelSim calls
This adds the MSIM_VIV_COMPLIBDIR environment variable to specify a non-default location for the compilation libraries. This also allows a modelsim.ini other than the one in the ModelSim installation folder to be used. By default, the one in the simulation libraries compilation directory will be used. This can be changed by setting MSIM_MODELSIM_INI to the one you want to use, or set it to an empty string to use the one in the ModelSim installation folder.
Diffstat (limited to 'fpga')
-rw-r--r--fpga/usrp3/tools/make/viv_simulator.mak2
-rwxr-xr-xfpga/usrp3/tools/scripts/launch_modelsim.sh11
-rwxr-xr-xfpga/usrp3/tools/scripts/launch_vlint.sh13
-rw-r--r--fpga/usrp3/tools/scripts/setupenv_base.sh19
4 files changed, 38 insertions, 7 deletions
diff --git a/fpga/usrp3/tools/make/viv_simulator.mak b/fpga/usrp3/tools/make/viv_simulator.mak
index eaa23adcc..f37cc9626 100644
--- a/fpga/usrp3/tools/make/viv_simulator.mak
+++ b/fpga/usrp3/tools/make/viv_simulator.mak
@@ -68,6 +68,7 @@ SETUP_AND_LAUNCH_VLINT = \
export VLINT_SVLOG_ARGS="$(SVLOG_ARGS)"; \
export VLINT_VLOG_ARGS="$(VLOG_ARGS)"; \
export VLINT_VHDL_ARGS="$(VHDL_ARGS)"; \
+ export VLINT_MODELSIM_INI="$(MODELSIM_INI)"; \
$(TOOLS_DIR)/scripts/launch_vlint.sh
# -------------------------------------------------------------------
@@ -82,6 +83,7 @@ SETUP_AND_LAUNCH_MODELSIM = \
export MSIM_ARGS="$(MODELSIM_ARGS)"; \
export MSIM_LIBS="$(MODELSIM_LIBS)"; \
export MSIM_MODE=$(VIVADO_MODE); \
+ export MSIM_MODELSIM_INI="$(MODELSIM_INI)"; \
$(TOOLS_DIR)/scripts/launch_modelsim.sh
.SECONDEXPANSION:
diff --git a/fpga/usrp3/tools/scripts/launch_modelsim.sh b/fpga/usrp3/tools/scripts/launch_modelsim.sh
index 8fc7309a0..ad71c473c 100755
--- a/fpga/usrp3/tools/scripts/launch_modelsim.sh
+++ b/fpga/usrp3/tools/scripts/launch_modelsim.sh
@@ -47,6 +47,13 @@ function print_color {
# and avoids some cases where simulation mismatch could otherwise occur.
MSIM_DEFAULT="-voptargs=+acc -quiet -L unisims_ver"
+# Use specified modelsim.ini, if set
+if [[ -z $MSIM_MODELSIM_INI ]]; then
+ MODELSIMINI_ARG=""
+else
+ MODELSIMINI_ARG="-modelsimini $MSIM_MODELSIM_INI"
+fi
+
cd $MSIM_PROJ_DIR
# Generate the library options string
@@ -58,14 +65,14 @@ done
if [ $MSIM_MODE == "gui" ]; then
echo "* Launching ModelSim"
- vsim $MSIM_DEFAULT $MSIM_ARGS $MSIM_LIB_ARGS $MSIM_SIM_TOP 2>&1 | while IFS= read -r line; do
+ vsim $MSIM_DEFAULT $MODELSIMINI_ARG $MSIM_ARGS $MSIM_LIB_ARGS $MSIM_SIM_TOP 2>&1 | while IFS= read -r line; do
print_color $line
done
exit_status=${PIPESTATUS[0]}
if [ ${exit_status} -ne 0 ]; then exit ${exit_status}; fi
elif [ $MSIM_MODE == "batch" ]; then
echo "* Launching ModelSim"
- vsim -batch -do "run -all; quit -f" $MSIM_DEFAULT $MSIM_ARGS $MSIM_LIB_ARGS $MSIM_SIM_TOP 2>&1 | while IFS= read -r line; do
+ vsim -batch -do "run -all; quit -f" $MODELSIMINI_ARG $MSIM_DEFAULT $MSIM_ARGS $MSIM_LIB_ARGS $MSIM_SIM_TOP 2>&1 | while IFS= read -r line; do
print_color $line
done
exit_status=${PIPESTATUS[0]}
diff --git a/fpga/usrp3/tools/scripts/launch_vlint.sh b/fpga/usrp3/tools/scripts/launch_vlint.sh
index 0f6ccc895..43d64c786 100755
--- a/fpga/usrp3/tools/scripts/launch_vlint.sh
+++ b/fpga/usrp3/tools/scripts/launch_vlint.sh
@@ -58,10 +58,17 @@ function replace_dirs_with_source {
WORKING_DIR=$(pwd)
+# Use specified modelsim.ini, if set
+if [[ -z $VLINT_MODELSIM_INI ]]; then
+ MODELSIMINI_ARG=""
+else
+ MODELSIMINI_ARG="-modelsimini $VLINT_MODELSIM_INI"
+fi
+
# Define arguments to pass to the compile
-SVLOG_ARGS="$VLINT_SVLOG_ARGS -quiet +define+WORKING_DIR=$WORKING_DIR"
-VLOG_ARGS="$VLINT_VLOG_ARGS -quiet +define+WORKING_DIR=$WORKING_DIR"
-VHDL_ARGS="$VLINT_VHDL_ARGS -quiet"
+SVLOG_ARGS="$VLINT_SVLOG_ARGS $MODELSIMINI_ARG -quiet +define+WORKING_DIR=$WORKING_DIR"
+VLOG_ARGS="$VLINT_VLOG_ARGS $MODELSIMINI_ARG -quiet +define+WORKING_DIR=$WORKING_DIR"
+VHDL_ARGS="$VLINT_VHDL_ARGS $MODELSIMINI_ARG -quiet"
# Define files in which to store all the compiler arguments
SV_ARGS_FILE=svlogarglist.txt
diff --git a/fpga/usrp3/tools/scripts/setupenv_base.sh b/fpga/usrp3/tools/scripts/setupenv_base.sh
index cb0c546e5..95a05d6f6 100644
--- a/fpga/usrp3/tools/scripts/setupenv_base.sh
+++ b/fpga/usrp3/tools/scripts/setupenv_base.sh
@@ -243,15 +243,30 @@ if [[ $VSIM_PATH ]]; then
case $MODELSIM_VER in
DE-64|SE-64)
export MODELSIM_64BIT=1
- export SIM_COMPLIBDIR=$VIVADO_PATH/modelsim64
+ if [[ -z $MSIM_VIV_COMPLIBDIR ]]; then
+ export SIM_COMPLIBDIR=$VIVADO_PATH/modelsim64
+ else
+ export SIM_COMPLIBDIR=$MSIM_VIV_COMPLIBDIR
+ fi
;;
DE|SE|PE)
export MODELSIM_64BIT=0
- export SIM_COMPLIBDIR=$VIVADO_PATH/modelsim32
+ if [[ -z $MSIM_VIV_COMPLIBDIR ]]; then
+ export SIM_COMPLIBDIR=$VIVADO_PATH/modelsim32
+ else
+ export SIM_COMPLIBDIR=$MSIM_VIV_COMPLIBDIR
+ fi
;;
*)
;;
esac
+ # If MSIM_MODELSIM_INI is not defined, use the modelsim.ini in the compiled
+ # libraries directory. Otherwise use the one defined by MSIM_MODELSIM_INI.
+ # Set MSIM_MODELSIM_INI to an empty string to use the modelsim.ini in the
+ # ModelSim installation folder.
+ if [[ ! -v MSIM_MODELSIM_INI ]]; then
+ export MODELSIM_INI=$SIM_COMPLIBDIR/modelsim.ini
+ fi
fi
function build_simlibs {