Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n1_false_sharing_vershort.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n1_false_sharing_vershort.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.global protected_area
51
52main:
53
54 set ITERATIONS, global_cnt_reg
55 mov %g0, my_id_reg
56
57th_fork(th_main,%l0)
58
59th_main_0:
60 add my_id_reg, 0x00, my_id_reg ! this is my ID address
61 ba go
62 nop
63
64th_main_1:
65 add my_id_reg, 0x04, my_id_reg
66 ba go
67 nop
68
69
70th_main_2:
71 add my_id_reg, 0x08, my_id_reg
72 ba go
73 nop
74
75th_main_3:
76 add my_id_reg, 0x0c, my_id_reg
77 ba go
78 nop
79
80th_main_4:
81 add my_id_reg, 0x10, my_id_reg
82 ba go
83 nop
84
85th_main_5:
86 add my_id_reg, 0x14, my_id_reg
87 ba go
88 nop
89
90th_main_6:
91 add my_id_reg, 0x18, my_id_reg
92 ba go
93 nop
94
95th_main_7:
96 add my_id_reg, 0x1c, my_id_reg
97 ba go
98 nop
99
100go:
101 setx protected_area, %l0, data_base_reg ! the data area
102
103 set 4, %l0 ! count
104 add my_id_reg, data_base_reg, data_base_reg
105 add my_id_reg, data_base_reg, %i1
106 ld [data_base_reg], %l1 ! read the data area
107loop1:
108 st %i1, [data_base_reg] ! store my ID in there
109 add data_base_reg, 0x20, data_base_reg ! increment the address
110 add %i1, 1, %i1
111 deccc %l0
112 bne loop1 ! repeat
113 nop
114
115 set 4, %l0
116loop2:
117 ld [data_base_reg], %l1 ! read the data area
118 deccc %l0 ! repeat
119 bne loop2
120 nop
121
122check_done:
123 deccc global_cnt_reg
124 be good_end
125 nop
126 ba go
127 nop
128
129good_end:
130 ta T_GOOD_TRAP
131bad_end:
132 ta T_BAD_TRAP
133
134!==========================================================
135
136 .data
137protected_area:
138 .word 0xbeef
139 .skip 0x1000
140 .word 0xbeef
141
142.end