OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [libsim.tests/] [jtag-select-module.exp] - Blame information for rev 98

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 98 jeremybenn
# jtag-select-module.exp. Tests of the library JTAG module selection
2
 
3
# Copyright (C) 2010 Embecosm Limited
4
 
5
# Contributor Jeremy Bennett 
6
 
7
# This file is part of OpenRISC 1000 Architectural Simulator.
8
 
9
# This program is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by the Free
11
# Software Foundation; either version 3 of the License, or (at your option)
12
# any later version.
13
 
14
# This program is distributed in the hope that it will be useful, but WITHOUT
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
17
# more details.
18
 
19
# You should have received a copy of the GNU General Public License along
20
# with this program.  If not, see .  */
21
 
22
# -----------------------------------------------------------------------------
23
# This code is commented throughout for use with Doxygen.
24
# -----------------------------------------------------------------------------
25
 
26
 
27
# These tests check all the module selection behavior. Behavior consequential
28
# on subsequent commands (WRITE_COMMAND, READ_COMMAND, GO_COMMAND_READ,
29
# GO_COMMAND_WRITE, READ_CONTROL and READ_CONTROL) appears in the test file
30
# for that command.
31
 
32
# NOTE. All these tests return timing information, but we ignore it, since in
33
#       general it will not be repeatable.
34
 
35
# Just check if we can reset
36
run_libsim "JTAG SELECT_MODULE reset"                \
37
    [list "Initalization succeeded."       \
38
          "Execution step completed OK."   \
39
          "Resetting JTAG."                \
40
          "Execution step completed OK."   \
41
          "Test completed successfully."]  \
42
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET"
43
 
44
# Check instruction selection. Just a partial test. Comprehensive testing of
45
# this is in jtag-basic.exp
46
run_libsim "JTAG SELECT_MODULE EXTEST instr"    \
47
    [list "Initalization succeeded."       \
48
          "Execution step completed OK."   \
49
          "Resetting JTAG."                \
50
          "Execution step completed OK."   \
51
          "Shifting instruction."          \
52
          "  shifting in:  0x00"           \
53
          "Warning: JTAG EXTEST shifted"   \
54
          "  shifted out:  0x00"           \
55
          "  time taken: "                 \
56
          "Execution step completed OK."   \
57
          "Test completed successfully."]  \
58
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "0"
59
 
60
run_libsim "JTAG SELECT_MODULE invalid instr"                  \
61
    [list "Initalization succeeded."                      \
62
          "Execution step completed OK."                  \
63
          "Resetting JTAG."                               \
64
          "Execution step completed OK."                  \
65
          "Shifting instruction."                         \
66
          "  shifting in:  0x0c"                          \
67
          "ERROR: Unknown JTAG instruction 0x3 shifted"   \
68
          "  shifted out:  0x0c"                          \
69
          "  time taken: "                                \
70
          "Execution step completed OK."                  \
71
          "Test completed successfully."]                 \
72
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "3"
73
 
74
run_libsim "JTAG SELECT_MODULE DEBUG instr"    \
75
    [list "Initalization succeeded."      \
76
          "Execution step completed OK."  \
77
          "Resetting JTAG."               \
78
          "Execution step completed OK."  \
79
          "Shifting instruction."         \
80
          "  shifting in:  0x01"          \
81
          "  shifted out:  0x01"          \
82
          "  time taken: "                \
83
          "Execution step completed OK."  \
84
          "Test completed successfully."] \
85
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8"
86
 
87
# Comprehensive test of selecting all possible modules. Only Wishbone (0),
88
# CPU0 (1) and CPU1 (2) should work silently (although CPU1 will prompt
89
# warnings if subsequent GO commands are used). All other values will fail by
90
# setting the status field on response.
91
 
92
# Wishbone module select (0)
93
run_libsim "JTAG SELECT_MODULE SELECT_MODULE WB (0)"    \
94
    [list "Initalization succeeded."               \
95
          "Execution step completed OK."           \
96
          "Resetting JTAG."                        \
97
          "Execution step completed OK."           \
98
          "Shifting instruction."                  \
99
          "  shifting in:  0x01"                   \
100
          "  shifted out:  0x01"                   \
101
          "  time taken: "                         \
102
          "Execution step completed OK."           \
103
          "Selecting module."                      \
104
          "  shifting in:  0x0000000000174841bc61" \
105
          "  shifted out:  0x0164841bc60000000000" \
106
          "  status:       0x0"                    \
107
          "  time taken:"                          \
108
          "Execution step completed OK."           \
109
          "Test completed successfully."] \
