Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / exu / fgu_ecc_inj_error_n2.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: fgu_ecc_inj_error_n2.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 H_HT0_Internal_Processor_Error_0x29 My_Internal_Processor_Error_Trap
39
40#define MAIN_PAGE_HV_ALSO
41#define ASI_DMMU 0x58
42#define ASI_SEI 0x43
43#define ASI_SES 0x4C
44
45#include "hboot.s"
46
47.text
48.global main
49.global My_Internal_Processor_Error_Trap
50
51!include "err_defines_n2.h"
52
53.align 64
54
55main:
56
57 ta T_CHANGE_HPRIV
58
59! Sparc Error Injection Register should power up 0
60 ldxa [%g0] ASI_SEI, %l1
61 cmp %l1, 0
62 bne test_fail
63 nop
64
65! New Stuff
66
67setx 0x0f0d0f0f, %i0, %i3
68setx 0x0f0d0f0f, %i0, %i4
69
70
71!enable cerer.bit_52
72
73setx 0x10, %g0, %g1 ! VA for pscce 12.7.1
74setx 0x18, %g0, %g2 ! VA for ceter 12.7.2
75
76set_pscce_bit52:
77setx 0x0004000000000000, %l0, %l2
78stxa %l2, [%g0+%g1] ASI_SES
79ldxa [%g0+%g1] ASI_SES, %l6
80
81set_ceter_bit62:
82setx 0x4000000000000000, %l0, %l3
83stxa %l3, [%g0+%g2] ASI_SES !enable ceter.pscce 12.7.2
84ldxa [%g0+%g2] ASI_SES, %l7
85
86enable_err_inj_reg:
87setx 0x0000000081000001, %i0, %l4 ! Enable error injection
88setx 0x0000000000000000, %i0, %l5 ! Enable error injection
89stxa %l4, [%g0] ASI_SEI !write_asi_err_inject_reg pg:12.7.9
90ldxa [%g0] ASI_SEI, %l6
91
92execute_instr_with_bad_ecc:
93fadds %f3, %f4, %f5
94fadds %f0, %f0, %f0
95
96stxa %l5, [%g0] ASI_SEI !turn off error inject
97!stxa %l5, [%g0+%g1] ASI_SES
98!stxa %l5, [%g0+%g2] ASI_SES
99
100
101fadds %f5, %f2, %f7
102fadds %f0, %f0, %f0
103fadds %f0, %f0, %f0
104fadds %f0, %f0, %f0
105fadds %f0, %f0, %f0
106fadds %f0, %f0, %f0
107fadds %f0, %f0, %f0
108fadds %f0, %f0, %f0
109fadds %f5, %f2, %f7
110
111
112!add %i3, %i4, %i5 ! <= shd cause an error to be injected
113!add %i5, %i4, %i2 ! <= err shd be detected
114
115
116 ba test_fail
117 nop
118
119
120My_Internal_Processor_Error_Trap:
121
122setx 0x10, %g0, %g1 ! VA for pscce 12.7.1
123setx 0x18, %g0, %g2 ! VA for ceter 12.7.2
124setx 0x20, %g0, %g3 ! VA for ceter 12.7.4.2
125
126!Check status registers
127ldxa [%g0+%g2] ASI_DMMU, %l6
128ldxa [%g0+%g3] ASI_DMMU, %l7
129
130setx 0x0000000000000004, %o0, %o6
131cmp %o6, %l6
132bne test_fail
133setx 0x0000000000001045, %o0, %o7
134cmp %o7, %l7
135bne test_fail
136
137 ba test_pass
138 nop
139
140/*******************************************************
141 * Exit code
142 *******************************************************/
143
144test_pass:
145
146
147
148ta T_GOOD_TRAP
149
150test_fail:
151ta T_BAD_TRAP
152
153