Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / cmp / ncu_tcu.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: ncu_tcu.s
5* Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
6* 4150 Network Circle, Santa Clara, California 95054, U.S.A.
7*
8* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9*
10* This program is free software; you can redistribute it and/or modify
11* it under the terms of the GNU General Public License as published by
12* the Free Software Foundation; version 2 of the License.
13*
14* This program is distributed in the hope that it will be useful,
15* but WITHOUT ANY WARRANTY; without even the implied warranty of
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17* GNU General Public License for more details.
18*
19* You should have received a copy of the GNU General Public License
20* along with this program; if not, write to the Free Software
21* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22*
23* For the avoidance of doubt, and except that if any non-GPL license
24* choice is available it will apply instead, Sun elects to use only
25* the General Public License version 2 (GPLv2) at this time for any
26* software where a choice of GPL license versions is made
27* available with the language indicating that GPLv2 or any later version
28* may be used, or where a choice of which version of the GPL is applied is
29* otherwise unspecified.
30*
31* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
32* CA 95054 USA or visit www.sun.com if you need additional information or
33* have any questions.
34*
35*
36* ========== Copyright Header End ============================================
37*/
38#define MAIN_PAGE_NUCLEUS_ALSO
39#define MAIN_PAGE_HV_ALSO
40
41
42#define FFLP_CONFIG 0x00100
43#define FZC_FFLP_BASE_OFFSET 0x020000
44#define FZC_FFLP_BASE_ADDRESS 0x380000
45
46#include "hboot.s"
47!#include "asi_s.h"
48
49.text
50.global main
51
52
53main:
54 ta T_CHANGE_HPRIV
55
56get_th_id:
57 ta %icc, T_RD_THID
58
59
60 cmp %o1, 0
61 be thread_0
62 nop
63
64 cmp %o1, 1
65 be thread_1
66 nop
67
68 cmp %o1, 2
69 be thread_2
70 nop
71
72 cmp %o1, 3
73 be thread_3
74 nop
75
76 cmp %o1, 4
77 be thread_4
78 nop
79
80 cmp %o1, 5
81 be thread_5
82 nop
83
84 cmp %o1, 6
85 be thread_6
86 nop
87
88 cmp %o1, 7
89 be thread_7
90 nop
91
92 cmp %o1, 8
93 be thread_8
94 nop
95
96 cmp %o1, 9
97 be thread_9
98 nop
99
100 cmp %o1, 10
101 be thread_10
102 nop
103
104 cmp %o1, 11
105 be thread_11
106 nop
107
108 cmp %o1, 12
109 be thread_12
110 nop
111
112 cmp %o1, 13
113 be thread_13
114 nop
115
116 cmp %o1, 14
117 be thread_14
118 nop
119
120 cmp %o1, 15
121 be thread_15
122 nop
123
124 cmp %o1, 16
125 be thread_16
126 nop
127
128 cmp %o1, 17
129 be thread_17
130 nop
131
132 cmp %o1, 18
133 be thread_18
134 nop
135
136 cmp %o1, 19
137 be thread_19
138 nop
139
140 cmp %o1, 20
141 be thread_20
142 nop
143
144 cmp %o1, 21
145 be thread_21
146 nop
147
148 cmp %o1, 22
149 be thread_22
150 nop
151
152 cmp %o1, 23
153 be thread_23
154 nop
155
156 cmp %o1, 24
157 be thread_24
158 nop
159
160 cmp %o1, 25
161 be thread_25
162 nop
163
164 cmp %o1, 26
165 be thread_26
166 nop
167
168 cmp %o1, 27
169 be thread_27
170 nop
171
172 cmp %o1, 28
173 be thread_28
174 nop
175
176 cmp %o1, 29
177 be thread_29
178 nop
179
180 cmp %o1, 30
181 be thread_30
182 nop
183
184 cmp %o1, 31
185 be thread_31
186 nop
187
188 cmp %o1, 32
189 be thread_32
190 nop
191
192 cmp %o1, 33
193 be thread_33
194 nop
195
196 cmp %o1, 34
197 be thread_34
198 nop
199
200 cmp %o1, 35
201 be thread_35
202 nop
203
204 cmp %o1, 36
205 be thread_36
206 nop
207
208 cmp %o1, 37
209 be thread_37
210 nop
211
212 cmp %o1, 38
213 be thread_38
214 nop
215
216 cmp %o1, 39
217 be thread_39
218 nop
219
220 cmp %o1, 40
221 be thread_40
222 nop
223
224 cmp %o1, 41
225 be thread_41
226 nop
227
228 cmp %o1, 42
229 be thread_42
230 nop
231
232 cmp %o1, 43
233 be thread_43
234 nop
235
236 cmp %o1, 44
237 be thread_44
238 nop
239
240 cmp %o1, 45
241 be thread_45
242 nop
243
244 cmp %o1, 46
245 be thread_46
246 nop
247
248 cmp %o1, 47
249 be thread_47
250 nop
251
252 cmp %o1, 48
253 be thread_48
254 nop
255
256 cmp %o1, 49
257 be thread_49
258 nop
259
260 cmp %o1, 50
261 be thread_50
262 nop
263
264 cmp %o1, 51
265 be thread_51
266 nop
267
268 cmp %o1, 52
269 be thread_52
270 nop
271
272 cmp %o1, 53
273 be thread_53
274 nop
275
276 cmp %o1, 54
277 be thread_54
278 nop
279
280 cmp %o1, 55
281 be thread_55
282 nop
283
284 cmp %o1, 56
285 be thread_56
286 nop
287
288 cmp %o1, 57
289 be thread_57
290 nop
291
292 cmp %o1, 58
293 be thread_58
294 nop
295
296 cmp %o1, 59
297 be thread_59
298 nop
299
300 cmp %o1, 60
301 be thread_60
302 nop
303
304 cmp %o1, 61
305 be thread_61
306 nop
307
308 cmp %o1, 62
309 be thread_62
310 nop
311
312 cmp %o1, 63
313 be thread_63
314 nop
315
316
317thread_63:
318 call sleep
319 nop
320
321thread_62:
322 call sleep
323 nop
324
325thread_61:
326 call sleep
327 nop
328
329thread_60:
330 call sleep
331 nop
332
333thread_59:
334 call sleep
335 nop
336
337thread_58:
338 call sleep
339 nop
340
341thread_57:
342 call sleep
343 nop
344
345thread_56:
346 call sleep
347 nop
348
349thread_55:
350 call sleep
351 nop
352
353thread_54:
354 call sleep
355 nop
356
357thread_53:
358 call sleep
359 nop
360
361thread_52:
362 call sleep
363 nop
364
365thread_51:
366 call sleep
367 nop
368
369thread_50:
370 call sleep
371 nop
372
373thread_49:
374 call sleep
375 nop
376
377thread_48:
378 call sleep
379 nop
380
381thread_47:
382 call sleep
383 nop
384
385thread_46:
386 call sleep
387 nop
388
389thread_45:
390 call sleep
391 nop
392
393thread_44:
394 call sleep
395 nop
396
397thread_43:
398 call sleep
399 nop
400
401thread_42:
402 call sleep
403 nop
404
405thread_41:
406 call sleep
407 nop
408
409thread_40:
410 call sleep
411 nop
412
413thread_39:
414 call sleep
415 nop
416
417thread_38:
418 call sleep
419 nop
420
421thread_37:
422 call sleep
423 nop
424
425thread_36:
426 call sleep
427 nop
428
429thread_35:
430 call sleep
431 nop
432
433thread_34:
434 call sleep
435 nop
436
437thread_33:
438 call sleep
439 nop
440
441thread_32:
442 call sleep
443 nop
444
445thread_31:
446 call sleep
447 nop
448
449thread_30:
450 call sleep
451 nop
452
453thread_29:
454 call sleep
455 nop
456
457thread_28:
458 call sleep
459 nop
460
461thread_27:
462 call sleep
463 nop
464
465thread_26:
466 call sleep
467 nop
468
469thread_25:
470 call sleep
471 nop
472
473thread_24:
474 call sleep
475 nop
476
477thread_23:
478 call sleep
479 nop
480
481thread_22:
482 call sleep
483 nop
484
485thread_21:
486 call sleep
487 nop
488
489thread_20:
490 call sleep
491 nop
492
493thread_19:
494 call sleep
495 nop
496
497thread_18:
498 call sleep
499 nop
500
501thread_17:
502 call sleep
503 nop
504
505thread_16:
506 call sleep
507 nop
508
509thread_15:
510 call sleep
511 nop
512
513thread_14:
514 call sleep
515 nop
516
517thread_13:
518 call sleep
519 nop
520
521thread_12:
522 call sleep
523 nop
524
525thread_11:
526 call sleep
527 nop
528
529thread_10:
530 call sleep
531 nop
532
533thread_9:
534 call sleep
535 nop
536
537thread_8:
538 call sleep
539 nop
540
541thread_7:
542 call sleep
543 nop
544
545thread_6:
546 call sleep
547 nop
548
549thread_5:
550 call sleep
551 nop
552
553
554thread_4:
555 call sleep
556 nop
557
558thread_3:
559 call sleep
560 nop
561
562thread_2:
563 call sleep
564 nop
565
566thread_1:
567 call sleep
568 nop
569
570
571thread_0:
572!Write then read data of DEBUG counter enbalbe REG of TCU block
573 setx 0x8500000000, %g7,%g1
574 setx debug_cnt_en,%g7,%g2
575
576 ldx [%g2],%g4
577 stx %g4,[%g1]
578
579 ldx [%g1], %g5
580 cmp %g4, %g5
581
582 bne %xcc, test_fail
583 nop
584
585 ba test_pass
586 nop
587
588
589sleep:
590 setx 0x0000008000000a00,%l1,%l2
591 set 1,%l3
592 set 0, %l0
593
594
595sleep_loop:
596 ldx [%l2],%l4
597 sub %l3,1,%l3
598 cmp %l3,%l0
599 bne sleep_loop
600 nop
601 retl
602 nop
603
604
605
606
607******************************************************
608 * Exit code
609 *******************************************************/
610
611test_pass:
612EXIT_GOOD
613
614test_fail:
615EXIT_BAD
616
617
618.data
619.align 0x100
620int_vec_data:
621 .xword 0x000000000000002a
622 .xword 0x000000000000003f
623 .xword 0x0000000000000015
624 .xword 0x0000000000000001
625 .xword 0x0000000000000002
626 .xword 0x0000000000000004
627 .xword 0x0000000000000008
628 .xword 0x0000000000000010
629 .xword 0x0000000000000020
630
631
632.align 0x100
633reset_fee:
634 .xword 0x000000000000ff00
635 .xword 0x000000000000aa00
636 .xword 0x0000000000005500
637 .xword 0x0000000000000000
638 .xword 0x0000000000008800
639 .xword 0x0000000000002200
640
641.align 0x100
642mcu_cfg_data:
643 .xword 0x000000000000ff00
644 .xword 0x000000000000aa00
645 .xword 0x0000000000005500
646 .xword 0x0000000000000000
647 .xword 0x0000000000000000
648 .xword 0x0000000000000000
649
650.align 0x100
651ssi_timeout:
652 .xword 0x0000000000ffffff
653 .xword 0x0000000000aaaaaa
654 .xword 0x0000000000555555
655 .xword 0x000000000056789a
656 .xword 0x0000000000df0123
657 .xword 0x0000000000789abc
658
659.align 0x100
660pll_ctl_data:
661 .xword 0x0000001fffffffff
662 .xword 0x0000001aaaaaaaaa
663 .xword 0x0000000555555555
664 .xword 0x000000123456789a
665 .xword 0x0000000bcedf0123
666 .xword 0x0000001456789abc
667
668.align 0x100
669int_en_data:
670 .xword 0x0000000000000fff
671 .xword 0x0000000000000aaa
672 .xword 0x0000000000000555
673 .xword 0x000000000000089a
674 .xword 0x0000000000000123
675 .xword 0x0000000000000abc
676
677.align 0x100
678config_data:
679 .xword 0x0000000000ffffff
680 .xword 0x0000000000aaaaaa
681 .xword 0x0000000000555555
682 .xword 0x000000000056789a
683 .xword 0x0000000000df0123
684 .xword 0x0000000000789abc
685
686
687.align 0x100
688wdata:
689 .xword 0xffffffffffffffff
690 .xword 0xaaaaaaaaaaaaaaaa
691 .xword 0x0000000000000000
692 .xword 0x5555555555555555
693 .xword 0x0123456789abcdef
694
695.align 0x100
696dbg1_cfg:
697 .xword 0x00000000000000ff
698 .xword 0x00000000000000aa
699 .xword 0x0000000000000000
700 .xword 0x0000000000000055
701
702.align 0x100
703debug_cnt_en:
704 .xword 0x000000000000000f
705 .xword 0x0000000000000000
706 .xword 0x000000000000000a
707 .xword 0x0000000000000005
708 .xword 0x0000000000000002
709 .xword 0x0000000000000004
710.align 0x100
711bit_1_data:
712 .xword 0x0000000000000001
713 .xword 0x0000000000000000
714 .xword 0x0000000000000001
715 .xword 0x0000000000000000
716
717busy_data:
718 .xword 0x0000000000000040
719 .xword 0x0000000000000000
720 .xword 0x0000000000000040
721 .xword 0x0000000000000000
722
723.align 0x100
724data_xword:
725 .xword 0x000000faaa000000
726 .xword 0x000000fcad000000
727 .xword 0x000000f555000000
728 .xword 0x000000fabc000000
729
730.end
731