110
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
111
         "SELECT_MODULE" "0"
112
 
113
# CPU0 module select (1)
114
run_libsim "JTAG SELECT_MODULE SELECT_MODULE CPU0 (1)"  \
115
    [list "Initalization succeeded."               \
116
          "Execution step completed OK."           \
117
          "Resetting JTAG."                        \
118
          "Execution step completed OK."           \
119
          "Shifting instruction."                  \
120
          "  shifting in:  0x01"                   \
121
          "  shifted out:  0x01"                   \
122
          "  time taken: "                         \
123
          "Execution step completed OK."           \
124
          "Selecting module."                      \
125
          "  shifting in:  0x00000000000aff51d871" \
126
          "  shifted out:  0x0164841bc60000000000" \
127
          "  status:       0x0"                    \
128
          "  time taken:"                          \
129
          "Execution step completed OK."           \
130
          "Test completed successfully."] \
131
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
132
         "SELECT_MODULE" "1"
133
 
134
# CPU1 module select (2)
135
run_libsim "JTAG SELECT_MODULE SELECT_MODULE CPU1 (2)"  \
136
    [list "Initalization succeeded."               \
137
          "Execution step completed OK."           \
138
          "Resetting JTAG."                        \
139
          "Execution step completed OK."           \
140
          "Shifting instruction."                  \
141
          "  shifting in:  0x01"                   \
142
          "  shifted out:  0x01"                   \
143
          "  time taken: "                         \
144
          "Execution step completed OK."           \
145
          "Selecting module."                      \
146
          "  shifting in:  0x00000000001993c98e69" \
147
          "  shifted out:  0x0164841bc60000000000" \
148
          "  status:       0x0"                    \
149
          "  time taken:"                          \
150
          "Execution step completed OK."           \
151
          "Test completed successfully."] \
152
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
153
         "SELECT_MODULE" "2"
154
 
155
# All remaining modules should fail
156
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 3"         \
157
    [list "Initalization succeeded."               \
158
          "Execution step completed OK."           \
159
          "Resetting JTAG."                        \
160
          "Execution step completed OK."           \
161
          "Shifting instruction."                  \
162
          "  shifting in:  0x01"                   \
163
          "  shifted out:  0x01"                   \
164
          "  time taken: "                         \
165
          "Execution step completed OK."           \
166
          "Selecting module."                      \
167
          "  shifting in:  0x00000000000424d9ea79" \
168
          "  shifted out:  0x01893c98e68000000000" \
169
          "  status:       0x2"                    \
170
          "  time taken:"                          \
171
          "Execution step completed OK."           \
172
          "Test completed successfully."] \
173
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
174
         "SELECT_MODULE" "3"
175
 
176
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 4"         \
177
    [list "Initalization succeeded."               \
178
          "Execution step completed OK."           \
179
          "Resetting JTAG."                        \
180
          "Execution step completed OK."           \
181
          "Shifting instruction."                  \
182
          "  shifting in:  0x01"                   \
183
          "  shifted out:  0x01"                   \
184
          "  time taken: "                         \
185
          "Execution step completed OK."           \
186
          "Selecting module."                      \
187
          "  shifting in:  0x0000000000102585a565" \
188
          "  shifted out:  0x01893c98e68000000000" \
189
          "  status:       0x2"                    \
190
          "  time taken:"                          \
191
          "Execution step completed OK."           \
192
          "Test completed successfully."] \
193
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
194
         "SELECT_MODULE" "4"
195
 
196
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 5"         \
197
    [list "Initalization succeeded."               \
198
          "Execution step completed OK."           \
199
          "Resetting JTAG."                        \
200
          "Execution step completed OK."           \
201
          "Shifting instruction."                  \
202
          "  shifting in:  0x01"                   \
203
          "  shifted out:  0x01"                   \
204
          "  time taken: "                         \
205
          "Execution step completed OK."           \
206
          "Selecting module."                      \
207
          "  shifting in:  0x00000000000d9295c175" \
208
          "  shifted out:  0x01893c98e68000000000" \
209
          "  status:       0x2"                    \
210
          "  time taken:"                          \
211
          "Execution step completed OK."           \
212
          "Test completed successfully."] \
