Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / cmp / ncu_unpark_by_running_rw1s.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: ncu_unpark_by_running_rw1s.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#include "hboot.s"
42#include "asi_s.h"
43
44.text
45.global main
46
47
48main:
49 ta T_CHANGE_HPRIV
50
51get_th_id:
52 ta T_RD_THID
53 wr %g0,ASI_CMP_CORE,%asi
54
55 cmp %o1,0x0
56 be t_0
57 nop
58 cmp %o1,0x3f
59 be t_63
60 nop
61
62! Just halt all other threads
63halt:
64 ba halt
65 nop
66
67t_0:
68
69! Enable/disable other threads and check status to see if
70! these threads were correctly parked/unparked
71
72 ldxa [ASI_CMP_CORE_RUNNING_STATUS]%asi, %g2
73 set 0x1,%g1
74 cmp %g2,%g1
75 bne %xcc,test_fail
76 nop
77
78 setx asi_running_rw1s_mask,%l0,%g7
79 set 0x20,%g5
80
81loop:
82 stxa %g0,[ASI_CMP_CORE_RUNNING_RW]%asi
83 call sleep
84 nop
85 ldx [%g7],%g1
86 stxa %g1,[ASI_CMP_CORE_RUNNING_W1S]%asi
87 call sleep
88 nop
89 or %g1,0x1,%g1
90
91 ldxa [ASI_CMP_CORE_RUNNING_RW]%asi, %g2
92 cmp %g1,%g2
93 bne %xcc,test_fail
94 nop
95 ldxa [ASI_CMP_CORE_RUNNING_STATUS]%asi, %g2
96 cmp %g1,%g2
97 bne %xcc,test_fail
98 nop
99
100 subcc %g5,1,%g5
101 bnz loop
102 add %g7,0x8,%g7
103
104 ba test_pass
105 nop
106
107t_63:
108 setx 0x8000000000000001,%l0,%g1
109 ldxa [ASI_CMP_CORE_RUNNING_RW]%asi, %g2
110 cmp %g1,%g2
111 bne %xcc,test_fail
112 nop
113 ldxa [ASI_CMP_CORE_RUNNING_STATUS]%asi, %g2
114 cmp %g1,%g2
115 bne %xcc,test_fail
116 nop
117
118 ba test_pass
119 nop
120
121sleep:
122 rd %tick,%l2
123 setx 0x04ff,%l0,%l1
124 add %l1,%l2,%l1
125sleep_loop:
126 rd %tick,%l2
127 cmp %l1,%l2
128 bpos %xcc,sleep_loop
129 nop
130 retl
131 nop
132
133/******************************************************
134 * Exit code
135 *******************************************************/
136
137test_pass:
138EXIT_GOOD
139
140test_fail:
141EXIT_BAD
142
143.data
144asi_running_rw1s_mask:
145 .xword 0x6849543973ffacea
146 .xword 0x5873423420976290
147 .xword 0x4876cedec243baa0
148 .xword 0x5fccafcafadeafcc
149 .xword 0x2876234524000004
150 .xword 0x123287634bcafed8
151 .xword 0x04cad5362ddcec98
152 .xword 0x00027373bced6940
153 .xword 0x68cde0de5438b098
154 .xword 0x2763245926423460
155 .xword 0x698bcade2345326a
156 .xword 0x676324c2de739290
157 .xword 0x4acedceafdbffbec
158 .xword 0x72823c3de3cfade2
159 .xword 0x7ace420789988672
160 .xword 0x1849543973ffacec
161 .xword 0x087342342097629e
162 .xword 0x6876cedec243baa0
163 .xword 0x3fccafcafadeafcc
164 .xword 0x3876234524000008
165 .xword 0x0000000000000000
166 .xword 0x5000000000000000
167 .xword 0x0040000000000000
168 .xword 0x0000200000000000
169 .xword 0x0000001000000000
170 .xword 0x0000000000000000
171 .xword 0x00000000ff000000
172 .xword 0x0000000000770000
173 .xword 0x000000000000ff00
174 .xword 0x0000000000000022
175 .xword 0x7fffffffffffffff
176 .xword 0x8000000000000000
177.end