Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n2_false_sharing3.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n2_false_sharing3.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 data_base_reg %o1
39#define to_reg %o2
40#define my_id_reg %o3
41#define test_reg %o4
42#define global_cnt_reg %o5
43
44#define TIMEOUT 0x1000
45#define ITERATIONS 0x2
46
47#include "hboot.s"
48
49.global main
50
51main:
52
53 set ITERATIONS, global_cnt_reg
54 mov %g0, my_id_reg
55
56th_fork(th_main,%l0)
57
58th_main_0:
59 add my_id_reg, 0x00, my_id_reg ! this is my ID address
60 ba go
61 nop
62
63th_main_1:
64 mov 0xff, %g5
65iloop1:
66 call leafRoutine
67 nop
68 deccc %g5
69 bnz iloop1
70 nop
71
72th_main_2:
73 mov 0xff, %g5
74iloop2:
75 call leafRoutine
76 nop
77 deccc %g5
78 bnz iloop2
79 nop
80
81
82
83th_main_3:
84 add my_id_reg, 0x0c, my_id_reg
85 ba go
86 nop
87
88th_main_4:
89 add my_id_reg, 0x10, my_id_reg
90 ba go
91 nop
92
93th_main_5:
94 add my_id_reg, 0x14, my_id_reg
95 ba go
96 nop
97
98th_main_6:
99 add my_id_reg, 0x18, my_id_reg
100 ba go
101 nop
102
103th_main_7:
104 add my_id_reg, 0x1c, my_id_reg
105 ba go
106 nop
107
108th_main_8:
109 add my_id_reg, 0x20, my_id_reg
110 ba go
111 nop
112th_main_9:
113 mov 0xff, %g5
114iloop3:
115 call leafRoutine
116 nop
117 deccc %g5
118 bnz iloop3
119 nop
120th_main_10:
121 mov 0xff, %g5
122iloop4:
123 call leafRoutine
124 nop
125 deccc %g5
126 bnz iloop4
127 nop
128th_main_11:
129 add my_id_reg, 0x24, my_id_reg
130 ba go
131 nop
132th_main_12:
133 add my_id_reg, 0x24, my_id_reg
134 ba go
135 nop
136th_main_13:
137 add my_id_reg, 0x24, my_id_reg
138 ba go
139 nop
140th_main_14:
141 add my_id_reg, 0x24, my_id_reg
142 ba go
143 nop
144th_main_15:
145 add my_id_reg, 0x24, my_id_reg
146 ba go
147 nop
148
149go:
150 setx protected_area, %l0, data_base_reg ! the data area
151
152 set 100, %l0
153 add my_id_reg, data_base_reg, data_base_reg
154 add my_id_reg, data_base_reg, %i1
155loop1:
156 st %i1, [data_base_reg] ! store my ID in there
157 add data_base_reg, 0x40, data_base_reg ! increment the address
158 add %i1, 1, %i1
159 deccc %l0
160 bne loop1 ! repeat
161 nop
162
163 set 100, %l0
164loop2:
165 sub data_base_reg, 0x40, data_base_reg
166 sub %i1, 1, %i1
167 ld [data_base_reg], %l1 ! read the data area
168 subcc %l1, %i1, %l1 ! should be same as i1
169 bne bad_end
170 nop
171 deccc %l0 ! repeat
172 bne loop2
173 nop
174
175check_done: ! check if done
176 deccc global_cnt_reg
177 be good_end
178 nop
179 ba go
180 nop
181
182good_end:
183 ta T_GOOD_TRAP
184bad_end:
185 ta T_BAD_TRAP
186
187!==========================
188
189 .data
190.global protected_area
191protected_area:
192 .word 0xbeef
193.global leafRoutine
194leafRoutine:
195 .word 0x81c3e008
196 .word 0x0100000
197 .skip 0x1000
198 .word 0xbeef
199
200.end