Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n1_self_mod9.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n1_self_mod9.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_BASE_DATA_ADDR 0x160000
39#define MAIN_BASE_TEXT_ADDR 0x150000
40#define MAIN_BASE_DATA_ADDR_RA 0x100160000
41#define MAIN_BASE_TEXT_ADDR_RA 0x100150000
42
43#define ASI_BLK_P 0xf0
44
45#define USER_PAGE_CUSTOM_MAP
46#include "hboot.s"
47
48SECTION .MAIN TEXT_VA=0x150000, DATA_VA=0x160000
49
50attr_text {
51 Name = .MAIN,
52 VA=MAIN_BASE_TEXT_ADDR,
53 RA=MAIN_BASE_TEXT_ADDR_RA,
54 PA=ra2pa(MAIN_BASE_TEXT_ADDR_RA,0),
55part_0_ctx_nonzero_tsb_config_0,
56 TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0,
57 TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
58 TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_EP=1, TTE_P=0, TTE_W=1
59 }
60attr_data {
61 Name = .MAIN,
62 VA=MAIN_BASE_DATA_ADDR,
63 RA=MAIN_BASE_DATA_ADDR_RA,
64 PA=ra2pa(MAIN_BASE_DATA_ADDR_RA,0),
65part_0_ctx_nonzero_tsb_config_0,
66 TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0,
67 TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
68 TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1
69 }
70
71.text
72.global main
73main:
74
75 wr %g0, 0x4, %fprs /* make sure fef is 1 */
76 setx good_data, %l0,%o0
77 setx bad_data, %l0,%o1
78 ldda [%o0]ASI_BLK_P, %d0 ! good data contains nop-s
79 ldda [%o1]ASI_BLK_P, %d16 ! bad data contains ta T_BAD_TRAP-s
80 membar 0x40
81
82 setx label0, %l0,%o0 ! prepare the address registers
83 setx label1, %l0,%o1
84 setx label2, %l0,%o2
85 setx label3, %l0,%o3
86 setx label4, %l0,%o4
87 setx label5, %l0,%o5
88 setx label6, %l0,%o6
89 setx label7, %l0,%o7
90 setx 0x20, %l0, %l2
91
92label0a:
93 stda %d0, [%o0]ASI_BLK_P ! store good data to label0
94 membar 0x40
95 flush %o0
96 ba label0 ! go there
97 nop
98
99.align 0x40
100label0:
101 ta T_BAD_TRAP !
102 ta T_BAD_TRAP !
103 ta T_BAD_TRAP !
104 ta T_BAD_TRAP !
105 ta T_BAD_TRAP !
106 ta T_BAD_TRAP !
107 ta T_BAD_TRAP !
108 ta T_BAD_TRAP !
109 ta T_BAD_TRAP !
110 ta T_BAD_TRAP !
111 ta T_BAD_TRAP !
112 ta T_BAD_TRAP !
113 ta T_BAD_TRAP !
114 ta T_BAD_TRAP !
115 ta T_BAD_TRAP !
116 ta T_BAD_TRAP !
117
118 stda %d0, [%o1]ASI_BLK_P ! store good data to label1
119 membar 0x40
120 flush %o0 !
121 ba label1 ! go there
122 nop
123
124.align 0x40
125label1:
126 ta T_BAD_TRAP !
127 ta T_BAD_TRAP !
128 ta T_BAD_TRAP !
129 ta T_BAD_TRAP !
130 ta T_BAD_TRAP !
131 ta T_BAD_TRAP !
132 ta T_BAD_TRAP !
133 ta T_BAD_TRAP !
134 ta T_BAD_TRAP !
135 ta T_BAD_TRAP !
136 ta T_BAD_TRAP !
137 ta T_BAD_TRAP !
138 ta T_BAD_TRAP !
139 ta T_BAD_TRAP !
140 ta T_BAD_TRAP !
141 ta T_BAD_TRAP !
142 stda %d0, [%o2]ASI_BLK_P ! etc
143 membar 0x40
144 flush %o0 !
145 ba label2
146 nop
147
148.align 0x40
149label2:
150 ta T_BAD_TRAP !
151 ta T_BAD_TRAP !
152 ta T_BAD_TRAP !
153 ta T_BAD_TRAP !
154 ta T_BAD_TRAP !
155 ta T_BAD_TRAP !
156 ta T_BAD_TRAP !
157 ta T_BAD_TRAP !
158 ta T_BAD_TRAP !
159 ta T_BAD_TRAP !
160 ta T_BAD_TRAP !
161 ta T_BAD_TRAP !
162 ta T_BAD_TRAP !
163 ta T_BAD_TRAP !
164 ta T_BAD_TRAP !
165 ta T_BAD_TRAP !
166 stda %d0, [%o3]ASI_BLK_P
167 membar 0x40
168 flush %o0 !
169 ba label3
170 nop
171
172.align 0x40
173label3:
174 ta T_BAD_TRAP !
175 ta T_BAD_TRAP !
176 ta T_BAD_TRAP !
177 ta T_BAD_TRAP !
178 ta T_BAD_TRAP !
179 ta T_BAD_TRAP !
180 ta T_BAD_TRAP !
181 ta T_BAD_TRAP !
182 ta T_BAD_TRAP !
183 ta T_BAD_TRAP !
184 ta T_BAD_TRAP !
185 ta T_BAD_TRAP !
186 ta T_BAD_TRAP !
187 ta T_BAD_TRAP !
188 ta T_BAD_TRAP !
189 ta T_BAD_TRAP !
190 stda %d0, [%o4]ASI_BLK_P
191 membar 0x40
192 flush %o0 !
193 ba label4
194 nop
195
196.align 0x40
197label4:
198 ta T_BAD_TRAP !
199 ta T_BAD_TRAP !
200 ta T_BAD_TRAP !
201 ta T_BAD_TRAP !
202 ta T_BAD_TRAP !
203 ta T_BAD_TRAP !
204 ta T_BAD_TRAP !
205 ta T_BAD_TRAP !
206 ta T_BAD_TRAP !
207 ta T_BAD_TRAP !
208 ta T_BAD_TRAP !
209 ta T_BAD_TRAP !
210 ta T_BAD_TRAP !
211 ta T_BAD_TRAP !
212 ta T_BAD_TRAP !
213 ta T_BAD_TRAP !
214 stda %d0, [%o5]ASI_BLK_P
215 membar 0x40
216 flush %o0 !
217 ba label5
218 nop
219
220.align 0x40
221label5:
222 ta T_BAD_TRAP !
223 ta T_BAD_TRAP !
224 ta T_BAD_TRAP !
225 ta T_BAD_TRAP !
226 ta T_BAD_TRAP !
227 ta T_BAD_TRAP !
228 ta T_BAD_TRAP !
229 ta T_BAD_TRAP !
230 ta T_BAD_TRAP !
231 ta T_BAD_TRAP !
232 ta T_BAD_TRAP !
233 ta T_BAD_TRAP !
234 ta T_BAD_TRAP !
235 ta T_BAD_TRAP !
236 ta T_BAD_TRAP !
237 ta T_BAD_TRAP !
238 stda %d0, [%o6]ASI_BLK_P
239 membar 0x40
240 flush %o0 !
241 ba label6
242 nop
243
244.align 0x40
245label6:
246 ta T_BAD_TRAP !
247 ta T_BAD_TRAP !
248 ta T_BAD_TRAP !
249 ta T_BAD_TRAP !
250 ta T_BAD_TRAP !
251 ta T_BAD_TRAP !
252 ta T_BAD_TRAP !
253 ta T_BAD_TRAP !
254 ta T_BAD_TRAP !
255 ta T_BAD_TRAP !
256 ta T_BAD_TRAP !
257 ta T_BAD_TRAP !
258 ta T_BAD_TRAP !
259 ta T_BAD_TRAP !
260 ta T_BAD_TRAP !
261 ta T_BAD_TRAP !
262 stda %d0, [%o7]ASI_BLK_P
263 membar 0x40
264 flush %o0 !
265 ba label7
266 nop
267
268.align 0x40
269label7:
270 ta T_BAD_TRAP !
271 ta T_BAD_TRAP !
272 ta T_BAD_TRAP !
273 ta T_BAD_TRAP !
274 ta T_BAD_TRAP !
275 ta T_BAD_TRAP !
276 ta T_BAD_TRAP !
277 ta T_BAD_TRAP !
278 ta T_BAD_TRAP !
279 ta T_BAD_TRAP !
280 ta T_BAD_TRAP !
281 ta T_BAD_TRAP !
282 ta T_BAD_TRAP !
283 ta T_BAD_TRAP !
284 ta T_BAD_TRAP !
285 ta T_BAD_TRAP !
286 stda %d0, [%o0]ASI_BLK_P
287 membar 0x40
288 flush %o0 !
289
290 stda %d16, [%o0]ASI_BLK_P ! now store bad data everywhere
291 stda %d16, [%o1]ASI_BLK_P
292 stda %d16, [%o2]ASI_BLK_P
293 stda %d16, [%o3]ASI_BLK_P
294 stda %d16, [%o4]ASI_BLK_P
295 stda %d16, [%o5]ASI_BLK_P
296 stda %d16, [%o6]ASI_BLK_P
297 stda %d16, [%o7]ASI_BLK_P
298 membar 0x40
299
300 dec %l2 ! and loop
301 brnz,pt %l2, label0a
302 nop
303
304normal_end:
305 ta T_GOOD_TRAP
306bad_end:
307 ta T_BAD_TRAP
308
309
310user_text_end:
311
312/***********************************************************************
313 Test case data start
314 ***********************************************************************/
315.data
316.align 0x100
317good_data:
318
319 .word 0x01000000
320 .word 0x01000000
321 .word 0x01000000
322 .word 0x01000000
323 .word 0x01000000
324 .word 0x01000000
325 .word 0x01000000
326 .word 0x01000000
327 .word 0x01000000
328 .word 0x01000000
329 .word 0x01000000
330 .word 0x01000000
331 .word 0x01000000
332 .word 0x01000000
333 .word 0x01000000
334 .word 0x01000000
335
336bad_data:
337 .word 0xdeadbeef
338 .word 0xdeadbeef
339 .word 0xdeadbeef
340 .word 0xdeadbeef
341 .word 0xdeadbeef
342 .word 0xdeadbeef
343 .word 0xdeadbeef
344 .word 0xdeadbeef
345 .word 0xdeadbeef
346 .word 0xdeadbeef
347 .word 0xdeadbeef
348 .word 0xdeadbeef
349 .word 0xdeadbeef
350 .word 0xdeadbeef
351 .word 0xdeadbeef
352 .word 0xdeadbeef
353
354user_data_end: