rsp_cregression
5.18 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/usr/sbin/perl
if ($ENV{"ROOT"}) {
$ROOT = $ENV{"ROOT"};
}
else {
die "ROOT env not set. Plaase set ROOT environment first \n";
}
$VUREGRES = $ROOT."/PR/rspsim/vuregre";
$SUREGRES = $ROOT."/PR/rspsim/suregre";
$VUSRC = $VUREGRES."/src";
$SUSRC = $SUREGRES."/ready";
$TOOL = $VUREGRES."/bin";
$RSPASM = $ROOT."/PR/rspasm1201";
$RSPSIM = $ROOT."/PR/rspsim";
$WORKDIR = `pwd`;
chop($WORKDIR);
$TESTDIR = $WORKDIR;
$TESTDIR_VU = $TESTDIR."/csim_vu";
$TESTDIR_SU = $WORKDIR."/csim_su";
$ALL_DIAGS = 1;
while ($#ARGV >= 0) {
if ($ARGV[0] =~ /^\+su=/) {
($TEMP,$DIAG) = split(/=/,shift(@ARGV));
$PlusArgs = push(@PlusArgs,$DIAG);
$ALL_DIAGS = 0;
}
elsif ($ARGV[0] eq '-h') {
shift (@ARGV);
}
else {
die "Illigal option provided \n";
}
} #while ($#ARGV >= 0)
if (!(-e $TESTDIR_VU && -d $TESTDIR_VU)) {
mkdir ($TESTDIR_VU,0777) || die "Cant make $TESTDIR_VU \n";
}
if (!(-e $TESTDIR_SU && -d $TESTDIR_SU)) {
mkdir ($TESTDIR_SU,0777) || die "Cant make $TESTDIR_SU \n";
}
if (!(-r "testsuite")){
print "Getting file $VUREGRES/regression/testsuite \n";
system("cp $VUREGRES/regression/testsuite $WORKDIR")==0
|| die " System Call interrupt";
chmod(0666,$WORKDIR."/testsuite");
}
open(TESTSUITE,"testsuite") || die "Cant open testsuite \n";
open(TESTSKIPPED,">ctests.skipped") || die "Cant open ctests.skipped \n";
open(LOG,">cregression.log") || die "Cant open cregression.log \n";
$test_num=0;
while ($_= <TESTSUITE>) {
split;
$INTYPE = 0; $STYPE = 0;
$VUTEST = 0; $SUTEST = 0;
$TEST_TYPE = $_[0]; #VU,SU
$TEST = $_[1]; #test
if ($TEST_TYPE eq "VU" || $TEST_TYPE eq "SU") {
if ($TEST_TYPE eq "VU") {
$VUTEST = 1;
$TESTNAME_FULL = $ROOT."/".$TEST;
$TESTDIR = $TESTDIR_VU;
open(MAKEFILE,">$TESTDIR/Makefile") || die "Cant open $TESTDIR/Makefile \n";
}
else {
$SUTEST = 1;
$TESTNAME_FULL = $ROOT."/".$TEST;
$TESTDIR = $TESTDIR_SU;
open(MAKEFILE,">$TESTDIR/Makefile") || die "Cant open $TESTDIR/Makefile \n";
}
$TEST = `basename $TESTNAME_FULL`;
chop($TEST);
print "test is $TEST \n";
($TEST,$FILE_TYPE) = split(/\./,$TEST);
if ($FILE_TYPE eq "in") {
$INTYPE = 1;
}
else {
$STYPE = 1;
}
if (-r $TESTNAME_FULL) {
chdir ($TESTDIR) || die "Cant go to $TESTDIR \n";
print MAKEFILE "\n";
print MAKEFILE "TARGET1 = $TEST.$FILE_TYPE\n";
print MAKEFILE "TARGET2 = $TEST.out \n";
print MAKEFILE "TOOL = $RSPASM/rspasm $TOOL/d2asm $TOOL/make_rtsk\n";
print MAKEFILE "INCLUDE = VU_AVP.h suregre.h\n";
print MAKEFILE "\n";
print MAKEFILE "\$(TARGET2): $TEST.$FILE_TYPE \$(TOOL) \$(INCLUDE)\n";
print MAKEFILE "\ttouch a.out\n";
print MAKEFILE "\trm a.out*\n";
if ($FILE_TYPE eq "in") {
print MAKEFILE "\t$TOOL/d2asm $TEST.in $TEST.s $TEST.inlst\n";
}
print MAKEFILE "\t$RSPASM/rspasm -b 0 $TEST.s\n";
print MAKEFILE "\tmv a.out $TEST.out\n";
print MAKEFILE "\tmv a.out.lst $TEST.lst\n";
print MAKEFILE "\tmv a.out.dat $TEST.dat\n";
if ($TEST_TYPE eq "SU") {
print MAKEFILE "\t$TOOL/make_rtsk $TEST 1\n";
}
else {
print MAKEFILE "\t$TOOL/make_rtsk $TEST 31\n";
}
print MAKEFILE "\t$RSPSIM/rsp -n $TEST.rtsk> $TEST.simlog </dev/null \n";
print MAKEFILE "\n";
print MAKEFILE "\$(TARGET1): $TESTNAME_FULL\n";
print MAKEFILE "\tcp $TESTNAME_FULL $TEST.$FILE_TYPE\n";
print MAKEFILE "\tchmod +w $TEST.$FILE_TYPE\n";
print MAKEFILE "\n";
print MAKEFILE "\suregre.h: $SUREGRES/csrc/suregre.h \n";
print MAKEFILE "\tcp $SUREGRES/csrc/suregre.h suregre.h\n";
print MAKEFILE "\tchmod +w suregre.h\n";
print MAKEFILE "\n";
print MAKEFILE "\VU_AVP.h: $VUREGRES/src/include/VU_AVP.h \n";
print MAKEFILE "\tcp $VUREGRES/src/include/VU_AVP.h VU_AVP.h\n";
print MAKEFILE "\tchmod +w VU_AVP.h\n";
close(MAKEFILE);
if (system("make")==0) {
$CMPSTR = "";
if (-r $TEST.".simlog") {
if ($TEST_TYPE eq "SU") {
$CMPSTR = `grep "r1 = " $TEST.simlog`;
chop($CMPSTR);
if ($CMPSTR =~ /0xfeed0000/ || $CMPSTR =~ /0x0000feed/) {
print LOG "($TEST_TYPE test) $TEST.$FILE_TYPE passed\n";
}
else {
print LOG "($TEST_TYPE test) $TEST.$FILE_TYPE .......failed ($CMPSTR) \n";
}
}
elsif ($TEST_TYPE eq "VU") {
$CMPSTR = `grep "r31 = " $TEST.simlog`;
chop($CMPSTR);
if ($CMPSTR =~ /0xfeed0000/) {
print LOG "($TEST_TYPE test) $TEST.$FILE_TYPE passed\n";
}
else {
print LOG "($TEST_TYPE test) $TEST.$FILE_TYPE .......failed($CMPSTR)\n";
}
}
}
}
else {
print "\n\n****ERROR:asm steps: test skipped\n\n";
print TESTSKIPPED "($TEST_TYPE test) $TEST.$FILE_TYPE skipped due to Error\n";
}
} #if (-r $TESTNAME_FULL)
chdir ($WORKDIR) || die "Cant go to parent \n";
}
} #while
close(TESTSKIPPED);
close(LOG);
if (-z $WORKDIR."/tests.skipped") {
system("rm $WORKDIR/tests.skipped")==0 || die "System Interrupt";
}