Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n1_self_mod207.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n1_self_mod207.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),
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 setx label0, %l0,%o0
74 setx label1, %l0,%o1
75 setx label2, %l0,%o2
76 setx label3, %l0,%o3
77 setx label4, %l0,%o4
78 setx label5, %l0,%o5
79 setx label6, %l0,%o6
80 setx label7, %l0,%o7
81 setx 0x01000000, %l0, %i0 ! nop
82 setx 0xdeadbeef, %l0, %i1 ! well, you know this one.
83 setx 0x20, %l0, %l2
84
85label0a:
86 ld [%o0], %i2
87 st %i0, [%o0] ! store a nop to label0
88 flush %o0
89label0:
90 ta T_BAD_TRAP !
91 ld [%o1], %i2
92 mov %i0, %i2
93 st %o1, [%o1] ! store a nop to label1
94 cas [%o1], %o1, %i2 ! store a nop to label1
95 flush %o0 !
96 nop
97label1:
98 ta T_BAD_TRAP !
99 ld [%o2], %i2
100 mov %i0, %i2
101 st %o2, [%o2] ! store a nop to label1
102 cas [%o2], %o2, %i2 ! store a nop to label1
103 flush %o0 !
104 nop
105 nop
106label2:
107 ta T_BAD_TRAP !
108 ld [%o3], %i2
109 mov %i0, %i2
110 st %o3, [%o3] ! store a nop to label1
111 cas [%o3], %o3, %i2 ! store a nop to label1
112 flush %o0 !
113 nop
114 nop
115 nop
116label3:
117 ta T_BAD_TRAP !
118 ld [%o4], %i2
119 st %i0, [%o4] !
120 mov %i0, %i2
121 st %o4, [%o4] ! store a nop to label1
122 cas [%o4], %o4, %i2 ! store a nop to label1
123 nop
124 nop
125 nop
126 nop
127 nop
128 nop
129 nop
130 nop
131 nop
132 nop
133label4:
134 ta T_BAD_TRAP !
135 ld [%o5], %i2
136 mov %i0, %i2
137 st %o5, [%o5] ! store a nop to label1
138 cas [%o5], %o5, %i2 ! store a nop to label1
139 flush %o0 !
140 nop
141 nop
142 nop
143 nop
144 nop
145label5:
146 ta T_BAD_TRAP !
147 ld [%o6], %i2
148 mov %i0, %i2
149 st %o6, [%o6] ! store a nop to label1
150 cas [%o6], %o6, %i2 ! store a nop to label1
151 flush %o0 !
152 nop
153 nop
154 nop
155 nop
156 nop
157 nop
158
159label6:
160 ta T_BAD_TRAP !
161 ld [%o7], %i2
162 mov %i0, %i2
163 st %o7, [%o7] ! store a nop to label1
164 cas [%o7], %o7, %i2 ! store a nop to label1
165 flush %o0 !
166 nop
167 nop
168 nop
169 nop
170 nop
171 nop
172 nop
173
174label7:
175 ta T_BAD_TRAP !
176 ld [%o0], %i2
177 mov %i0, %i2
178 st %o0, [%o0] ! store a nop to label1
179 cas [%o0], %o0, %i2 ! store a nop to label1
180 flush %o0 !
181
182 ! now put some bad data
183 mov %i1, %i2
184 st %o0, [%o0] !
185 cas [%o0], %o0, %i2
186 mov %i1, %i2
187 st %o0, [%o1]
188 cas [%o1], %o0, %i2
189 mov %i1, %i2
190 st %o0, [%o2]
191 cas [%o2], %o0, %i2
192 mov %i1, %i2
193 st %o0, [%o3]
194 cas [%o3], %o0, %i2
195 mov %i1, %i2
196 st %o0, [%o4]
197 cas [%o4], %o0, %i2
198 mov %i1, %i2
199 st %o0, [%o5]
200 cas [%o5], %o0, %i2
201 mov %i1, %i2
202 st %o0, [%o6]
203 cas [%o6], %o0, %i2
204 mov %i1, %i2
205 st %o0, [%o7]
206 cas [%o7], %o0, %i2
207
208 dec %l2 ! and loop again.
209 brnz,pt %l2, label0a
210 nop
211
212normal_end:
213 ta T_GOOD_TRAP
214bad_end:
215 ta T_BAD_TRAP
216
217
218user_text_end:
219
220/***********************************************************************
221 Test case data start
222 ***********************************************************************/
223.data
224user_data_start:
225 .word 0x0
226user_data_end: