Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / isa3 / isa3_privileged_action.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: isa3_privileged_action.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 RETURN_POINTER %l7
39#define TRAP_COUNTER %o0
40#define COUNTER %o1
41
42#define PRIVILEGED_ACTION_ENABLE
43
44
45#define H_HT0_Privileged_Action_0x37
46#define My_HT0_Privileged_Action_0x37 \
47 add TRAP_COUNTER, 0x1, TRAP_COUNTER ; \
48 wrpr RETURN_POINTER, 0, %tnpc ; \
49 done ; \
50 nop ;
51
52
53#include "hboot.s"
54
55.text
56.global main
57
58main: /* test begin */
59 clr TRAP_COUNTER
60 set 0x1, COUNTER
61 setx asi_inst_mask_reg, %i0, RETURN_POINTER
62 ldxa [%g0]ASI_LSU_CONTROL, %g1
63 ba abnormal_end
64asi_inst_mask_reg:
65 cmp TRAP_COUNTER, COUNTER
66 bne abnormal_end
67 add COUNTER, 0x1, COUNTER
68 setx asi_icache_instr, %i0, RETURN_POINTER
69 ldxa [%g0]ASI_INST_MASK, %g1
70 ba abnormal_end
71asi_icache_instr:
72 cmp TRAP_COUNTER, COUNTER
73 bne abnormal_end
74 add COUNTER, 0x1, COUNTER
75 setx asi_icache_tag, %i0, RETURN_POINTER
76 ldxa [%g0]ASI_ICACHE_INSTR, %g1
77 ba abnormal_end
78asi_icache_tag:
79 cmp TRAP_COUNTER, COUNTER
80 bne abnormal_end
81 add COUNTER, 0x1, COUNTER
82 setx asi_lsu_diag_reg, %i0, RETURN_POINTER
83 ldxa [%g0]ASI_ICACHE_TAG, %g1
84 ba abnormal_end
85asi_lsu_diag_reg:
86 cmp TRAP_COUNTER, COUNTER
87 bne abnormal_end
88 add COUNTER, 0x1, COUNTER
89 setx asi_dcache_data, %i0, RETURN_POINTER
90 ldxa [%g0]ASI_LSU_DIAG, %g1
91 ba abnormal_end
92asi_dcache_data:
93 cmp TRAP_COUNTER, COUNTER
94 bne abnormal_end
95 add COUNTER, 0x1, COUNTER
96 setx asi_dcache_tag, %i0, RETURN_POINTER
97 ldxa [%g0]ASI_DCACHE_DATA, %g1
98 ba abnormal_end
99asi_dcache_tag:
100 cmp TRAP_COUNTER, COUNTER
101 bne abnormal_end
102 add COUNTER, 0x1, COUNTER
103 setx asi_sparc_bist_control, %i0, RETURN_POINTER
104 ldxa [%g0]ASI_DCACHE_TAG, %g1
105 ba abnormal_end
106asi_sparc_bist_control:
107 cmp TRAP_COUNTER, COUNTER
108 bne abnormal_end
109 add COUNTER, 0x1, COUNTER
110 setx asi_itlb_probe, %i0, RETURN_POINTER
111 ldxa [%g0]ASI_SPARC_BIST_CONTROL, %g1
112 ba abnormal_end
113asi_itlb_probe:
114 cmp TRAP_COUNTER, COUNTER
115 bne abnormal_end
116 add COUNTER, 0x1, COUNTER
117 setx asi_itlb_data_in_0, %i0, RETURN_POINTER
118 ldxa [%g0]ASI_ITLB_PROBE, %g1
119 ba abnormal_end
120asi_itlb_data_in_0:
121 cmp TRAP_COUNTER, COUNTER
122 bne abnormal_end
123 add COUNTER, 0x1, COUNTER
124 setx asi_itlb_data_in_1, %i0, RETURN_POINTER
125 ldxa [%g0]ASI_ITLB_DATA_IN, %g1
126 ba abnormal_end
127asi_itlb_data_in_1:
128 cmp TRAP_COUNTER, COUNTER
129 bne abnormal_end
130 add COUNTER, 0x1, COUNTER
131 setx asi_itlb_data_in_2, %i0, RETURN_POINTER
132 mov 0x400, %g2
133 ldxa [%g2]ASI_ITLB_DATA_IN, %g1
134 ba abnormal_end
135asi_itlb_data_in_2:
136 cmp TRAP_COUNTER, COUNTER
137 bne abnormal_end
138 add COUNTER, 0x1, COUNTER
139 setx asi_itlb_data_in_3, %i0, RETURN_POINTER
140 mov 0x800, %g2
141 ldxa [%g2]ASI_ITLB_DATA_IN, %g1
142 ba abnormal_end
143asi_itlb_data_in_3:
144 cmp TRAP_COUNTER, COUNTER
145 bne abnormal_end
146 add COUNTER, 0x1, COUNTER
147 setx asi_itlb_data_access_reg, %i0, RETURN_POINTER
148 mov 0xc00, %g2
149 ldxa [%g2]ASI_ITLB_DATA_IN, %g1
150 ba abnormal_end
151asi_itlb_data_access_reg:
152 cmp TRAP_COUNTER, COUNTER
153 bne abnormal_end
154 add COUNTER, 0x1, COUNTER
155 setx asi_itlb_tag_read_reg, %i0, RETURN_POINTER
156 ldxa [%g0]ASI_ITLB_DATA_ACCESS_REG, %g1
157 ba abnormal_end
158asi_itlb_tag_read_reg:
159 cmp TRAP_COUNTER, COUNTER
160 bne abnormal_end
161 add COUNTER, 0x1, COUNTER
162 setx asi_ifu_control, %i0, RETURN_POINTER
163 ldxa [%g0]ASI_ITLB_TAG_READ_REG, %g1
164 ba abnormal_end
165asi_ifu_control:
166 cmp TRAP_COUNTER, COUNTER
167 bne abnormal_end
168 add COUNTER, 0x1, COUNTER
169 setx asi_ifu_control_value, %i0, RETURN_POINTER
170 ldxa [%g0]ASI_IFU_CONTROL, %g1
171 ba abnormal_end
172asi_ifu_control_value:
173 cmp TRAP_COUNTER, COUNTER
174 bne abnormal_end
175 add COUNTER, 0x1, COUNTER
176 setx normal_end, %i0, RETURN_POINTER
177 set 0x90, %g2
178 ldxa [%g2]ASI_IFU_CONTROL, %g1
179 ba abnormal_end
180normal_end:
181 cmp TRAP_COUNTER, COUNTER
182 bne abnormal_end
183 nop
184 EXIT_GOOD
185
186abnormal_end:
187 EXIT_BAD
188
189
190
191
192
193
194