Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / uarch / pmu / diag / dcacheMissSl3.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: dcacheMissSl3.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 STORE_VA 0xfffffffff0010000
39
40
41SECTION .RED_SEC TEXT_VA = 0xfffffffff0000000, DATA_VA = STORE_VA
42
43attr_text {
44 Name=.RED_SEC,
45 hypervisor
46}
47
48attr_data {
49 Name=.RED_SEC,
50 hypervisor
51}
52
53.text
54
55 nop;nop;nop;nop;nop;nop;nop;nop
56
57Power_On_Reset:
58 setx data_area, %g2, %g1
59 wrpr %g0, %g0, %tl
60
61
62 ! Setup a context
63 add 0xF, %g0, %g5
64 add 0x8, %g0, %g6
65 stxa %g5, [%g6] 0x21
66
67
68 !turn on ITLB
69 ldxa [%g0] 0x45, %l5
70 or 0xE, %l5, %l5
71 stxa %l5, [%g0] 0x45
72
73
74 ! Setup counter
75 set 0x1810c082, %l0 ! count D-Cache Misses
76
77 wr %l0, %g0, %pcr ! count D-Cache Misses
78 wr %g0, %g0, %pic ! zero out the counter
79
80
81 !Create the address
82 setx 0xfffffffff1004000, %o1, %o2
83
84 ! Setup a TLB Entry
85 setx 0xfffffffff100400F, %g5, %g6 ! Data for Tag Access
86 setx 0x800000FFF0100000, %g5, %g7 ! Data for Data-Access
87
88 add 0x30, %g0, %o0
89 stxa %g6, [%o0] 0x50 ! Write tag access
90 stxa %g7, [%g0] 0x55
91
92 ! Setup a TLB Entry
93 setx 0xfffffffff010600F, %g5, %g6 ! Data for Tag Access
94 setx 0x800000FFF0106000, %g5, %g7 ! Data for Data-Access
95
96 add 0x30, %g0, %o0
97 add 0x10, %g0, %o1
98
99 stxa %g6, [%o0] 0x50 ! Write tag access
100 stxa %g7, [%o1] 0x55
101
102
103 ! Setup a DTLB Entry
104 setx 0x1000F, %g5, %g6 ! Data for Tag Access
105 setx 0x8000003FF0010440, %g5, %g7 ! Data for Data-Access
106
107 add 0x30, %g0, %o0
108 add 0x10, %g0, %i0
109 stxa %g6, [%o0] 0x58 ! Write tag access
110 stxa %g7, [%i0] 0x5D
111
112 ! Setup a DTLB Entry
113 setx 0x2000F, %g5, %g6 ! Data for Tag Access
114 setx 0x8000004FF0010440, %g5, %g7 ! Data for Data-Access
115
116 add 0x30, %g0, %o0
117 add 0x20, %g0, %i0
118 stxa %g6, [%o0] 0x58 ! Write tag access
119 stxa %g7, [%i0] 0x5D
120
121 ! Setup a DTLB Entry
122 setx 0x3000F, %g5, %g6 ! Data for Tag Access
123 setx 0x8000005FF0010440, %g5, %g7 ! Data for Data-Access
124
125 add 0x30, %g0, %o0
126 add 0x30, %g0, %i0
127 stxa %g6, [%o0] 0x58 ! Write tag access
128 stxa %g7, [%i0] 0x5D
129
130 ! Setup a DTLB Entry
131 setx 0x4000F, %g5, %g6 ! Data for Tag Access
132 setx 0x8000006FF0010440, %g5, %g7 ! Data for Data-Access
133
134 add 0x30, %g0, %o0
135 add 0x40, %g0, %i0
136 stxa %g6, [%o0] 0x58 ! Write tag access
137 stxa %g7, [%i0] 0x5D
138
139 ! Setup a DTLB Entry
140 setx 0x5000F, %g5, %g6 ! Data for Tag Access
141 setx 0x8000007FF0010440, %g5, %g7 ! Data for Data-Access
142
143 add 0x30, %g0, %o0
144 add 0x50, %g0, %i0
145 stxa %g6, [%o0] 0x58 ! Write tag access
146 stxa %g7, [%i0] 0x5D
147
148
149! rdhpr %hpstate, %g1
150! andn %g1, 0x4, %g2
151
152 jmp %o2
153 wrhpr %g0, %g0, %hpstate
154
155bad_trap:
156 ba bad_trap
157 nop
158 nop
159
160
161
162
163.data
164data_area:
165.xword 0x0
166.xword 0x0
167
168
169SECTION .NEWSECTION TEXT_VA = 0xfffffffff0104000
170attr_text {
171 RA = 0xfff0100000,
172 PA = 0xfff0100000,
173 Name=.NEWSECTION,
174 notsb
175}
176.text
177 setx 0xfffffffff0106000, %l0, %l1
178
179 setx 0x10000, %g4, %g3
180 ldx [%g3], %g2
181 setx 0x20000, %g4, %g3
182 ldx [%g3], %g2
183 setx 0x30000, %g4, %g3
184 ldx [%g3], %g2
185 setx 0x40000, %g4, %g3
186 ldx [%g3], %g2
187 setx 0x50000, %g4, %g3
188 ldx [%g3], %g2
189
190
191 jmp %l1
192 nop
193
194
195SECTION .NEWSECTION1 TEXT_VA = 0xfffffffff0106000
196attr_text {
197 RA = 0xfff0106000,
198 PA = 0xfff0106000,
199 Name=.NEWSECTION1,
200 notsb
201}
202.text
203 setx 0x123456789ABCDEF, %l2, %l3
204 setx 0x500000005, %g4, %g5
205 rd %pic, %g2 ! load the current pic value into %g2
206 xor %g2, %g5, %g6
207 brnz %g6, bad_trap
208 nop
209
210good_trap:
211 ba good_trap
212 nop
213 nop
214
215bad_trap:
216 ba bad_trap
217 nop
218 nop
219
220
221