Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n1_self_mod10.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n1_self_mod10.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 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),
53 part_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),
63 part_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 stda %d0, [%o0]ASI_BLK_P ! store good data to label0
92 membar 0x40
93 flush %o0
94 ba label0
95 nop
96
97.align 0x40
98label0:
99 ta T_BAD_TRAP ! this is overwritten by good data
100 ta T_BAD_TRAP ! BEFORE any execution
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
116 stda %d0, [%o1]ASI_BLK_P ! store good data to label1
117 membar 0x40
118 flush %o0 !
119 ba label1
120 nop
121
122.align 0x40
123label1:
124 ta T_BAD_TRAP !
125 ta T_BAD_TRAP !
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 stda %d0, [%o2]ASI_BLK_P ! store good data to label2
141 membar 0x40
142 flush %o0
143 ba label2
144 nop
145
146.align 0x40
147label2:
148 ta T_BAD_TRAP !
149 ta T_BAD_TRAP !
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 stda %d0, [%o3]ASI_BLK_P ! store good data to label3
165 membar 0x40
166 flush %o0 !
167 ba label3
168 nop
169
170.align 0x40
171label3:
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 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 stda %d0, [%o4]ASI_BLK_P
189 membar 0x40
190 flush %o0 !
191 ba label4
192 nop
193
194.align 0x40
195label4:
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 stda %d0, [%o5]ASI_BLK_P
213 membar 0x40
214 flush %o0 !
215 ba label5
216 nop
217
218.align 0x40
219label5:
220 ta T_BAD_TRAP !
221 ta T_BAD_TRAP !
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 stda %d0, [%o6]ASI_BLK_P
237 membar 0x40
238 flush %o0 !
239 ba label6
240 nop
241
242.align 0x40
243label6:
244 ta T_BAD_TRAP !
245 ta T_BAD_TRAP !
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 stda %d0, [%o7]ASI_BLK_P
261 membar 0x40
262 flush %o0 !
263 ba label7
264 nop
265
266.align 0x40
267label7:
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 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 stda %d0, [%o0]ASI_BLK_P
285 membar 0x40
286 flush %o0
287
288 stda %d16, [%o0]ASI_BLK_P ! store bad data to all labels
289 stda %d16, [%o1]ASI_BLK_P
290 stda %d16, [%o2]ASI_BLK_P
291 stda %d16, [%o3]ASI_BLK_P
292 stda %d16, [%o4]ASI_BLK_P
293 stda %d16, [%o5]ASI_BLK_P
294 stda %d16, [%o6]ASI_BLK_P
295 stda %d16, [%o7]ASI_BLK_P
296 membar 0x40
297
298 dec %l2
299 brnz,pt %l2, label0a ! and loop again
300 nop
301
302normal_end:
303 ta T_GOOD_TRAP
304bad_end:
305 ta T_BAD_TRAP
306
307
308user_text_end:
309
310/***********************************************************************
311 Test case data start
312 ***********************************************************************/
313.data
314.align 0x100
315good_data:
316
317 .word 0x01000000
318 .word 0x01000000
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
334bad_data:
335 .word 0xdeadbeef
336 .word 0xdeadbeef
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
352user_data_end: