Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: ncu_ssi_rw_b2b.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_PAGE_NUCLEUS_ALSO | |
39 | #define MAIN_PAGE_HV_ALSO | |
40 | ||
41 | #include "hboot.s" | |
42 | #include "asi_s.h" | |
43 | ||
44 | #ifdef SSI_CLK_8_3 | |
45 | #define CLK_RATIO_VAL 0x03 | |
46 | #else | |
47 | #ifdef SSI_CLK_8_2 | |
48 | #define CLK_RATIO_VAL 0x02 | |
49 | #else | |
50 | #ifdef SSI_CLK_4 | |
51 | #define CLK_RATIO_VAL 0x01 | |
52 | #else | |
53 | #define CLK_RATIO_VAL 0x00 | |
54 | #endif | |
55 | #endif | |
56 | #endif | |
57 | ||
58 | .text | |
59 | .global main | |
60 | ||
61 | main: | |
62 | ta T_CHANGE_HPRIV | |
63 | ||
64 | get_th_id: | |
65 | ta T_RD_THID | |
66 | ||
67 | cmp %o1,0x0 | |
68 | bne test_fail | |
69 | nop | |
70 | ||
71 | !Verify clock ratio counter value | |
72 | wr %g0,ASI_CMP_CORE,%asi | |
73 | setx 0x8000003040,%g7,%g1 | |
74 | ldx [%g1],%g2 | |
75 | setx CLK_RATIO_VAL,%g7,%g1 | |
76 | cmp %g2,%g1 | |
77 | bne test_fail | |
78 | nop | |
79 | ||
80 | !Read words from the SSI interface | |
81 | setx 0x000000fff0000000,%g7,%g1 | |
82 | set 0x10,%g2 | |
83 | loop1: | |
84 | lduw [%g1],%g3 | |
85 | add %g1,4,%g1 | |
86 | sub %g2,1,%g2 | |
87 | cmp %g2,%g0 | |
88 | bne loop1 | |
89 | nop | |
90 | ||
91 | !Read same word multiple times | |
92 | setx 0x000000fff0000000,%g7,%g1 | |
93 | set 0x10,%g3 | |
94 | loop2: | |
95 | lduw [%g1],%g7 | |
96 | lduw [%g1],%g2 | |
97 | cmp %g7,%g2 | |
98 | bne %xcc,test_fail | |
99 | nop | |
100 | add %g1,4,%g1 | |
101 | sub %g3,1,%g3 | |
102 | cmp %g3,%g0 | |
103 | bne loop2 | |
104 | nop | |
105 | ||
106 | !RAW hazards | |
107 | setx 0x000000ffffff0000,%g7,%g1 | |
108 | setx data_raw,%g7,%g2 | |
109 | set 0x10,%g3 | |
110 | loop3: | |
111 | lduw [%g2],%g4 | |
112 | stw %g4,[%g1] | |
113 | lduw [%g1],%g5 | |
114 | cmp %g4,%g5 | |
115 | bne %xcc,test_fail | |
116 | nop | |
117 | add %g1,4,%g1 | |
118 | add %g2,4,%g2 | |
119 | sub %g3,1,%g3 | |
120 | cmp %g3,%g0 | |
121 | bne loop3 | |
122 | nop | |
123 | ||
124 | !WAR hazards | |
125 | setx 0x000000ffffff0100,%g7,%g1 | |
126 | setx data_war,%g7,%g2 | |
127 | set 0x10,%g3 | |
128 | loop4: | |
129 | lduw [%g1],%g4 | |
130 | stw %g0,[%g1] | |
131 | lduw [%g1],%g5 | |
132 | cmp %g5,%g0 | |
133 | bne %xcc,test_fail | |
134 | nop | |
135 | add %g1,4,%g1 | |
136 | add %g2,4,%g2 | |
137 | sub %g3,1,%g3 | |
138 | cmp %g3,%g0 | |
139 | bne loop4 | |
140 | nop | |
141 | ||
142 | !WAR hazards | |
143 | setx 0x000000ffffff0200,%g7,%g1 | |
144 | setx data_waw,%g7,%g2 | |
145 | add %g2,0x10,%g3 | |
146 | set 0x10,%g4 | |
147 | loop5: | |
148 | lduw [%g2],%g5 | |
149 | lduw [%g3],%g6 | |
150 | stw %g5,[%g1] | |
151 | stw %g6,[%g1] | |
152 | lduw [%g1],%g7 | |
153 | cmp %g7,%g6 | |
154 | bne %xcc,test_fail | |
155 | nop | |
156 | add %g1,4,%g1 | |
157 | add %g2,4,%g2 | |
158 | add %g3,4,%g3 | |
159 | sub %g4,1,%g4 | |
160 | cmp %g4,%g0 | |
161 | bne loop5 | |
162 | nop | |
163 | ||
164 | ba test_pass | |
165 | nop | |
166 | ||
167 | /****************************************************** | |
168 | * Exit code | |
169 | *******************************************************/ | |
170 | ||
171 | test_pass: | |
172 | EXIT_GOOD | |
173 | ||
174 | test_fail: | |
175 | EXIT_BAD | |
176 | ||
177 | .data | |
178 | .align 0x100 | |
179 | data_raw: | |
180 | .word 0x239232ab | |
181 | .word 0x3923badf | |
182 | .word 0x482ba83a | |
183 | .word 0xa62ed082 | |
184 | .word 0xab667bdc | |
185 | .word 0xc3923bef | |
186 | .word 0x8faa9832 | |
187 | .word 0xdea02003 | |
188 | .word 0xb202023b | |
189 | .word 0x2035723b | |
190 | .word 0x9923ced7 | |
191 | .word 0x8a29823b | |
192 | .word 0x33eeee9e | |
193 | .word 0x5beaf092 | |
194 | .word 0xbfabfe22 | |
195 | .word 0xa0aaccde | |
196 | .word 0x10a0a993 | |
197 | .word 0x02fccbef | |
198 | .word 0xbcc553f3 | |
199 | .word 0xad20833f | |
200 | .word 0xae29083a | |
201 | .word 0x92298235 | |
202 | .word 0x447034b5 | |
203 | .word 0x3c3b24fd | |
204 | .word 0xffce09df | |
205 | .word 0xf198122f | |
206 | .word 0x9fa32782 | |
207 | .word 0x6d329263 | |
208 | .word 0xeb887611 | |
209 | .word 0xda340823 | |
210 | .word 0xd3219bd7 | |
211 | .word 0xa8293200 | |
212 | ||
213 | .align 0x100 | |
214 | data_war: | |
215 | .word 0x34adde52 | |
216 | .word 0xfbacbbab | |
217 | .word 0xd82c54cc | |
218 | .word 0xa8d3bc23 | |
219 | .word 0xffffb298 | |
220 | .word 0xf2389023 | |
221 | .word 0x934dbaee | |
222 | .word 0x92ab9934 | |
223 | .word 0x4a87a542 | |
224 | .word 0x000aee01 | |
225 | .word 0x100fc52d | |
226 | .word 0x02aad3c4 | |
227 | .word 0xb3ccb66a | |
228 | .word 0xc992bbce | |
229 | .word 0xef033388 | |
230 | .word 0xad222734 | |
231 | .word 0x0330822b | |
232 | .word 0x22030b43 | |
233 | .word 0x2ffd00aa | |
234 | .word 0xeddc9dc5 | |
235 | .word 0xbbbb2b85 | |
236 | .word 0xa002bbaa | |
237 | .word 0x4332becc | |
238 | .word 0x98f2114a | |
239 | .word 0x77619992 | |
240 | .word 0x92cb9bdd | |
241 | .word 0xa00b33fe | |
242 | .word 0xdd81900c | |
243 | .word 0x977a2122 | |
244 | .word 0x0001bac5 | |
245 | .word 0x33b4237f | |
246 | .word 0x7d82293d | |
247 | ||
248 | .align 0x100 | |
249 | data_waw: | |
250 | .word 0x2876adce | |
251 | .word 0x9cb238af | |
252 | .word 0xa8820fb7 | |
253 | .word 0xaf9277cb | |
254 | .word 0x32989782 | |
255 | .word 0x987bdc43 | |
256 | .word 0xba73c0fe | |
257 | .word 0x2399dace | |
258 | .word 0x000bed00 | |
259 | .word 0x833bade2 | |
260 | .word 0x92235456 | |
261 | .word 0xbdceefda | |
262 | .word 0xcb874bcd | |
263 | .word 0x3248cbae | |
264 | .word 0x933bcf26 | |
265 | .word 0x74663bf7 | |
266 | .word 0x6cb4ed6a | |
267 | .word 0x7c7d7e7b | |
268 | .word 0x88bd255c | |
269 | .word 0x933bb265 | |
270 | .word 0x8ccba634 | |
271 | .word 0xaa433ccc | |
272 | .word 0x911000bb | |
273 | .word 0x4532bbcd | |
274 | .word 0x822b3647 | |
275 | .word 0xba7ce43e | |
276 | .word 0x09990909 | |
277 | .word 0x00000223 | |
278 | .word 0xb00000a0 | |
279 | .word 0xbbbc0073 | |
280 | .word 0x337fe887 | |
281 | .word 0x23bb3fee | |
282 | ||
283 | .end |