Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n1_self_mod109.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n1_self_mod109.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
44#define ASI_BLK_P 0xf0
45
46#define USER_PAGE_CUSTOM_MAP
47#include "hboot.s"
48
49SECTION .MAIN TEXT_VA=0x150000, DATA_VA=0x160000
50
51attr_text {
52 Name = .MAIN,
53 VA=MAIN_BASE_TEXT_ADDR,
54 RA=MAIN_BASE_TEXT_ADDR_RA,
55 PA=ra2pa(MAIN_BASE_TEXT_ADDR_RA,0),
56 part_0_ctx_nonzero_tsb_config_0,
57 TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0,
58 TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
59 TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_EP=1, TTE_P=0, TTE_W=1
60 }
61attr_data {
62 Name = .MAIN,
63 VA=MAIN_BASE_DATA_ADDR,
64 RA=MAIN_BASE_DATA_ADDR_RA,
65 PA=ra2pa(MAIN_BASE_DATA_ADDR_RA,0),
66 part_0_ctx_nonzero_tsb_config_0,
67 TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0,
68 TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
69 TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1
70 }
71
72.text
73.global main
74main:
75
76 wr %g0, 0x4, %fprs /* make sure fef is 1 */
77 setx good_data, %l0,%o0
78 setx bad_data, %l0,%o1
79 ldda [%o0]ASI_BLK_P, %d0 ! good data contains nop-s
80 ldda [%o1]ASI_BLK_P, %d16 ! bad data contains ta T_BAD_TRAP-s
81 membar 0x40
82
83 setx label0, %l0,%o0 ! prepare the address registers
84 setx label1, %l0,%o1
85 setx label2, %l0,%o2
86 setx label3, %l0,%o3
87 setx label4, %l0,%o4
88 setx label5, %l0,%o5
89 setx label6, %l0,%o6
90 setx label7, %l0,%o7
91 setx 0x20, %l0, %l2
92
93label0a:
94 stda %d0, [%o0]ASI_BLK_P ! store good data to label0
95 membar 0x40
96 flush %o0
97 ba label0 ! go there
98 nop
99
100.align 0x40
101label0:
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 ta T_BAD_TRAP !
118
119 ldda [%o0]ASI_BLK_P, %d16
120 ldda [%o1]ASI_BLK_P, %d16
121 ld [%o1 + 0x10], %i2
122 ld [%o1 + 0x20], %i2
123 ld [%o1 + 0x30], %i2
124 stda %d0, [%o1]ASI_BLK_P ! store good data to label1
125 membar 0x40
126 flush %o0 !
127 ba label1 ! go there
128 nop
129
130.align 0x40
131label1:
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 ta T_BAD_TRAP !
143 ta T_BAD_TRAP !
144 ta T_BAD_TRAP !
145 ta T_BAD_TRAP !
146 ta T_BAD_TRAP !
147 ta T_BAD_TRAP !
148
149 ldda [%o0]ASI_BLK_P, %d16
150 ldda [%o1]ASI_BLK_P, %d16
151 ld [%o2], %i2
152 ld [%o2 + 0x10], %i2
153 ld [%o2 + 0x20], %i2
154 ld [%o2 + 0x30], %i2
155 stda %d0, [%o2]ASI_BLK_P ! etc
156 membar 0x40
157 flush %o0 !
158 ba label2
159 nop
160
161.align 0x40
162label2:
163 ta T_BAD_TRAP !
164 ta T_BAD_TRAP !
165 ta T_BAD_TRAP !
166 ta T_BAD_TRAP !
167 ta T_BAD_TRAP !
168 ta T_BAD_TRAP !
169 ta T_BAD_TRAP !
170 ta T_BAD_TRAP !
171 ta T_BAD_TRAP !
172 ta T_BAD_TRAP !
173 ta T_BAD_TRAP !
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
180 ldda [%o0]ASI_BLK_P, %d16
181 ldda [%o1]ASI_BLK_P, %d16
182 ldda [%o2]ASI_BLK_P, %d16
183 ld [%o3], %i2
184 ld [%o3 + 0x10], %i2
185 ld [%o3 + 0x20], %i2
186 ld [%o3 + 0x30], %i2
187 stda %d0, [%o3]ASI_BLK_P
188 membar 0x40
189 flush %o0 !
190 ba label3
191 nop
192
193.align 0x40
194label3:
195 ta T_BAD_TRAP !
196 ta T_BAD_TRAP !
197 ta T_BAD_TRAP !
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
212 ldda [%o0]ASI_BLK_P, %d16
213 ldda [%o1]ASI_BLK_P, %d16
214 ldda [%o2]ASI_BLK_P, %d16
215 ldda [%o3]ASI_BLK_P, %d16
216 ld [%o4], %i2
217 ld [%o4 + 0x10], %i2
218 ld [%o4 + 0x20], %i2
219 ld [%o4 + 0x30], %i2
220 stda %d0, [%o4]ASI_BLK_P
221 membar 0x40
222 flush %o0 !
223 ba label4
224 nop
225
226.align 0x40
227label4:
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 ta T_BAD_TRAP !
239 ta T_BAD_TRAP !
240 ta T_BAD_TRAP !
241 ta T_BAD_TRAP !
242 ta T_BAD_TRAP !
243 ta T_BAD_TRAP !
244
245 ldda [%o0]ASI_BLK_P, %d16
246 ldda [%o1]ASI_BLK_P, %d16
247 ldda [%o2]ASI_BLK_P, %d16
248 ldda [%o3]ASI_BLK_P, %d16
249 ldda [%o4]ASI_BLK_P, %d16
250 ld [%o5], %i2
251 ld [%o5 + 0x10], %i2
252 ld [%o5 + 0x20], %i2
253 ld [%o5 + 0x30], %i2
254 stda %d0, [%o5]ASI_BLK_P
255 membar 0x40
256 flush %o0 !
257 ba label5
258 nop
259
260.align 0x40
261label5:
262 ta T_BAD_TRAP !
263 ta T_BAD_TRAP !
264 ta T_BAD_TRAP !
265 ta T_BAD_TRAP !
266 ta T_BAD_TRAP !
267 ta T_BAD_TRAP !
268 ta T_BAD_TRAP !
269 ta T_BAD_TRAP !
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
279 ldda [%o0]ASI_BLK_P, %d16
280 ldda [%o1]ASI_BLK_P, %d16
281 ldda [%o2]ASI_BLK_P, %d16
282 ldda [%o3]ASI_BLK_P, %d16
283 ldda [%o4]ASI_BLK_P, %d16
284 ldda [%o5]ASI_BLK_P, %d16
285 ld [%o6], %i2
286 ld [%o6 + 0x10], %i2
287 ld [%o6 + 0x20], %i2
288 ld [%o6 + 0x30], %i2
289 stda %d0, [%o6]ASI_BLK_P
290 membar 0x40
291 flush %o0 !
292 ba label6
293 nop
294
295.align 0x40
296label6:
297 ta T_BAD_TRAP !
298 ta T_BAD_TRAP !
299 ta T_BAD_TRAP !
300 ta T_BAD_TRAP !
301 ta T_BAD_TRAP !
302 ta T_BAD_TRAP !
303 ta T_BAD_TRAP !
304 ta T_BAD_TRAP !
305 ta T_BAD_TRAP !
306 ta T_BAD_TRAP !
307 ta T_BAD_TRAP !
308 ta T_BAD_TRAP !
309 ta T_BAD_TRAP !
310 ta T_BAD_TRAP !
311 ta T_BAD_TRAP !
312 ta T_BAD_TRAP !
313
314 ldda [%o0]ASI_BLK_P, %d16
315 ldda [%o1]ASI_BLK_P, %d16
316 ldda [%o2]ASI_BLK_P, %d16
317 ldda [%o3]ASI_BLK_P, %d16
318 ldda [%o4]ASI_BLK_P, %d16
319 ldda [%o5]ASI_BLK_P, %d16
320 ldda [%o6]ASI_BLK_P, %d16
321 ld [%o7], %i2
322 ld [%o7 + 0x10], %i2
323 ld [%o7 + 0x20], %i2
324 ld [%o7 + 0x30], %i2
325 stda %d0, [%o7]ASI_BLK_P
326 membar 0x40
327 flush %o0 !
328 ba label7
329 nop
330
331.align 0x40
332label7:
333 ta T_BAD_TRAP !
334 ta T_BAD_TRAP !
335 ta T_BAD_TRAP !
336 ta T_BAD_TRAP !
337 ta T_BAD_TRAP !
338 ta T_BAD_TRAP !
339 ta T_BAD_TRAP !
340 ta T_BAD_TRAP !
341 ta T_BAD_TRAP !
342 ta T_BAD_TRAP !
343 ta T_BAD_TRAP !
344 ta T_BAD_TRAP !
345 ta T_BAD_TRAP !
346 ta T_BAD_TRAP !
347 ta T_BAD_TRAP !
348 ta T_BAD_TRAP !
349
350 ld [%o0], %i2
351 ld [%o0 + 0x10], %i2
352 ld [%o0 + 0x20], %i2
353 ld [%o0 + 0x30], %i2
354 stda %d0, [%o0]ASI_BLK_P
355 membar 0x40
356 flush %o0 !
357
358 ld [%o0], %i2
359 ld [%o0 + 0x10], %i2
360 ld [%o0 + 0x20], %i2
361 ld [%o0 + 0x30], %i2
362 ld [%o1], %i2
363 ld [%o1 + 0x10], %i2
364 ld [%o1 + 0x20], %i2
365 ld [%o1 + 0x30], %i2
366 ld [%o2], %i2
367 ld [%o2 + 0x10], %i2
368 ld [%o2 + 0x20], %i2
369 ld [%o2 + 0x30], %i2
370 ld [%o3], %i2
371 ld [%o3 + 0x10], %i2
372 ld [%o3 + 0x20], %i2
373 ld [%o3 + 0x30], %i2
374! ld [%o4], %i2
375! ld [%o4 + 0x10], %i2
376 ld [%o4 + 0x20], %i2
377 ld [%o4 + 0x30], %i2
378 ld [%o5], %i2
379 ld [%o5 + 0x10], %i2
380 ld [%o5 + 0x20], %i2
381! ld [%o5 + 0x30], %i2
382! ld [%o6], %i2
383 ld [%o6 + 0x10], %i2
384! ld [%o6 + 0x20], %i2
385 ld [%o6 + 0x30], %i2
386 ld [%o7], %i2
387 ld [%o7 + 0x10], %i2
388! ld [%o7 + 0x20], %i2
389 ld [%o7 + 0x30], %i2
390 stda %d16, [%o0]ASI_BLK_P ! now store bad data everywhere
391 stda %d16, [%o1]ASI_BLK_P
392 stda %d16, [%o2]ASI_BLK_P
393 stda %d16, [%o3]ASI_BLK_P
394 stda %d16, [%o4]ASI_BLK_P
395 stda %d16, [%o5]ASI_BLK_P
396 stda %d16, [%o6]ASI_BLK_P
397 stda %d16, [%o7]ASI_BLK_P
398 membar 0x40
399
400 dec %l2 ! and loop
401 brnz,pt %l2, label0a
402 nop
403
404normal_end:
405 ta T_GOOD_TRAP
406bad_end:
407 ta T_BAD_TRAP
408
409
410user_text_end:
411
412/***********************************************************************
413 Test case data start
414 ***********************************************************************/
415.data
416.align 0x100
417good_data:
418
419 .word 0x01000000
420 .word 0x01000000
421 .word 0x01000000
422 .word 0x01000000
423 .word 0x01000000
424 .word 0x01000000
425 .word 0x01000000
426 .word 0x01000000
427 .word 0x01000000
428 .word 0x01000000
429 .word 0x01000000
430 .word 0x01000000
431 .word 0x01000000
432 .word 0x01000000
433 .word 0x01000000
434 .word 0x01000000
435
436bad_data:
437 .word 0xdeadbeef
438 .word 0xdeadbeef
439 .word 0xdeadbeef
440 .word 0xdeadbeef
441 .word 0xdeadbeef
442 .word 0xdeadbeef
443 .word 0xdeadbeef
444 .word 0xdeadbeef
445 .word 0xdeadbeef
446 .word 0xdeadbeef
447 .word 0xdeadbeef
448 .word 0xdeadbeef
449 .word 0xdeadbeef
450 .word 0xdeadbeef
451 .word 0xdeadbeef
452 .word 0xdeadbeef
453
454user_data_end: