Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n1_false_sharing_8c_veryshort.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n1_false_sharing_8c_veryshort.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 0x1
46
47#include "hboot.s"
48
49.global main
50
51main:
52 set ITERATIONS, global_cnt_reg
53 mov %g0, my_id_reg
54
55th_fork(th_main,%l0)
56
57th_main_0:
58 add my_id_reg, 0x00, my_id_reg ! this is my ID address
59 ba go; nop
60th_main_1:
61 add my_id_reg, 0x04, my_id_reg
62 ba go; nop
63th_main_2:
64 add my_id_reg, 0x08, my_id_reg
65 ba go; nop
66th_main_3:
67 add my_id_reg, 0x0c, my_id_reg
68 ba go; nop
69th_main_4:
70 add my_id_reg, 0x10, my_id_reg
71 ba go; nop
72th_main_5:
73 add my_id_reg, 0x14, my_id_reg
74 ba go; nop
75th_main_6:
76 add my_id_reg, 0x18, my_id_reg
77 ba go; nop
78th_main_7:
79 add my_id_reg, 0x1c, my_id_reg
80 ba go; nop
81th_main_8:
82 add my_id_reg, 0x20, my_id_reg
83 ba go; nop
84th_main_9:
85 add my_id_reg, 0x24, my_id_reg
86 ba go; nop
87th_main_10:
88 add my_id_reg, 0x28, my_id_reg
89 ba go; nop
90th_main_11:
91 add my_id_reg, 0x2c, my_id_reg
92 ba go; nop
93th_main_12:
94 add my_id_reg, 0x30, my_id_reg
95 ba go; nop
96th_main_13:
97 add my_id_reg, 0x34, my_id_reg
98 ba go; nop
99th_main_14:
100 add my_id_reg, 0x38, my_id_reg
101 ba go; nop
102th_main_15:
103 add my_id_reg, 0x3c, my_id_reg
104 ba go; nop
105th_main_16:
106 add my_id_reg, 0x40, my_id_reg
107 ba go; nop
108th_main_17:
109 add my_id_reg, 0x44, my_id_reg
110 ba go; nop
111th_main_18:
112 add my_id_reg, 0x48, my_id_reg
113 ba go; nop
114th_main_19:
115 add my_id_reg, 0x4c, my_id_reg
116 ba go; nop
117th_main_20:
118 add my_id_reg, 0x50, my_id_reg
119 ba go; nop
120th_main_21:
121 add my_id_reg, 0x54, my_id_reg
122 ba go; nop
123th_main_22:
124 add my_id_reg, 0x58, my_id_reg
125 ba go; nop
126th_main_23:
127 add my_id_reg, 0x5c, my_id_reg
128 ba go; nop
129th_main_24:
130 add my_id_reg, 0x60, my_id_reg
131 ba go; nop
132th_main_25:
133 add my_id_reg, 0x64, my_id_reg
134 ba go; nop
135th_main_26:
136 add my_id_reg, 0x68, my_id_reg
137 ba go; nop
138th_main_27:
139 add my_id_reg, 0x6c, my_id_reg
140 ba go; nop
141th_main_28:
142 add my_id_reg, 0x70, my_id_reg
143 ba go; nop
144th_main_29:
145 add my_id_reg, 0x74, my_id_reg
146 ba go; nop
147th_main_30:
148 add my_id_reg, 0x78, my_id_reg
149 ba go; nop
150th_main_31:
151 add my_id_reg, 0x7c, my_id_reg
152 ba go; nop
153
154go:
155 setx protected_area, %l0, data_base_reg ! the data area
156
157 set 4, %l0 ! count
158 add my_id_reg, data_base_reg, data_base_reg
159 add my_id_reg, data_base_reg, %i1
160loop1:
161 st %i1, [data_base_reg] ! store my ID in there
162 inc %i1
163 deccc %l0
164 bne loop1 ! repeat
165 nop
166
167 dec %i1
168 ld [data_base_reg], %l1 ! read the data area
169 subcc %l1, %i1, %l1 ! should be same as i1
170 bne bad_end
171 nop
172
173check_done:
174 deccc global_cnt_reg
175 be good_end
176 nop
177 ba go
178 nop
179
180good_end:
181 ta T_GOOD_TRAP
182bad_end:
183 ta T_BAD_TRAP
184
185!==========================
186
187 .data
188.global protected_area
189protected_area:
190 .word 0xbeef
191 .skip 0x1000
192 .word 0xbeef
193
194.end