-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsimulate.sh
61 lines (47 loc) · 1.32 KB
/
simulate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Compile all needed libraries.
# Runs msim with all available tb*.settings files.
# The script provides it's runtime after completion.
DIR_TOOLS=tools
#Get start time.
TIME_START=$(date +"%s")
#store current path
export ORIGIN_DIR=.
chmod +x ./load-all-libs.sh
./load-all-libs.sh
echo
echo "Starting simulation of all available shell-scripts..."
echo
#find all *.settings
TBSET_LIST=`find $ORIGIN_DIR -name "tb*.settings"`
#loop through tb*.setting list
RET=1
for TBSET in $TBSET_LIST
do
echo "###############################################################################"
echo "# Run testbench of path ${TBSET}"
chmod +x ./${DIR_TOOLS}/msim-sim.sh
./${DIR_TOOLS}/msim-sim.sh ${TBSET}
RET=$?
#check return
if [ $RET -ne 0 ]; then
echo "-> ERROR!"
break
else
echo "-> SUCCESSFUL!"
fi
echo "###############################################################################"
echo
done
#Get completion time, calculate duration time and give seconds in time format.
TIME_COMPLETE=$(date +"%s")
SEC_DUR=$(( $TIME_COMPLETE - $TIME_START ))
TIME_DUR=$(date -u -d @${SEC_DUR} +"%T")
echo
if [ $RET -ne 0 ]; then
printf "Simulation completed with errors! (RET=${RET} "
else
printf "Simulation completed successful! ("
fi
echo "Runtime=${TIME_DUR})"
exit $RET