Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n1_false_sharing2.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n1_false_sharing2.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 sh_area1_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#define sh_area0_reg %o6
44
45#define ITERATIONS 0x10
46
47#include "hboot.s"
48
49.global main
50
51main:
52
53 wr %g0, 0x4, %fprs ! make sure fef is 1 for FP
54 set ITERATIONS, global_cnt_reg
55
56th_fork(th_main,%l0)
57
58th_main_0:
59 add %g0, 0x00, my_id_reg ! this is my ID address
60 ba go
61 nop
62
63th_main_1:
64 add %g0, 0x04, my_id_reg
65 ba go
66 nop
67
68
69th_main_2:
70 add %g0, 0x08, my_id_reg
71 ba go
72 nop
73
74th_main_3:
75 add %g0, 0x0c, my_id_reg
76 ba go
77 nop
78
79th_main_4:
80 add %g0, 0x10, my_id_reg
81 ba go
82 nop
83
84th_main_5:
85 add %g0, 0x14, my_id_reg
86 ba go
87 nop
88
89th_main_6:
90 add %g0, 0x18, my_id_reg
91 ba go
92 nop
93
94th_main_7:
95 add %g0, 0x1c, my_id_reg
96 ba go
97 nop
98
99go:
100 setx sh_area1, %l0, sh_area1_reg ! shared area1
101 setx sh_area0, %l0, sh_area0_reg ! shared area0
102 add my_id_reg, global_cnt_reg, %g1
103 st %g1, [sh_area0_reg] ! store 1
104 add my_id_reg, %g1, %g1
105 st %g1, [sh_area0_reg +8] ! store 2
106 ld [sh_area0_reg], %f14 ! read 1
107 ld [sh_area0_reg+8], %f16 ! read 2
108
109 set 0x40, %l0
110loop1:
111 st %f14, [sh_area1_reg+my_id_reg] ! store
112 add sh_area1_reg, 0x20, sh_area1_reg ! increment the address
113 st %f16, [sh_area1_reg+my_id_reg] ! store
114 add sh_area1_reg, 0x20, sh_area1_reg ! increment the address
115 deccc %l0
116 bne loop1 ! repeat
117 nop
118
119 set 0x40, %l0
120loop2:
121 sub sh_area1_reg, 0x20, sh_area1_reg
122 ld [my_id_reg+sh_area1_reg], %f0 ! read the ID
123 fcmps %fcc0, %f0, %f16 ! should be my ID
124 fbne %fcc0, bad_end
125 nop
126 sub sh_area1_reg, 0x20, sh_area1_reg
127 ld [my_id_reg+sh_area1_reg], %f0 ! read the ID
128 fcmps %fcc0, %f0, %f14 ! should be my ID
129 fbne %fcc0, bad_end
130 nop
131 deccc %l0 ! repeat
132 bne loop2
133 nop
134
135check_done:
136 deccc global_cnt_reg
137 be good_end
138 nop
139 ba go
140 nop
141
142good_end:
143 ta T_GOOD_TRAP
144bad_end:
145 ta T_BAD_TRAP
146
147!==========================
148
149
150SECTION .MY_DATA0 TEXT_VA=0xf0100000, DATA_VA=0xd0100000
151attr_data {
152 Name = .MY_DATA0,
153 VA= 0x0d0100000
154 RA= 0x1d0100000
155 PA= ra2pa(0x1d0100000,0),
156 part_0_ctx_nonzero_tsb_config_0,
157 TTE_G=1, TTE_Context=0x44, TTE_V=1, TTE_Size=0, TTE_NFO=0,
158 TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
159 TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1
160 }
161
162attr_text {
163 Name = .MY_DATA0,
164 VA= 0x0f0100000
165 RA= 0x1f0100000
166 PA= ra2pa(0x1f0100000,0),
167 part_0_ctx_nonzero_tsb_config_0,
168 TTE_G=1, TTE_Context=0x44, TTE_V=1, TTE_Size=0, TTE_NFO=0,
169 TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
170 TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1
171 }
172
173 .data
174.global sh_area1
175.global sh_area0
176sh_area0:
177 .word 0x0
178 .align 0x40
179sh_area1:
180 .word 0x1
181 .skip 0x1000
182 .word 0xbeef
183
184.end