2023-07-06 14:28:03 +00:00
|
|
|
##############################################################################
|
|
|
|
## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved.
|
|
|
|
### SPDX short identifier: BSD-1-Clause
|
|
|
|
##############################################################################
|
|
|
|
|
2021-04-19 12:10:54 +00:00
|
|
|
export NAME=`basename $0`
|
|
|
|
|
|
|
|
# MODE not defined or defined to something else than 'batch'
|
|
|
|
if [[ -z ${MODE+x} ]] || [[ ! "$MODE" =~ "batch" ]]; then MODE="gui";fi
|
|
|
|
MODE="-"${MODE##*-} #remove any eventual extra dashes
|
2020-03-18 13:19:07 +00:00
|
|
|
|
|
|
|
case "$SIMULATOR" in
|
2021-04-19 12:10:54 +00:00
|
|
|
modelsim)
|
2020-03-18 13:19:07 +00:00
|
|
|
# ModelSim flow
|
|
|
|
vlib work
|
|
|
|
vlog ${SOURCE} || exit 1
|
2021-04-19 12:10:54 +00:00
|
|
|
vsim ${NAME} -do "add log /* -r; run -a" $MODE -logfile ${NAME}_modelsim.log || exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
xsim)
|
|
|
|
# XSim flow
|
2022-09-23 11:24:42 +00:00
|
|
|
xvlog -log ${NAME}_xvlog.log --sourcelibdir . ${SOURCE} || exit 1
|
|
|
|
xelab -log ${NAME}_xelab.log -debug all ${NAME} || exit 1
|
2021-04-19 12:10:54 +00:00
|
|
|
if [[ "$MODE" == "-gui" ]]; then
|
2022-08-02 10:01:40 +00:00
|
|
|
echo "log_wave -r *" > xsim_gui_cmd.tcl
|
|
|
|
echo "run all" >> xsim_gui_cmd.tcl
|
2021-04-19 12:10:54 +00:00
|
|
|
xsim work.${NAME} -gui -tclbatch xsim_gui_cmd.tcl -log ${NAME}_xsim.log
|
|
|
|
else
|
|
|
|
xsim work.${NAME} -R -log ${NAME}_xsim.log
|
|
|
|
fi
|
2020-03-18 13:19:07 +00:00
|
|
|
;;
|
2021-04-19 12:10:54 +00:00
|
|
|
|
|
|
|
xcelium)
|
|
|
|
# Xcelium flow
|
|
|
|
xmvlog -NOWARN NONPRT ${SOURCE} || exit 1
|
|
|
|
xmelab -access +rc ${NAME}
|
|
|
|
xmsim ${NAME} -gui || exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
#Icarus flow is the default
|
|
|
|
mkdir -p run
|
|
|
|
mkdir -p vcd
|
|
|
|
iverilog -o run/run_${NAME} -I.. ${SOURCE} $1 || exit 1
|
|
|
|
cd vcd
|
|
|
|
../run/run_${NAME}
|
2020-03-18 13:19:07 +00:00
|
|
|
;;
|
|
|
|
esac
|
2021-02-04 12:22:04 +00:00
|
|
|
|