213
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
214
         "SELECT_MODULE" "5"
215
 
216
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 6"         \
217
    [list "Initalization succeeded."               \
218
          "Execution step completed OK."           \
219
          "Resetting JTAG."                        \
220
          "Execution step completed OK."           \
221
          "Shifting instruction."                  \
222
          "  shifting in:  0x01"                   \
223
          "  shifted out:  0x01"                   \
224
          "  time taken: "                         \
225
          "Execution step completed OK."           \
226
          "Selecting module."                      \
227
          "  shifting in:  0x00000000001efe0d976d" \
228
          "  shifted out:  0x01893c98e68000000000" \
229
          "  status:       0x2"                    \
230
          "  time taken:"                          \
231
          "Execution step completed OK."           \
232
          "Test completed successfully."] \
233
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
234
         "SELECT_MODULE" "6"
235
 
236
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 7"         \
237
    [list "Initalization succeeded."               \
238
          "Execution step completed OK."           \
239
          "Resetting JTAG."                        \
240
          "Execution step completed OK."           \
241
          "Shifting instruction."                  \
242
          "  shifting in:  0x01"                   \
243
          "  shifted out:  0x01"                   \
244
          "  time taken: "                         \
245
          "Execution step completed OK."           \
246
          "Selecting module."                      \
247
          "  shifting in:  0x000000000003491df37d" \
248
          "  shifted out:  0x01893c98e68000000000" \
249
          "  status:       0x2"                    \
250
          "  time taken:"                          \
251
          "Execution step completed OK."           \
252
          "Test completed successfully."] \
253
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
254
         "SELECT_MODULE" "7"
255
 
256
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 8"         \
257
    [list "Initalization succeeded."               \
258
          "Execution step completed OK."           \
259
          "Resetting JTAG."                        \
260
          "Execution step completed OK."           \
261
          "Shifting instruction."                  \
262
          "  shifting in:  0x01"                   \
263
          "  shifted out:  0x01"                   \
264
          "  time taken: "                         \
265
          "Execution step completed OK."           \
266
          "Selecting module."                      \
267
          "  shifting in:  0x000000000014fea3b0e3" \
268
          "  shifted out:  0x01893c98e68000000000" \
269
          "  status:       0x2"                    \
270
          "  time taken:"                          \
271
          "Execution step completed OK."           \
272
          "Test completed successfully."] \
273
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
274
         "SELECT_MODULE" "8"
275
 
276
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 9"         \
277
    [list "Initalization succeeded."               \
278
          "Execution step completed OK."           \
279
          "Resetting JTAG."                        \
280
          "Execution step completed OK."           \
281
          "Shifting instruction."                  \
282
          "  shifting in:  0x01"                   \
283
          "  shifted out:  0x01"                   \
284
          "  time taken: "                         \
285
          "Execution step completed OK."           \
286
          "Selecting module."                      \
287
          "  shifting in:  0x00000000000949b3d4f3" \
288
          "  shifted out:  0x01893c98e68000000000" \
289
          "  status:       0x2"                    \
290
          "  time taken:"                          \
291
          "Execution step completed OK."           \
292
          "Test completed successfully."] \
293
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
294
         "SELECT_MODULE" "9"
295
 
296
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 10"        \
297
    [list "Initalization succeeded."               \
298
          "Execution step completed OK."           \
299
          "Resetting JTAG."                        \
300
          "Execution step completed OK."           \
301
          "Shifting instruction."                  \
302
          "  shifting in:  0x01"                   \
303
          "  shifted out:  0x01"                   \
304
          "  time taken: "                         \
305
          "Execution step completed OK."           \
306
          "Selecting module."                      \
307
          "  shifting in:  0x00000000001a252b82eb" \
308
          "  shifted out:  0x01893c98e68000000000" \
309
          "  status:       0x2"                    \
310
          "  time taken:"                          \
311
          "Execution step completed OK."           \
312
          "Test completed successfully."] \
