|
45 | 45 | HOSTNAME=`hostname -s`; echo "hostname=$HOSTNAME arguments=$@"
|
46 | 46 | TS=`date +%Y%m%d_%H%M%S`; if [ "$TST_TITLE" != "" ];then TS="${TS}_${TST_TITLE}";fi
|
47 | 47 | export SNAP_ROOT=${PWD%/hardware/sim*};echo "SNAP_ROOT=$SNAP_ROOT" # default root, in case its not overwritten
|
48 |
| - [ -f "${SNAP_ROOT}/snap_env.sh" ] && . ${SNAP_ROOT}/snap_env.sh |
49 | 48 | [ -f "${SNAP_ROOT}/.snap_config.sh" ] && . ${SNAP_ROOT}/.snap_config.sh
|
| 49 | + [ -f "${SNAP_ROOT}/snap_env.sh" ] && . ${SNAP_ROOT}/snap_env.sh # snap_env at the end allows late overrides |
50 | 50 | export PATH=$PATH:$SNAP_ROOT/software/tools:$ACTION_ROOT/sw
|
51 |
| - |
52 | 51 | if [ -z $PSLSE_ROOT ];then echo "variable PSLSE_ROOT not found, leaving"; exit 11; fi
|
53 | 52 |
|
54 | 53 | # ARGUMENTS #############
|
55 | 54 | runsim_args=$@
|
56 | 55 | while [[ $# > 0 ]]; do # consume multiple args per loop with shift
|
57 | 56 | # echo "arg1=$1 arg2=$2"
|
58 | 57 | case $1 in
|
59 |
| - ncsim|xsim|irun) SIM_OVER="$1";; |
| 58 | + xsim|irun|questa|modelsim|xcelium) SIM_OVER="$1";; |
60 | 59 | -xsim) SIM_OVER="xsim";;
|
61 | 60 | -irun) SIM_OVER="irun";;
|
62 |
| - -ncsim) SIM_OVER="ncsim";; |
| 61 | + -questa) SIM_OVER="questa";; |
| 62 | + -xcelium) SIM_OVER="xcelium";; |
| 63 | + -modelsim) SIM_OVER="modelsim";; |
63 | 64 | -app) TST_NAME="$2";shift
|
64 | 65 | if [[ ! -f ${SNAP_ROOT}/software/${TST_NAME} ]];then echo "file ${SNAP_ROOT}/software/${TST_NAME} not found, leaving";exit 11;fi;;
|
65 | 66 | -list) TST_NAME='LIST';LISTNAME="$2";shift
|
|
117 | 118 | shift
|
118 | 119 | done
|
119 | 120 |
|
120 |
| - if [[ -z $SIMDIR && -z $SIMULATOR ]];then SIMULATOR="ncsim"; fi # simulator determined by environment variable |
| 121 | + if [[ -z $SIMDIR && -z $SIMULATOR ]];then SIMULATOR="irun"; fi # simulator determined by environment variable |
121 | 122 | if [[ -n $SIM_OVER ]];then echo "force simulator overwrite from $SIMULATOR to $SIM_OVER";SIMULATOR=$SIM_OVER;fi
|
122 |
| - if [[ "$SIMULATOR" == "ncsim" || "$SIMULATOR" == "irun" ]];then |
123 |
| - if [ -z $CDS_INST_DIR ];then echo "CDS_INST_DIR not defined for $SIMULATOR"; exit 1; fi |
124 |
| - SIMDIR="ies" # simulation directory generated by vivado |
125 |
| - if [ -z $SIMTOP ];then SIMTOP="work.top";fi # default top structure |
126 |
| - elif [ "$SIMULATOR" == "xsim" ];then |
127 |
| - SIMDIR=$SIMULATOR # simulation directory generated by vivado |
128 |
| - if [ -z $SIMTOP ];then SIMTOP="top";fi # default top structure |
129 |
| - elif [[ "$SIMULATOR" == "questa" || "$SIMDIR" == "questa" ]];then |
130 |
| - if [ -z $MODELSIM_DIR ];then echo "MODELSIM_DIR not defined for questa"; exit 1; fi |
131 |
| - SIMDIR="questa" # simulation directory generated by vivado |
132 |
| - SIMULATOR="vsim" |
133 |
| - if [ -z $SIMTOP ];then SIMTOP="top";fi # default top structure |
134 |
| - else echo "simulator=$SIMULATOR is not supported"; exit 1; fi |
| 123 | + case $SIMULATOR in |
| 124 | + irun) |
| 125 | + if [ -z $CDS_INST_DIR ];then echo "CDS_INST_DIR not defined for $SIMULATOR"; exit 1; fi |
| 126 | + SIMDIR="ies" # simulation directory generated by vivado |
| 127 | + if [ -z $SIMTOP ];then SIMTOP="work.top";fi # default top structure |
| 128 | + ;; |
| 129 | + xcelium) |
| 130 | + if [ -z $CDS_INST_DIR ];then echo "CDS_INST_DIR not defined for $SIMULATOR"; exit 1; fi |
| 131 | + SIMDIR="xcelium" # simulation directory generated by vivado |
| 132 | + SIMULATOR="xrun" |
| 133 | + if [ -z $SIMTOP ];then SIMTOP="work.top";fi # default top structure |
| 134 | + ;; |
| 135 | + xsim) |
| 136 | + SIMDIR=$SIMULATOR # simulation directory generated by vivado |
| 137 | + if [ -z $SIMTOP ];then SIMTOP="top";fi # default top structure |
| 138 | + ;; |
| 139 | + questa|modelsim) |
| 140 | + if [ -z $MODELSIM_DIR ];then echo "MODELSIM_DIR not defined for questa"; exit 1; fi |
| 141 | + SIMDIR="questa" # simulation directory generated by vivado |
| 142 | + SIMULATOR="vsim" |
| 143 | + if [ -z $SIMTOP ];then SIMTOP="top";fi # default top structure |
| 144 | + ;; |
| 145 | + *) echo "simulator=$SIMULATOR is not supported"; exit 1 |
| 146 | + ;; |
| 147 | + esac |
135 | 148 | echo "simulator=$SIMULATOR simdir=$SIMDIR simtop=$SIMTOP"
|
136 | 149 |
|
137 | 150 | P3=`basename $PWD`
|
|
144 | 157 | fi
|
145 | 158 |
|
146 | 159 | P3=`basename $PWD`
|
147 |
| - if [ "$P3" == "ies" ] || [ "$P3" == "xsim" ]|| [ "$P3" == "questa" ];then # contains files from Vivado and sim output, no GIT release |
| 160 | + if [ "$P3" == "ies" ]||[ "$P3" == "xsim" ]||[ "$P3" == "questa" ]||[ "$P3" == "modelsim" ]||[ "$P3" == "xcelium" ];then # contains files from Vivado and sim output, no GIT release |
148 | 161 | echo "prepare simout directory from pwd=$PWD p3=$P3"
|
149 | 162 | # P3=`basename $PWD`
|
150 | 163 | # P4=`dirname $PWD`
|
|
162 | 175 | else echo "cannot find list=${filename}.sh";exit 1
|
163 | 176 | fi
|
164 | 177 | fi
|
165 |
| - if [ "$SIMDIR" == "ies" ];then |
| 178 | + if [ "$SIMDIR" == "ies" ]||[ "$SIMDIR" == "xcelium" ];then |
166 | 179 | # cp run_* cds.lib hdl.var $SIMOUT
|
167 | 180 | cp ../nc*.tcl $SIMOUT
|
168 | 181 | # cp nc*.log $SIMOUT # compile output in case of debug questions
|
|
174 | 187 | cd $SIMOUT
|
175 | 188 | # ln -s $SNAP_ROOT/hardware/support support # to easier get to waveform signallists
|
176 | 189 | if [ "$SIMDIR" == "ies" ];then
|
177 |
| - ln -s $SNAP_ROOT/hardware/sim/ies/ies # point to compiled model |
178 |
| - ln -s $SNAP_ROOT/hardware/sim/ies/INCA_libs # point to compiled model |
| 190 | + ln -s $SNAP_ROOT/hardware/sim/ies/ies # ? |
| 191 | + ln -s $SNAP_ROOT/hardware/sim/ies/INCA_libs # point to compiled model |
| 192 | + ln -s $SNAP_ROOT/hardware/sim/ies/ies_libs # point to compiled library |
| 193 | + ln -s $SNAP_ROOT/hardware/sim/nvme denali # point to denali runtime files |
| 194 | + elif [ "$SIMDIR" == "xcelium" ];then |
| 195 | + ln -s $SNAP_ROOT/hardware/sim/xcelium/xcelium # ? |
| 196 | + ln -s $SNAP_ROOT/hardware/sim/xcelium/xcelium.d # point to compiled model |
| 197 | + ln -s $SNAP_ROOT/hardware/sim/xcelium/xcelium_lib # point to compiled library |
179 | 198 | ln -s $SNAP_ROOT/hardware/sim/nvme denali # point to denali runtime files
|
180 | 199 | elif [ "$SIMDIR" == "xsim" ];then
|
181 | 200 | ln -s $SNAP_ROOT/hardware/sim/xsim/xsim.dir
|
|
207 | 226 | if [[ "$NVME_USED" == "TRUE" && -n "$DENALI" ]]; then
|
208 | 227 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DENALI/verilog # to find libvpi.so and libdenpli.so
|
209 | 228 | fi
|
210 |
| - if [ "$SIMDIR" == "ies" ];then |
211 |
| -# if [ "$SIM_INIT" == "" ];then SIM_INIT='-ncinitialize x';fi # default init value for ncsim |
| 229 | + if [ "$SIMDIR" == "ies" ]||[ "$SIMDIR" == "xcelium" ];then |
| 230 | +# if [ "$SIM_INIT" == "" ];then SIM_INIT='-ncinitialize x';fi # default init value for irun |
212 | 231 | # SIM_ARG='-gui' # interactive, stop @cyc0
|
213 | 232 | # SIM_ARG='-gui -tcl' # interactive with simvision
|
214 | 233 | # SIM_ARG='-gui -run -tcl' # non_interactive, with simvision
|
|
283 | 302 | echo "run_sim sim_arg=${SIM_ARG}, tst_arg=${TST_ARG}, AET=$AET"|tee -a sim.log
|
284 | 303 |
|
285 | 304 | ##### call Simulator
|
286 |
| - echo "**** call simulator=$SIMULATOR in background, wait for socket in $SIMULATOR.log->shim_host.dat"|tee -a sim.log & |
287 |
| - if [ "$SIMULATOR" == "irun" ];then SIM_ARG+=" -r";fi |
| 305 | + if [ "$SIMULATOR" == "irun" ]||[ "$SIMULATOR" == "xrun" ];then SIM_ARG+=" -r";fi |
| 306 | + echo "**** call simulator=$SIMULATOR $SIM_ARG $SIMTOP in background, wait for socket in $SIMULATOR.log->shim_host.dat"|tee -a sim.log & |
288 | 307 | $SIMULATOR $SIM_ARG $SIMTOP |tee -a sim.log &
|
289 | 308 | SIMLOG_PID=$! # sim.log records 1st socket
|
290 | 309 | SIMLOG_PPID=`ps -ef|grep $SIMLOG_PID |grep tee |awk '{print $3}'`
|
|
0 commit comments