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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 98 jeremybenn
# jtag-write-control.exp. Tests of the library JTAG WRITE_CONTROL command
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 behavior associated with the JTAG WRITE_CONTROL
28
# command.
29
 
30
# NOTE. All these tests return timing information, but we ignore it, since in
31
#       general it will not be repeatable.
32
 
33
# Tests of the WRITE_CONTROL for writing from different modules. This should
34
# work fine for CPU0, but provoke a warning for Wishbone and CPU1 and a
35
# different warning for all other modules. Test no module, Wishbone, CPU0,
36
# CPU1 and module 6.
37
 
38
# WRITE_CONTROL with no module selected.
39
run_libsim "JTAG WRITE_CONTROL no module"             \
40
    [list "Initalization succeeded."                           \
41
          "Execution step completed OK."                       \
42
          "Resetting JTAG."                                    \
43
          "Execution step completed OK."                       \
44
          "Shifting instruction."                              \
45
          "  shifting in:  0x01"                               \
46
          "  shifted out:  0x01"                               \
47
          "  time taken:"                                      \
48
          "Execution step completed OK."                       \
49
          "Processing WRITE_CONTROL."                          \
50
          "  shifting in:  0x000000000096dc049200000000000004" \
51
          "ERROR: JTAG WRITE_CONTROL with no module selected." \
52
          "  shifted out:  0x164841bc600000000000000000000000" \
53
          "  status:       0x0"                                \
54
          "  time taken:"                                      \
55
          "Execution step completed OK."                       \
56
          "Test completed successfully."]                      \
57
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
58
         "8" "WRITE_CONTROL" "0" "0"
59
 
60
# WRITE_CONTROL with only WishBone module selected.
61
run_libsim "JTAG WRITE_CONTROL WB module"                        \
62
    [list "Initalization succeeded."                             \
63
          "Execution step completed OK."                         \
64
          "Resetting JTAG."                                      \
65
          "Execution step completed OK."                         \
66
          "Shifting instruction."                                \
67
          "  shifting in:  0x01"                                 \
68
          "  shifted out:  0x01"                                 \
69
          "  time taken:"                                        \
70
          "Execution step completed OK."                         \
71
          "Selecting module."                                    \
72
          "  shifting in:  0x0000000000174841bc61"               \
73
          "  shifted out:  0x0164841bc60000000000"               \
74
          "  status:       0x0"                                  \
75
          "  time taken:"                                        \
76
          "Execution step completed OK."                         \
77
          "Processing WRITE_CONTROL."                            \
78
          "  shifting in:  0x000000000096dc049200000000000004"   \
79
          "ERROR: JTAG WRITE_CONTROL of WishBone not supported." \
80
          "  shifted out:  0x164841bc600000000000000000000000"   \
81
          "  status:       0x0"                                  \
82
          "  time taken:"                                        \
83
          "Execution step completed OK."                         \
84
          "Test completed successfully."]                        \
85
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
86
         "8" "SELECT_MODULE" "0" "WRITE_CONTROL" "0" "0"
87
 
88
# WRITE_CONTROL with only invalid module selected.
89
run_libsim "JTAG WRITE_CONTROL invalid module"                 \
90
    [list "Initalization succeeded."                           \
91
          "Execution step completed OK."                       \
92
          "Resetting JTAG."                                    \
93
          "Execution step completed OK."                       \
94
          "Shifting instruction."                              \
95
          "  shifting in:  0x01"                               \
96
          "  shifted out:  0x01"                               \
97
          "  time taken:"                                      \
98
          "Execution step completed OK."                       \
99
          "Selecting module."                                  \
100
          "  shifting in:  0x00000000001993c98e69"             \
101
          "  shifted out:  0x0164841bc60000000000"             \
102
          "  status:       0x0"                                \
103
          "  time taken:"                                      \
104
          "Execution step completed OK."                       \
105
          "Processing WRITE_CONTROL."                          \
106
          "  shifting in:  0x000000000096dc049200000000000004" \
107
          "ERROR: JTAG WRITE_CONTROL of CPU1 not supported."   \
108
          "  shifted out:  0x164841bc600000000000000000000000" \
109
          "  status:       0x0"                                  \
110
          "  time taken:"                                      \
111
          "Execution step completed OK."                       \
112
          "Test completed successfully."]                      \
113
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
114
         "8" "SELECT_MODULE" "2" "WRITE_CONTROL" "0" "0"
115
 
116
# WRITE_CONTROL with invalid module selected after valid module
117
run_libsim "JTAG WRITE_CONTROL invalid after valid module"     \
118
    [list "Initalization succeeded."                           \
119
          "Execution step completed OK."                       \
120
          "Resetting JTAG."                                    \
121
          "Execution step completed OK."                       \
122
          "Shifting instruction."                              \
123
          "  shifting in:  0x01"                               \
124
          "  shifted out:  0x01"                               \
125
          "  time taken:"                                      \
126
          "Execution step completed OK."                       \
127
          "Selecting module."                                  \
128
          "  shifting in:  0x00000000000aff51d871"             \
129
          "  shifted out:  0x0164841bc60000000000"             \
130
          "  status:       0x0"                                \
131
          "  time taken:"                                      \
132
          "Execution step completed OK."                       \
133
          "Selecting module."                                  \
134
          "  shifting in:  0x000000000003491df37d"             \
135
          "  shifted out:  0x01893c98e68000000000"             \
136
          "  status:       0x2"                                \
137
          "  time taken:"                                      \
138
          "Execution step completed OK."                       \
139
          "Processing WRITE_CONTROL."                          \
140
          "  shifting in:  0x000000000096dc049200000000000004" \
141
          "ERROR: JTAG WRITE_CONTROL with no module selected." \
142
          "  shifted out:  0x164841bc600000000000000000000000" \
143
          "  status:       0x0"                                \
144
          "  time taken:"                                      \
145
          "Execution step completed OK."                       \
146
          "Test completed successfully."]                      \
147
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
148
         "8" "SELECT_MODULE" "1" "SELECT_MODULE" "7" "WRITE_CONTROL" "0" "0"
149
 
150
# WRITE_CONTROL with valid module selected after invalid module
151
run_libsim "JTAG WRITE_CONTROL valid after invalid module"      \
152
    [list "Initalization succeeded."                           \
153
          "Execution step completed OK."                       \
154
          "Resetting JTAG."                                    \
155
          "Execution step completed OK."                       \
156
          "Shifting instruction."                              \
157
          "  shifting in:  0x01"                               \
158
          "  shifted out:  0x01"                               \
159
          "  time taken:"                                      \
160
          "Execution step completed OK."                       \
161
          "Selecting module."                                  \
162
          "  shifting in:  0x000000000003491df37d"             \
163
          "  shifted out:  0x01893c98e68000000000"             \
164
          "  status:       0x2"                                \
165
          "  time taken:"                                      \
166
          "Execution step completed OK."                       \
167
          "Selecting module."                                  \
168
          "  shifting in:  0x00000000000aff51d871"             \
169
          "  shifted out:  0x0164841bc60000000000"             \
170
          "  status:       0x0"                                \
171
          "  time taken:"                                      \
172
          "Execution step completed OK."                       \
173
          "  shifting in:  0x000000000096dc049200000000000004" \
174
          "  shifted out:  0x164841bc600000000000000000000000" \
175
          "  status:       0x0"                                \
176
          "  time taken:"                                      \
177
          "Execution step completed OK."                       \
178
          "Test completed successfully."]                      \
179
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
180
         "8" "SELECT_MODULE" "7" "SELECT_MODULE" "1" "WRITE_CONTROL" "0" "0"
181
 
182
# Verify that writing works correctly from the valid module, CPU0.
183
 
184
# WRITE_CONTROL for CPU0.
185
run_libsim "JTAG WRITE_CONTROL CPU0"             \
186
    [list "Initalization succeeded."                           \
187
          "Execution step completed OK."                       \
188
          "Resetting JTAG."                                    \
189
          "Execution step completed OK."                       \
190
          "Shifting instruction."                              \
191
          "  shifting in:  0x01"                               \
192
          "  shifted out:  0x01"                               \
193
          "  time taken:"                                      \
194
          "Execution step completed OK."                       \
195
          "Selecting module."                                  \
196
          "  shifting in:  0x00000000000aff51d871"             \
197
          "  shifted out:  0x0164841bc60000000000"             \
198
          "  status:       0x0"                                \
199
          "  time taken:"                                      \
200
          "Execution step completed OK."                       \
201
          "Processing WRITE_CONTROL."                          \
202
          "  shifting in:  0x000000000096dc049200000000000004" \
203
          "  shifted out:  0x164841bc600000000000000000000000" \
204
          "  status:       0x0"                                \
205
          "  time taken:"                                      \
206
          "Execution step completed OK."                       \
207
          "Test completed successfully."]                      \
208
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
209
         "8" "SELECT_MODULE" "1" "WRITE_CONTROL" "0" "0"
210
 
211
# Test of setting and clearing the stall bit for CPU0. We can only do this via
212
# multiple WRITE_COMMANDs. After stalling we should complete execution on a
213
# breakpoint and after clearing complete OK.
214
 
215
# Set the stall bit.
216
run_libsim "JTAG WRITE_CONTROL CPU0 set stall"                 \
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:  0x00000000000aff51d871"             \
228
          "  shifted out:  0x0164841bc60000000000"             \
229
          "  status:       0x0"                                \
230
          "  time taken:"                                      \
231
          "Execution step completed OK."                       \
232
          "Processing WRITE_CONTROL."                          \
233
          "  shifting in:  0x000000000109a677aa00000000000044" \
234
          "  shifted out:  0x164841bc600000000000000000000000" \
235
          "  status:       0x0"                                \
236
          "  time taken:"                                      \
237
          "Execution step completed with breakpoint."          \
238
          "Test completed successfully."]                      \
239
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
240
         "8" "SELECT_MODULE" "1" "WRITE_CONTROL" "0" "1"
241
 
242
# Clear the stall bit.
243
run_libsim "JTAG WRITE_CONTROL CPU0 clear stall"               \
244
    [list "Initalization succeeded."                           \
245
          "Execution step completed OK."                       \
246
          "Resetting JTAG."                                    \
247
          "Execution step completed OK."                       \
248
          "Shifting instruction."                              \
249
          "  shifting in:  0x01"                               \
250
          "  shifted out:  0x01"                               \
251
          "  time taken:"                                      \
252
          "Execution step completed OK."                       \
253
          "Selecting module."                                  \
254
          "  shifting in:  0x00000000000aff51d871"             \
255
          "  shifted out:  0x0164841bc60000000000"             \
256
          "  status:       0x0"                                \
257
          "  time taken:"                                      \
258
          "Execution step completed OK."                       \
259
          "Processing WRITE_CONTROL."                          \
260
          "  shifting in:  0x000000000096dc049200000000000004" \
261
          "  shifted out:  0x164841bc600000000000000000000000" \
262
          "  status:       0x0"                                \
263
          "  time taken:"                                      \
264
          "Execution step completed OK."                       \
265
          "Test completed successfully."]                      \
266
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
267
         "8" "SELECT_MODULE" "1" "WRITE_CONTROL" "0" "0"
268
 