313
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
314
         "SELECT_MODULE" "a"
315
 
316
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 11"        \
317
    [list "Initalization succeeded."               \
318
          "Execution step completed OK."           \
319
          "Resetting JTAG."                        \
320
          "Execution step completed OK."           \
321
          "Shifting instruction."                  \
322
          "  shifting in:  0x01"                   \
323
          "  shifted out:  0x01"                   \
324
          "  time taken: "                         \
325
          "Execution step completed OK."           \
326
          "Selecting module."                      \
327
          "  shifting in:  0x000000000007923be6fb" \
328
          "  shifted out:  0x01893c98e68000000000" \
329
          "  status:       0x2"                    \
330
          "  time taken:"                          \
331
          "Execution step completed OK."           \
332
          "Test completed successfully."] \
333
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
334
         "SELECT_MODULE" "b"
335
 
336
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 12"        \
337
    [list "Initalization succeeded."               \
338
          "Execution step completed OK."           \
339
          "Resetting JTAG."                        \
340
          "Execution step completed OK."           \
341
          "Shifting instruction."                  \
342
          "  shifting in:  0x01"                   \
343
          "  shifted out:  0x01"                   \
344
          "  time taken: "                         \
345
          "Execution step completed OK."           \
346
          "Selecting module."                      \
347
          "  shifting in:  0x0000000000139367a9e7" \
348
          "  shifted out:  0x01893c98e68000000000" \
349
          "  status:       0x2"                    \
350
          "  time taken:"                          \
351
          "Execution step completed OK."           \
352
          "Test completed successfully."] \
353
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
354
         "SELECT_MODULE" "c"
355
 
356
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 13"        \
357
    [list "Initalization succeeded."               \
358
          "Execution step completed OK."           \
359
          "Resetting JTAG."                        \
360
          "Execution step completed OK."           \
361
          "Shifting instruction."                  \
362
          "  shifting in:  0x01"                   \
363
          "  shifted out:  0x01"                   \
364
          "  time taken: "                         \
365
          "Execution step completed OK."           \
366
          "Selecting module."                      \
367
          "  shifting in:  0x00000000000e2477cdf7" \
368
          "  shifted out:  0x01893c98e68000000000" \
369
          "  status:       0x2"                    \
370
          "  time taken:"                          \
371
          "Execution step completed OK."           \
372
          "Test completed successfully."] \
373
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
374
         "SELECT_MODULE" "d"
375
 
376
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 14"        \
377
    [list "Initalization succeeded."               \
378
          "Execution step completed OK."           \
379
          "Resetting JTAG."                        \
380
          "Execution step completed OK."           \
381
          "Shifting instruction."                  \
382
          "  shifting in:  0x01"                   \
383
          "  shifted out:  0x01"                   \
384
          "  time taken: "                         \
385
          "Execution step completed OK."           \
386
          "Selecting module."                      \
387
          "  shifting in:  0x00000000001d48ef9bef" \
388
          "  shifted out:  0x01893c98e68000000000" \
389
          "  status:       0x2"                    \
390
          "  time taken:"                          \
391
          "Execution step completed OK."           \
392
          "Test completed successfully."] \
393
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
394
         "SELECT_MODULE" "e"
395
 
396
run_libsim "JTAG SELECT_MODULE SELECT_MODULE 15"        \
397
    [list "Initalization succeeded."               \
398
          "Execution step completed OK."           \
399
          "Resetting JTAG."                        \
400
          "Execution step completed OK."           \
401
          "Shifting instruction."                  \
402
          "  shifting in:  0x01"                   \
403
          "  shifted out:  0x01"                   \
404
          "  time taken: "                         \
405
          "Execution step completed OK."           \
406
          "Selecting module."                      \
407
          "  shifting in:  0x000000000000ffffffff" \
408
          "  shifted out:  0x01893c98e68000000000" \
409
          "  status:       0x2"                    \
410
          "  time taken:"                          \
411
          "Execution step completed OK."           \
412
          "Test completed successfully."] \
413
    "lib-jtag/lib-jtag-full" "" "loop/loop" "RESET" "INSTRUCTION" "8" \
414
         "SELECT_MODULE" "f"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.