testit
1.33 KB
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
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh -f
#################################################################
#
# Script to make tabular files. Make up for lack of prefix
# rules in smake.
#
#################################################################
RDP_OPTS=""
BASE_NAME=""
TEST_NUM=""
INDATA="InData"
OUTDATA="OutData/ew_all"
LD_LIBRARY_PATH="/ecad/vcs/vcs_2.2/sgi/lib:../../../lib/libimage"
RDP_CV=" rdp_cv $RDP_OPTS"
#
# Usage message
#
usage()
{
echo "Usage: testit <-b> basename <-t> test_number"
exit 2
}
#
# Run the verilog simulation (rdp_cv)
#
vsim()
{
set -x
OUTNAME=${OUTDATA}/test${TEST_NUM}.tab
MEMNAME=${INDATA}/${BASE_NAME}.mem
export LD_LIBRARY_PATH
echo CV sim test ${TEST_NUM} start `date`
zcat ${MEMNAME}.Z > ${MEMNAME}
zcat ${OUTNAME}.base.Z > ${OUTNAME}.base
$RDP_CV -e -i ${BASE_NAME} -m ${BASE_NAME} \
-M 500 -Q ${TEST_NUM} +ew_qsim_dump=${OUTNAME} \
-f test${TEST_NUM}_tab | tee test${TEST_NUM}_tab.out
cmp -s ${OUTNAME} ${OUTNAME}.base
if test $? -ne 0 ; then
echo "TEST $TEST_NUM FAILED, tab files didn't compare"
fi
compress -f ${OUTNAME}
rm -f ${OUTNAME}.base
rm -f ${MEMNAME}
echo CV sim test ${TEST_NUM} finish `date`
}
#
# Main
#
while getopts "b:t:" a
do
case $a in
b) BASE_NAME=$OPTARG;;
t) TEST_NUM=$OPTARG;;
\?) usage ;;
esac
done
shift `expr $OPTIND - 1`
vsim