269
# Set, then clear the stall bit.
270
run_libsim "JTAG WRITE_CONTROL CPU0 set then clear stall"      \
271
    [list "Initalization succeeded."                           \
272
          "Execution step completed OK."                       \
273
          "Resetting JTAG."                                    \
274
          "Execution step completed OK."                       \
275
          "Shifting instruction."                              \
276
          "  shifting in:  0x01"                               \
277
          "  shifted out:  0x01"                               \
278
          "  time taken:"                                      \
279
          "Execution step completed OK."                       \
280
          "Selecting module."                                  \
281
          "  shifting in:  0x00000000000aff51d871"             \
282
          "  shifted out:  0x0164841bc60000000000"             \
283
          "  status:       0x0"                                \
284
          "  time taken:"                                      \
285
          "Execution step completed OK."                       \
286
          "Processing WRITE_CONTROL."                          \
287
          "  shifting in:  0x000000000109a677aa00000000000044" \
288
          "  shifted out:  0x164841bc600000000000000000000000" \
289
          "  status:       0x0"                                \
290
          "  time taken:"                                      \
291
          "Execution step completed with breakpoint."          \
292
          "Processing WRITE_CONTROL."                          \
293
          "  shifting in:  0x000000000096dc049200000000000004" \
294
          "  shifted out:  0x164841bc600000000000000000000000" \
295
          "  status:       0x0"                                \
296
          "  time taken:"                                      \
297
          "Execution step completed OK."                       \
298
          "Test completed successfully."]                      \
299
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" "8"   \
300
         "SELECT_MODULE" "1" "WRITE_CONTROL" "0" "1" "WRITE_CONTROL" "0" "0"
301
 
302
# Clear, then set the stall bit.
303
run_libsim "JTAG WRITE_CONTROL CPU0 clear then set stall"      \
304
    [list "Initalization succeeded."                           \
305
          "Execution step completed OK."                       \
306
          "Resetting JTAG."                                    \
307
          "Execution step completed OK."                       \
308
          "Shifting instruction."                              \
309
          "  shifting in:  0x01"                               \
310
          "  shifted out:  0x01"                               \
311
          "  time taken:"                                      \
312
          "Execution step completed OK."                       \
313
          "Selecting module."                                  \
314
          "  shifting in:  0x00000000000aff51d871"             \
315
          "  shifted out:  0x0164841bc60000000000"             \
316
          "  status:       0x0"                                \
317
          "  time taken:"                                      \
318
          "Execution step completed OK."                       \
319
          "Processing WRITE_CONTROL."                          \
320
          "  shifting in:  0x000000000096dc049200000000000004" \
321
          "  shifted out:  0x164841bc600000000000000000000000" \
322
          "  status:       0x0"                                \
323
          "  time taken:"                                      \
324
          "Execution step completed OK."                       \
325
          "Processing WRITE_CONTROL."                          \
326
          "  shifting in:  0x000000000109a677aa00000000000044" \
327
          "  shifted out:  0x164841bc600000000000000000000000" \
328
          "  status:       0x0"                                \
329
          "  time taken:"                                      \
330
          "Execution step completed with breakpoint."          \
331
          "Test completed successfully."]                      \
332
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" "8"   \
333
         "SELECT_MODULE" "1" "WRITE_CONTROL" "0" "0" "WRITE_CONTROL" "0" "1"
334
 
335
# Test the reset bit. We can see this works, becaause the PIC puts out a
336
# message on reset.
337
 
338
# Set the reset bit.
339
run_libsim "JTAG WRITE_CONTROL CPU0 reset"                     \
340
    [list "Initalization succeeded."                           \
341
          "Execution step completed OK."                       \
342
          "Resetting JTAG."                                    \
343
          "Execution step completed OK."                       \
344
          "Shifting instruction."                              \
345
          "  shifting in:  0x01"                               \
346
          "  shifted out:  0x01"                               \
347
          "  time taken:"                                      \
348
          "Execution step completed OK."                       \
349
          "Selecting module."                                  \
350
          "  shifting in:  0x00000000000aff51d871"             \
351
          "  shifted out:  0x0164841bc60000000000"             \
352
          "  status:       0x0"                                \
353
          "  time taken:"                                      \
354
          "Execution step completed OK."                       \
355
          "Processing WRITE_CONTROL."                          \
356
          "  shifting in:  0x000000000059613d0e00000000000024" \
357
          "Resetting PIC."                                     \
358
          "  shifted out:  0x164841bc600000000000000000000000" \
359
          "  status:       0x0"                                \
360
          "  time taken:"                                      \
361
          "Execution step completed OK."                       \
362
          "Test completed successfully."]                      \
363
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
364
         "8" "SELECT_MODULE" "1" "WRITE_CONTROL" "1" "0"
365
 
366
# Verify that reset overrides any simultaneous stall
367
run_libsim "JTAG WRITE_CONTROL CPU0 stall and reset"           \
368
    [list "Initalization succeeded."                           \
369
          "Execution step completed OK."                       \
370
          "Resetting JTAG."                                    \
371
          "Execution step completed OK."                       \
372
          "Shifting instruction."                              \
373
          "  shifting in:  0x01"                               \
374
          "  shifted out:  0x01"                               \
375
          "  time taken:"                                      \
376
          "Execution step completed OK."                       \
377
          "Selecting module."                                  \
378
          "  shifting in:  0x00000000000aff51d871"             \
379
          "  shifted out:  0x0164841bc60000000000"             \
380
          "  status:       0x0"                                \
381
          "  time taken:"                                      \
382
          "Execution step completed OK."                       \
383
          "Processing WRITE_CONTROL."                          \
384
          "  shifting in:  0x0000000001c61b4e3600000000000064" \
385
          "Resetting PIC."                                     \
386
          "  shifted out:  0x164841bc600000000000000000000000" \
387
          "  status:       0x0"                                \
388
          "  time taken:"                                      \
389
          "Execution step completed OK."                       \
390
          "Test completed successfully."]                      \
391
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
392
         "8" "SELECT_MODULE" "1" "WRITE_CONTROL" "1" "1"
393
 
394
# Verify that reset clears any previous stall
395
run_libsim "JTAG WRITE_CONTROL CPU0 stall then reset"           \
396
    [list "Initalization succeeded."                           \
397
          "Execution step completed OK."                       \
398
          "Resetting JTAG."                                    \
399
          "Execution step completed OK."                       \
400
          "Shifting instruction."                              \
401
          "  shifting in:  0x01"                               \
402
          "  shifted out:  0x01"                               \
403
          "  time taken:"                                      \
404
          "Execution step completed OK."                       \
405
          "Selecting module."                                  \
406
          "  shifting in:  0x00000000000aff51d871"             \
407
          "  shifted out:  0x0164841bc60000000000"             \
408
          "  status:       0x0"                                \
409
          "  time taken:"                                      \
410
          "Execution step completed OK."                       \
411
          "Processing WRITE_CONTROL."                          \
412
          "  shifting in:  0x000000000109a677aa00000000000044" \
413
          "  shifted out:  0x164841bc600000000000000000000000" \
414
          "  status:       0x0"                                \
415
          "  time taken:"                                      \
416
          "Execution step completed with breakpoint."          \
417
          "Processing WRITE_CONTROL."                          \
418
          "  shifting in:  0x000000000059613d0e00000000000024" \
419
          "Resetting PIC."                                     \
420
          "  shifted out:  0x164841bc600000000000000000000000" \
421
          "  status:       0x0"                                \
422
          "  time taken:"                                      \
423
          "Execution step completed OK."                       \
424
          "Test completed successfully."]                      \
425
    "lib-jtag/lib-jtag-full" "" "loop/loop-init" "RESET" "INSTRUCTION" \
426
         "8" "SELECT_MODULE" "1" "WRITE_CONTROL" "0" "1" "WRITE_CONTROL" "1" "0"

powered by: WebSVN 2.1.0

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