Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n1_self_mod110.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n1_self_mod110.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#define ASI_BLK_P 0xf0
43#define USER_PAGE_CUSTOM_MAP
44#include "hboot.s"
45
46SECTION .MAIN TEXT_VA=0x150000, DATA_VA=0x160000
47
48attr_text {
49 Name = .MAIN,
50 VA=MAIN_BASE_TEXT_ADDR,
51 RA=MAIN_BASE_TEXT_ADDR_RA,
52 PA=ra2pa(MAIN_BASE_TEXT_ADDR_RA,0),
53part_0_ctx_nonzero_tsb_config_0,
54 TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0,
55 TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
56 TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_EP=1, TTE_P=0, TTE_W=1
57 }
58attr_data {
59 Name = .MAIN,
60 VA=MAIN_BASE_DATA_ADDR,
61 RA=MAIN_BASE_DATA_ADDR_RA,
62 PA=ra2pa(MAIN_BASE_DATA_ADDR_RA,0),
63part_0_ctx_nonzero_tsb_config_0,
64 TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0,
65 TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
66 TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1
67 }
68
69.text
70.global main
71main:
72
73 wr %g0, 0x4, %fprs /* make sure fef is 1 */
74 setx good_data, %l0,%o0 ! prepare good and bad data
75 setx bad_data, %l0,%o1 !
76 ldda [%o0]ASI_BLK_P, %d0 ! in d0 and d16
77 ldda [%o1]ASI_BLK_P, %d16
78 membar 0x40
79
80 setx label0, %l0,%o0 ! prepare address registers
81 setx label1, %l0,%o1
82 setx label2, %l0,%o2
83 setx label3, %l0,%o3
84 setx label4, %l0,%o4
85 setx label5, %l0,%o5
86 setx label6, %l0,%o6
87 setx label7, %l0,%o7
88 setx 0x20, %l0, %l2
89
90label0a:
91 ld [%o0], %i2
92 ld [%o0 +0x10], %i2
93 ld [%o0 + 0x20], %i2
94 ld [%o0 + 0x30], %i2
95 stda %d0, [%o0]ASI_BLK_P ! store good data to label0
96 membar 0x40
97 flush %o0
98 ba label0
99 nop
100
101.align 0x40
102label0:
103 ta T_BAD_TRAP ! this is overwritten by good data
104 ta T_BAD_TRAP ! BEFORE any execution
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 ta T_BAD_TRAP !
119
120 ldda [%o0]ASI_BLK_P, %d16
121 ld [%o1], %i2
122 ld [%o1 +0x10], %i2
123 ld [%o1 + 0x20], %i2
124 ld [%o1 + 0x30], %i2
125 stda %d0, [%o1]ASI_BLK_P ! store good data to label1
126 membar 0x40
127 flush %o0 !
128 ba label1
129 nop
130
131.align 0x40
132label1:
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 ta T_BAD_TRAP !
149
150 ldda [%o0]ASI_BLK_P, %d16
151 ldda [%o1]ASI_BLK_P, %d16
152 ld [%o2], %i2
153 ld [%o2 +0x10], %i2
154 ld [%o2 + 0x20], %i2
155 ld [%o2 + 0x30], %i2
156 stda %d0, [%o2]ASI_BLK_P ! store good data to label2
157 membar 0x40
158 flush %o0
159 ba label2
160 nop
161
162.align 0x40
163label2:
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 ta T_BAD_TRAP !
180
181 ldda [%o0]ASI_BLK_P, %d16
182 ldda [%o1]ASI_BLK_P, %d16
183 ldda [%o2]ASI_BLK_P, %d16
184 ld [%o3], %i2
185 ld [%o3 +0x10], %i2
186 ld [%o3 + 0x20], %i2
187 ld [%o3 + 0x30], %i2
188 stda %d0, [%o3]ASI_BLK_P ! store good data to label3
189 membar 0x40
190 flush %o0 !
191 ba label3
192 nop
193
194.align 0x40
195label3:
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 ta T_BAD_TRAP !
212
213 ldda [%o0]ASI_BLK_P, %d16
214 ldda [%o1]ASI_BLK_P, %d16
215 ldda [%o2]ASI_BLK_P, %d16
216 ldda [%o3]ASI_BLK_P, %d16
217 ld [%o4], %i2
218 ld [%o4 +0x10], %i2
219 ld [%o4 + 0x20], %i2
220 ld [%o4 + 0x30], %i2
221 stda %d0, [%o4]ASI_BLK_P
222 membar 0x40
223 flush %o0 !
224 ba label4
225 nop
226
227.align 0x40
228label4:
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 ta T_BAD_TRAP !
245
246 ldda [%o0]ASI_BLK_P, %d16
247 ldda [%o1]ASI_BLK_P, %d16
248 ldda [%o2]ASI_BLK_P, %d16
249 ldda [%o3]ASI_BLK_P, %d16
250 ldda [%o4]ASI_BLK_P, %d16
251 ld [%o5], %i2
252 ld [%o5 +0x10], %i2
253 ld [%o5 + 0x20], %i2
254 ld [%o5 + 0x30], %i2
255 stda %d0, [%o5]ASI_BLK_P
256 membar 0x40
257 flush %o0 !
258 ba label5
259 nop
260
261.align 0x40
262label5:
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 ta T_BAD_TRAP !
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 ldda [%o0]ASI_BLK_P, %d16
314 ldda [%o1]ASI_BLK_P, %d16
315 ldda [%o2]ASI_BLK_P, %d16
316 ldda [%o3]ASI_BLK_P, %d16
317 ldda [%o4]ASI_BLK_P, %d16
318 ldda [%o5]ASI_BLK_P, %d16
319 ldda [%o6]ASI_BLK_P, %d16
320 ld [%o7], %i2
321 ld [%o7 +0x10], %i2
322 ld [%o7 + 0x20], %i2
323 ld [%o7 + 0x30], %i2
324 stda %d0, [%o7]ASI_BLK_P
325 membar 0x40
326 flush %o0 !
327 ba label7
328 nop
329
330.align 0x40
331label7:
332 ta T_BAD_TRAP !
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 ld [%o0], %i2
349 ld [%o0 +0x10], %i2
350 ld [%o0 + 0x20], %i2
351 ld [%o0 + 0x30], %i2
352 stda %d0, [%o0]ASI_BLK_P
353 membar 0x40
354 flush %o0
355
356! ld [%o0], %i2
357 ld [%o0 +0x10], %i2 ! some random loads of the Istream
358 ld [%o0 + 0x20], %i2
359 ld [%o0 + 0x30], %i2
360 ld [%o1], %i2
361! ld [%o1 +0x10], %i2
362 ld [%o1 + 0x20], %i2
363 ld [%o1 + 0x30], %i2
364 ld [%o2], %i2
365 ld [%o2 +0x10], %i2
366! ld [%o2 + 0x20], %i2
367 ld [%o2 + 0x30], %i2
368 ld [%o3], %i2
369 ld [%o3 +0x10], %i2
370 ld [%o3 + 0x20], %i2
371! ld [%o3 + 0x30], %i2
372! ld [%o4], %i2
373 ld [%o4 +0x10], %i2
374 ld [%o4 + 0x20], %i2
375 ld [%o4 + 0x30], %i2
376 ld [%o5], %i2
377! ld [%o5 +0x10], %i2
378 ld [%o5 + 0x20], %i2
379 ld [%o5 + 0x30], %i2
380 ld [%o6], %i2
381 ld [%o6 +0x10], %i2
382! ld [%o6 + 0x20], %i2
383! ld [%o6 + 0x30], %i2
384 ld [%o7], %i2
385 ld [%o7 +0x10], %i2
386! ld [%o7 + 0x20], %i2
387! ld [%o7 + 0x30], %i2
388 stda %d16, [%o0]ASI_BLK_P ! store bad data to all labels
389 stda %d16, [%o1]ASI_BLK_P
390 stda %d16, [%o2]ASI_BLK_P
391 stda %d16, [%o3]ASI_BLK_P
392 stda %d16, [%o4]ASI_BLK_P
393 stda %d16, [%o5]ASI_BLK_P
394 stda %d16, [%o6]ASI_BLK_P
395 stda %d16, [%o7]ASI_BLK_P
396 membar 0x40
397
398 dec %l2
399 brnz,pt %l2, label0a ! and loop again
400 nop
401
402normal_end:
403 ta T_GOOD_TRAP
404bad_end:
405 ta T_BAD_TRAP
406
407
408user_text_end:
409
410/***********************************************************************
411 Test case data start
412 ***********************************************************************/
413.data
414.align 0x100
415good_data:
416
417 .word 0x01000000
418 .word 0x01000000
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
434bad_data:
435 .word 0xdeadbeef
436 .word 0xdeadbeef
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
452user_data_end: