parsesuite
3.14 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
#!/bin/perl
require "getopts.pl";
&Getopts('c:b:n:');
if ($opt_c)
{
$CurrentGroup = $opt_c;
}
else
{
$CurrentGroup = 1;
}
if ($opt_b)
{
$BaseName = $opt_b;
}
else
{
$BaseName = "gng";
}
if ($opt_n)
{
$NUMFILESPERBLOCK = $opt_n;
}
else
{
$NUMFILESPERBLOCK = 4;
}
open(TESTSUITE, "testsuite");
while(<TESTSUITE>)
{
chop;
if (/^SU/ || /^VU/)
{
s#^.*/##;
$TestList[$TestNumber++] = $_;
}
}
sub PrintWrapper
{
printf("%s \n", "#"x80);
printf("$BaseName$GroupNumber.vec: \$(ATTESTDIR)/$BaseName$GroupNumber.vec \n");
printf(" \n");
printf("\$(ATTESTDIR)/$BaseName$GroupNumber.vec: \$(BINDIR)/reality_rsp_regression \$(TESTDIR)/rsp_tests.list \\\n");
for ($j = 0; $j < $NumSamples; $j++)
{
printf(" $Sample[$j] \\\n");
}
printf(" - cd \$(TESTDIR); \\\n");
printf(" \$(BINDIR)/reality_rsp_regression -nocompile +rcp_attest_tab +attest_name=$BaseName$GroupNumber.vec \\\n");
for ($j = 0; $j < $NumSamples; $j++)
{
printf(" +diag=$Sample[$j] %s\n",
$j == $NumSamples - 1 ? "" : "\\");
}
printf(" sleep 200 \n");
printf(" mv \$(TESTDIR)/$BaseName$GroupNumber.vec \$(ATTESTDIR)/$BaseName$GroupNumber.vec \n");
printf(" mv \$(TESTDIR)/,out \$(TESTDIR)/$BaseName$GroupNumber.out \n");
printf(" mv \$(TESTDIR)/regression.log \$(TESTDIR)/$BaseName$GroupNumber.regression.log \n");
printf(" \n");
printf("$BaseName$GroupNumber.hp: \$(HPDIR)/$BaseName$GroupNumber.slf.Z \n");
printf(" \n");
printf("\$(HPDIR)/$BaseName$GroupNumber.slf.Z: \$(TESTDPDS) ");
for ($j = 0; $j < $NumSamples; $j++)
{
printf("$Sample[$j] ");
}
printf("\n");
printf(" echo \"");
for ($j = 0; $j < $NumSamples; $j++)
{
printf("+diag=$Sample[$j]");
}
printf("\" > $BaseName$GroupNumber.input \n");
printf(" - rm -f \$(ROOT)/PR/hw2/chip/vector/rsp/$BaseName$GroupNumber.input \n");
printf(" ln -s `pwd`/$BaseName$GroupNumber.input \$(ROOT)/PR/hw2/chip/vector/rsp \n");
printf(" \$(NHPEXECS:LIST=$BaseName$GroupNumber.input) \n");
printf(" \n");
}
printf("########################################################### \n");
printf("# \n");
printf("# rules for extracting vectors from reality_rsp_regression \n");
printf("# \n");
printf("########################################################### \n");
printf(" \n");
printf("include ../rsprules \n");
printf(" \n");
printf("#################################################################################### \n");
printf("# Targets for generation of Fault Grading Vector files \n");
printf("#################################################################################### \n");
printf(" \n");
for ($i=0; $i < $TestNumber; $i+=$NUMFILESPERBLOCK)
{
for ($j=0 ; $j<$NUMFILESPERBLOCK; $j++)
{
$Sample[$j] = $TestList[$i+$j];
}
if ($i+$NUMFILESPERBLOCK <= $TestNumber-1)
{
$NumSamples = $NUMFILESPERBLOCK;
}
else
{
$NumSamples = $TestNumber - $i;
}
$GroupNumber = sprintf("%.2d", $CurrentGroup++);
&PrintWrapper();
}
printf("\n\n");
printf("default:\t");
for ($i=1; $i <= $GroupNumber; $i++)
{
printf("$BaseName%.2d.hp ", $i);
}
printf("\n\n\n");