-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.testscript
executable file
·345 lines (310 loc) · 10.9 KB
/
.testscript
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
#!/bin/csh -f
#
############################################################
#
#
# If you wish to run the dve GUI test,
# toggle the following variable to a "1":
#
set test_vcs_gui = 0
# vcs invocation test (on by default)
set test_vcs = 1
# verdi invocation test (on by default)
# set this to 0 if you do not have Verdi installed.
set test_verdi = 1
############################################################
# test script configuration
#
set Course_Name = "SVTB"
# This is used to check that the tool has the right version
set vcs_tool_version = "2016.06"
set verdi_tool_version = "Verdi3_L-2016.06"
set vcs_shell = "vcs"
set vcs_gui = "dve"
set vcs_urg = "urg"
set verdi_gui = "verdi"
set last_update = "2016-08-01"
# This checksum is generated by using the following commands:
#
# unix$ setenv LC_ALL C
# unix$ unsetenv LANG
# unix$ find $dir_files_pattern -follow | sort | cksum
#
set dir_files_pattern = "./rtl ./labs ./solutions"
set dir_files_checksum = "489679658 2933"
# This checksum is generated by using the following command:
#
# unix$ cat $content_pattern | cksum
#
set content_pattern = "rtl/*.v rtl/bad/*.v labs/*/* solutions/*/*"
set content_checksum = "383033902 230543"
#
#
########################################################################
########################################################################
#
# Find the name of the testscript and cd into the directory
# containing the testscript
#
set thisFile=".testscript"
set installDir=`echo $0 | sed s/$thisFile//`
if("${installDir}" != "") cd $installDir
#
#
########################################################################
#
#
echo " "
echo " ******************************************************"
echo " Running the Synopsys Workshop Installation Test Script"
echo " "
echo " Course Name: $Course_Name"
echo " VCS Version: $vcs_tool_version"
echo " Verdi Version: $verdi_tool_version"
echo " Last Update: $last_update"
echo " ******************************************************"
echo ""
#run tests
#
# Clean up from previous test run by removing and recopying .test file
#
#
if (-e .test ) then
rm -rf .test
endif
cp -r .testMaster .test
set RESULTFILE = results
set FULL_RESULTFILE = .test/results
echo $Course_Name > $FULL_RESULTFILE
# This makes sure that sort uses the traditional sort order - native byte values
setenv LC_ALL C
unsetenv LANG
# Test 1: Checking for critical files
#
echo " Running Test 1 - installation integrity check"
# Create a directory listing to check that all necessary files are there
set dir_sum = `find $dir_files_pattern -follow | sort | cksum`
if ( "$dir_sum" == "$dir_files_checksum" ) then
echo "Test 1a PASSED: All files are installed " >> $FULL_RESULTFILE
else
echo "Test 1a ERROR : There are files missing in the installation "
echo ""
echo "Test 1a FAILED: There are files missing in the installation" >> $FULL_RESULTFILE
echo "" >> $FULL_RESULTFILE
endif
# Perform a content check on some files
set file_sum = `cat $content_pattern | cksum`
if ( "$file_sum" == "$content_checksum" ) then
echo "Test 1b PASSED: Files are consistent" >> $FULL_RESULTFILE
else
echo "Test 1b ERROR : File consistency problems found"
echo ""
echo "Test 1b FAILED: File consistency problems found" >> $FULL_RESULTFILE
echo "" >> $FULL_RESULTFILE
endif
# All remaining tests happen from ./.test
cd .test
# Test 2: Running vcs and Verdi Installation Test Script
#
echo " Running Tests 2a,b,c - availability of VCS executables"
set tool_location = `which $vcs_shell`
which $vcs_shell | grep -w no >& /dev/null
if ( $status == 0 ) then
echo "Test 2a ERROR : Cannot locate $vcs_shell executable in current search path "
echo ""
echo "Test 2a FAILED: Cannot locate $vcs_shell executable in current search path" >> $RESULTFILE
else
echo "Test 2a PASSED: Found $vcs_shell executable at $tool_location " >> $RESULTFILE
endif
set tool_location = `which $vcs_gui`
which $vcs_gui | grep -w no >& /dev/null
if ( $status == 0 ) then
echo "Test 2b ERROR : Cannot locate $vcs_gui executable in current search path "
echo ""
echo "Test 2b FAILED: Cannot locate $vcs_gui executable in current search path" >> $RESULTFILE
else
echo "Test 2b PASSED: Found $vcs_gui executable at $tool_location " >> $RESULTFILE
endif
set tool_location = `which $vcs_urg`
which $vcs_urg | grep -w no >& /dev/null
if ( $status == 0 ) then
echo "Test 2c ERROR : Cannot locate $vcs_urg executable in current search path "
echo ""
echo "Test 2c FAILED: Cannot locate $vcs_urg executable in current search path" >> $RESULTFILE
else
echo "Test 2c PASSED: Found $vcs_urg executable at $tool_location " >> $RESULTFILE
endif
if ( $test_verdi == 1 ) then
echo " Running Test 2d - availability of verdi executables"
set tool_location = `which $verdi_gui`
which $verdi_gui | grep -w no >& /dev/null
if ( $status == 0 ) then
echo "Test 2d ERROR : Cannot locate $verdi_gui executable in current search path "
echo ""
echo "Test 2d FAILED: Cannot locate $verdi_gui executable in current search path" >> $RESULTFILE
else
echo "Test 2d PASSED: Found $verdi_gui executable at $tool_location " >> $RESULTFILE
endif
endif
endif
# Test 3: Checking access to vcs and verdi
#
if ( $test_vcs != 1 ) then
echo " Skipping Test 3a - vcs invocation test"
echo "Test 3a Skipped : not implemented" >> $RESULTFILE
echo "" >> $RESULTFILE
else
echo " Running Test 3a - vcs invocation test"
vcs -sverilog -ntb_opts svp -debug test.sv >! vcs.out
grep dut ./vcs.out >& /dev/null
if ( $status == 1 ) then
echo "Test 3a ERROR : Could not invoke vcs"
echo ""
echo "" >> $RESULTFILE
echo "Test 3a FAILED: vcs run failed" >> $RESULTFILE
echo "" >> $RESULTFILE
else
grep ERROR ./vcs.out >& /dev/null
if ( $status == 0 ) then
echo "Test 3a ERROR : vcs compilation failed!"
echo ""
echo "" >> $RESULTFILE
echo "Test 3a FAILED: vcs compilation failed" >> $RESULTFILE
echo "" >> $RESULTFILE
else
grep $vcs_tool_version ./vcs.out >& /dev/null
if ( $status == 1 ) then
echo "Test 3a WARNING : You are not using the correct vcs version $vcs_tool_version"
echo ""
echo "" >> $RESULTFILE
echo "Test 3a FAILED: vcs wrong version" >> $RESULTFILE
echo "" >> $RESULTFILE
else
echo "Test 3a PASSED: vcs succeeded" >> $RESULTFILE
endif
endif
endif
endif
if ( $test_verdi != 1 ) then
echo " Skipping Test 3b - verdi invocation test"
echo "Test 3b Skipped : not implemented" >> $RESULTFILE
echo "" >> $RESULTFILE
else
echo " Running Test 3b - verdi invocation test"
echo debExit >& verdi.cmd
verdi -nogui -licedebug -play verdi.cmd >& verdi.out
grep -i "could not checkout verdi license" ./verdi.out >& /dev/null
if ( $status == 0 ) then
echo "Test 3b ERROR : Could not invoke Verdi!"
echo ""
echo "" >> $RESULTFILE
echo "Test 3b FAILED: verdi invocation test failed" >> $RESULTFILE
echo "" >> $RESULTFILE
else
grep $verdi_tool_version ./verdi.out >& /dev/null
if ( $status == 1 ) then
echo "Test 3b WARNING : You are not using the correct verdi version $verdi_tool_version"
echo ""
echo "" >> $RESULTFILE
echo "Test 3b FAILED: verdi wrong version" >> $RESULTFILE
echo "" >> $RESULTFILE
else
echo "Test 3b PASSED: verdi succeeded" >> $RESULTFILE
endif
endif
endif
# Test 4: Checking vcs SystemVerilog simulation
#
if ( $test_vcs != 1 ) then
echo " Skipping Test 4 - vcs SystemVerilog simulation test"
echo "Test 4 Skipped : not implemented" >> $RESULTFILE
echo "" >> $RESULTFILE
else
echo " Running Test 4 - vcs SystemVerilog simulation test"
vcs -R -sverilog -debug router.test_top.sv router.v router.tb.sv router.if.sv >! vcs.out
grep rtslicef ./vcs.out >& /dev/null
if ( $status == 1 ) then
echo "Test 4 ERROR : Could not invoke vcs SystemVerilog compilation"
echo ""
echo "" >> $RESULTFILE
echo "Test 4 FAILED: vcs SystemVerilog invocation failed" >> $RESULTFILE
echo "" >> $RESULTFILE
else
grep ERROR ./vcs.out >& /dev/null
if ( $status == 0 ) then
echo "Test 4 ERROR : vcs SystemVerilog compilation failed!"
echo ""
echo "" >> $RESULTFILE
echo "Test 4 FAILED: vcs SystemVerilog compilation failed" >> $RESULTFILE
echo "" >> $RESULTFILE
else
grep $vcs_tool_version ./vcs.out >& /dev/null
if ( $status == 1 ) then
echo "Test 4 WARNING : You are not using the correct vcs version $vcs_tool_version"
echo ""
echo "" >> $RESULTFILE
echo "Test 4 FAILED: vcs wrong version" >> $RESULTFILE
echo "" >> $RESULTFILE
else
grep "coverage = 100" ./vcs.out >& /dev/null
if ( $status == 0 ) then
echo "Test 4 PASSED: vcs ntb succeeded" >> $RESULTFILE
else
echo "Test 4 ERROR : vcs SystemVerilog simulation failed!"
echo ""
echo "" >> $RESULTFILE
echo "Test 4 FAILED: vcs SystemVerilog simulation" >> $RESULTFILE
echo "" >> $RESULTFILE
endif
endif
endif
endif
rm -rf ./simv* ./csrc
endif
# Test 5: Checking VCS gui dve
#
if ( $test_vcs_gui != 1 ) then
echo " Skipping Test 5 - GUI ($vcs_gui)"
echo "Test 5 Skipped by user: GUI ($vcs_gui) run skipped" >> $RESULTFILE
echo "" >> $RESULTFILE
else
echo " Running Test 5 - GUI ($vcs_gui)"
echo "To continue: perform File -> quit"
$vcs_gui
if ( $status == 1 ) then
echo ""
echo "Test 5 ERROR : Something went wrong with the GUI ($vcs_gui) run"
echo "" >> $RESULTFILE
echo "Test 5 FAILED: GUI ($vcs_gui) run failed" >> $RESULTFILE
echo "" >> $RESULTFILE
else
echo "Test 5 PASSED: $vcs_gui Invocation succeeded" >> $RESULTFILE
endif
endif
# results reporting
set RESULTS = `grep FAIL $RESULTFILE`
if ("${RESULTS}" != "") then
echo "" >> $RESULTFILE
echo "" >> $RESULTFILE
echo " *******************************************************" >> $RESULTFILE
echo " * Recommended Suggestions for Corrections of FAILURES *" >> $RESULTFILE
echo " *******************************************************" >> $RESULTFILE
echo "" >> $RESULTFILE
echo " 1. Be sure the class materials installed correctly. " >> $RESULTFILE
echo "" >> $RESULTFILE
echo " 2. Be sure the vcs and verdi(if used in the labs) executables are in your path." >> $RESULTFILE
echo "" >> $RESULTFILE
echo ""
echo " Installation Test FAILS for $Course_Name Course "
echo " For details execute: cat .test/results"
echo ""
echo " Installation Test for $Course_Name Course FAILS on " `date` > ./installResults
else
echo ""
echo " Installation Test PASSED for $Course_Name Course"
echo ""
echo " Installation Test for $Course_Name Course PASSED on " `date` > ./installResults
#cleanup
rm -rf ./.test
endif
exit