bcp_test
5.12 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/sh
if [ "$ROOT" = "" ]; then
echo "########################################"
echo " Please specify ROOT please "
echo "########################################"
exit 1
fi
sim=${ROOT}/PR/hw2/chip/vsim/sim.ipc
iosim=${ROOT}/PR/iosim/src/iosim
REGR_DIR=${ROOT}/PR/rspsim/vuregre/regression2
PRROOT=${ROOT}/PR
cvtdmem=${ROOT}/PR/rspsim/vuregre/bin/cvtdmem
dat2rdram=${ROOT}/PR/rspsim/vuregre/bin/dat2rdram
d2asm=${ROOT}/PR/rspsim/vuregre/bin/d2asm
mkdir ctrace
echo $1
if [ "$1" = "dma" ]; then
cp ${ROOT}/PR/rspsim/dmaregre/ready/rdram_*.dat .
cp ${ROOT}/PR/rspsim/dmaregre/ready/rdram_*.bin .
cp ${ROOT}/PR/rspsim/dmaregre/ready/rdram_reordered_0.data .
cp -f ${REGR_DIR}/testsuite .
grep "^DMA" testsuite | sed -e s/"DMA.*rsp"/DMA.rsp/ > run_test
else
cp -f ${REGR_DIR}/small_testsuite testsuite
grep "^SU" testsuite | sed -e s/"SU.*rsp"/SU.rsp/ > run_test
grep "^VU" testsuite | sed -e s/"VU.*rsp"/VU.rsp/ >> run_test
grep "^DMA" testsuite | sed -e s/"DMA.*rsp"/DMA.rsp/ >> run_test
fi
if [ "$IOSIM_PORT" = "" ]; then
export IOSIM_SERVER=127.0.0.1
export IOSIM_PORT=8888
fi
rm -rf test.result
OIFS=$IFS; IFS=.
while read test_type path ext
do
IFS=$OIFS
file=`basename $path`
#### Create Make file #####
echo "TARGET1 = ${file}.${ext}" > Makefile
echo "TARGET2 = ${file}.rdram_IMEM" >> Makefile
echo >> Makefile
echo "\$(TARGET2): ${file}.${ext}" >> Makefile
echo " rm -f a.out*" >> Makefile
echo "$ext" | grep "in" && {
echo " $d2asm ${file}.in ${file}.s ${file}.inlst" >> Makefile
}
echo " ${PRROOT}/rspasm1201/rspasm -b 0 ${file}.s" >> Makefile
echo " mv a.out ${file}.out" >> Makefile
echo " mv a.out.lst ${file}.lst" >> Makefile
echo " mv a.out.dat ${file}.dat" >> Makefile
if [ "$test_type" = "VU" ]; then
echo " ${PRROOT}/rspsim/vuregre/bin/make_rtsk ${file} 31 1" >> Makefile
else
if [ "$test_type" = "SU" ]; then
echo " ${PRROOT}/rspsim/vuregre/bin/make_rtsk ${file} 1 1" >> Makefile
else
echo " ${PRROOT}/rspsim/vuregre/bin/make_dma_rtsk ${file} 1 1" >> Makefile
fi
fi
echo " ${PRROOT}/rspsim/rsp -ntz ${file}.rtsk</dev/null> ${file}.simlog" >> Makefile
echo " ${cvtdmem} ${file}.eoe_dmem | $dat2rdram 1 > ${file}.eoe_DMEM" >> Makefile
echo " mv trace_out ctrace/${file}.ctrace" >> Makefile
echo " ${cvtdmem} ${file}.dat | $dat2rdram > rdram.DMEM" >> Makefile
echo " (cd ctrace; ${PRROOT}/rspsim/vuregre/bin/trace2ver $file)" >> Makefile
echo " ${PRROOT}/rspsim/vuregre/bin/lst2IMEM ${file}.lst > rdram.IMEM" >> Makefile
echo " ${PRROOT}/rspsim/vuregre/bin/reorder" >> Makefile
echo " mv dmem_reordered.data ${file}.rdram_DMEM" >> Makefile
echo " mv imem_reordered.data ${file}.rdram_IMEM" >> Makefile
echo >> Makefile
echo "\$(TARGET1): ${PRROOT}/${path}.${ext} " >> Makefile
echo " cp ${PRROOT}/${path}.${ext} ${file}.${ext}" >> Makefile
echo " chmod +w ${file}.${ext}" >> Makefile
echo " cp ${PRROOT}/rspsim/suregre/csrc/suregre.h suregre.h" >> Makefile
echo " cp ${PRROOT}/rspsim/vuregre/src/include/VU_AVP.h VU_AVP.h" >> Makefile
echo " chmod +w suregre.h" >> Makefile
echo " chmod +w VU_AVP.h" >> Makefile
make
#create the test script
echo "k 1" > test.tst
echo >> test.tst
echo "//t 200 00000000 00000000 00000000 00000000" >> test.tst
if [ "$1" = "dma" ]; then
echo "sp_load rdram_reordered_0.data" >> test.tst
fi
echo "sp_load ${file}.rdram_IMEM" >> test.tst
echo "sp_load ${file}.rdram_DMEM" >> test.tst
echo >> test.tst
echo "t 0063 00000001 04000000 00000000 00001000" >> test.tst
echo "t 0063 00000001 04001000 00001000 00001000" >> test.tst
echo "t 0104 04040010 0000000c 00000001 00000000" >> test.tst
echo "t 0102 04040010 00000020 00000001 00000000" >> test.tst
echo >> test.tst
case $test_type in
SU) this_type=0;;
VU) this_type=1;;
DMA) this_type=3;;
esac
echo "Running test RSP $1 : ${file}" >> /tmp/bb_perf
if [ "$1" = "pin_single" ]; then
echo "sp_start 1 1 $this_type" >> test.tst
echo "t 0401 00000002 00020002 00000002 00020002" >> test.tst
else
echo "sp_start 1 0 $this_type" >> test.tst
echo "t 0400 0000002 00000002 00000000 00000000" >> test.tst
fi
echo "sp_start 0 0" >> test.tst
echo >> test.tst
echo "t 0063 00000002 04000000 00003000 00001000" >> test.tst
echo "t 0104 04040010 0000000c 00000001 00000000" >> test.tst
if [ "$file" != "dma60" ]; then
echo "t 0100 00003000 00000000 00000000 00000000" >> test.tst
echo "sp_compare ${file}.eoe_DMEM" >> test.tst
fi
if [ "$1" != "dma" ]; then
echo "sp_trace 0 ctrace/${file}.trSU" >> test.tst
echo "sp_trace 1 ctrace/${file}.trVU" >> test.tst
echo "sp_trace 2 ctrace/${file}.trDM" >> test.tst
fi
echo >> test.tst
echo "k 0" >> test.tst
echo "//q" >> test.tst
echo >> test.result
echo "Test ${file} @ `date`" >> test.result
if [ "$2" = "" ]; then
${iosim} -f test.tst -d 0241 >> test.result 2>&1
else
echo "k 1" > rand.tst
if [ "$1" = "dma" ]; then
echo "sp_rand 1 $file" >> rand.tst
else
echo "sp_rand 0 $file" >> rand.tst
fi
echo "k 0" >> rand.tst
${iosim} -f rand.tst -d 0241 2>&1 >> rand.result
fi
#rm test.tst
OIFS=$IFS; IFS=.
done < run_test
IFS=$OIFS