#! /bin/bash LIB=behavioural HEXPROG=software/code.hex VMEMPROG=software/code.vmem testbench=testbench/arm_soc_stim.sv SIM_OPT= graphics=true general_options="" testbench=testbench/arm_soc_stim.sv while case $1 in -*) true ;; *) false ;; esac do option="$1" shift if [ "${option}" = "-no_graphics" ] then graphics=false elif [ "${option}" = "-q" ] then SIM_OPT="$SIM_OPT -q" else echo "unknown option for simulate: ${option}" exit fi done if [ -d "$1" ] then LIB=$1 shift fi if [ -f "$1" ] && [[ "$1" == *.sv ]] then testbench=$1 shift fi tcl_file=${testbench%_stim.sv}.tcl if $graphics then simcommand="xmverilog -sv +gui +access+r" [ -f "$tcl_file" ] && simcommand="$simcommand +tcl+$tcl_file" else simcommand="xmverilog" fi simcommand="$simcommand -y $LIB +libext+.sv +define+prog_file=${HEXPROG} +define+prog_file_vmem=${VMEMPROG} $testbench" echo $simcommand $simcommand