testgen
1.17 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
#!/bin/csh
# set echo
echo Trying to Compile
# time rsp_random -norun
echo -n "Starting testgen at "
date
@ tmax = 10
if( $#argv > 1 ) then
@ tmax = $2
echo New tmax = $tmax
endif
@ tnum = 0
@ errnum = 0
while( $tnum < $tmax )
cd ..
@ len = 0
while( $len < 80 )
./gen_randcase test{$1}.desc
@ len = `tail -1 test.cnt`
echo Sim len = $len
end
head -$len trace.out | awk '{print $4}' | sort | uniq -c > inst.cnts
cat inst.cnts tot.insts.cnts | nawk '{cnt[$2] += $1}END{for(x in cnt) printf "%6d %s\n",cnt[x], x}' | sort +1 > tmp.inst.cnts
mv tmp.inst.cnts tot.insts.cnts
echo Running Simulation num $tnum for $len clocks
# echo Hit return to continue
# echo You hit $<
cd rsptst/rtests
make >& /dev/null
# make
cd ..
time rsp_random +ctrace -nocompile
grep FAIL random.log
if( $status == 0 ) then
echo Failure $errnum test $tnum
cp -r rtests err{$1}.$tnum
cp random.log random.stdout ../trace.out ../pcs ../init_vregs ../init_regs err{$1}.$tnum
@ errnum++
if( $errnum > 20 ) goto finish
endif
@ tnum++
end
finish:
echo Found $errnum errors in $tnum tests
echo -n "Finishing testgen at "
date