Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / error / l2 / n2_err_l2_csrs.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: n2_err_l2_csrs.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 MAIN_PAGE_NUCLEUS_ALSO
39#define MAIN_PAGE_HV_ALSO
40
41!#ifdef L20
42
43#define L2_ERR_ENB_REG0 0xAA00000000
44#define L2_ERR_ENB_REG1 0xBA00000000
45#define L2_ERR_STAT_REG0 0xAB00000000
46#define L2_ERR_STAT_REG1 0xBB00000000
47#define L2_ERR_ADDR_REG0 0xAC00000000
48#define L2_ERR_ADDR_REG1 0xBC00000000
49#define L2_ERR_NDT_REG0 0xAE00000000
50#define L2_ERR_NDT_REG1 0xBE00000000
51#define L2_ERR_INJ_REG0 0xAD00000000
52#define L2_ERR_INJ_REG1 0xBD00000000
53
54!#endif
55
56
57#include "hboot.s"
58#include "asi_s.h"
59#include "err_defines.h"
60
61
62.text
63.global main
64
65
66main:
67 ta T_CHANGE_HPRIV
68
69L2_enb_0:
70 setx 0xffffffffffffffff, %l0, %g7
71 setx L2_ERR_ENB_REG0, %l3, %g5
72
73 stx %g7, [%g5]
74 ldx [%g5], %i0
75
76 set 0x7, %o0 ! <2:0> = Address -> (RW)
77 cmp %i0, %o0
78 bne %xcc, test_fail
79 nop
80
81 stx %i0, [%g5]
82
83L2_stat_0:
84 setx L2_ERR_STAT_REG0, %l3, %g5
85
86 stx %g7, [%g5]
87 ldx [%g5], %i0
88
89 setx 0x3fc000000fffffff, %12, %o0 ! <61:54> , <27:0> = Address -> (RW)
90 cmp %i0, %o0
91 bne %xcc, test_fail
92 nop
93
94
95
96L2_err_addr_reg_0:
97 ! setx 0x00000000ffffffff, %l1, %g6
98 setx L2_ERR_ADDR_REG0, %l3, %g5
99
100 ldx [%g5], %i1
101
102 stx %g7, [%g5]
103 ldx [%g5], %i0
104
105 stx %i1, [%g5] ! store back original value
106
107 setx 0xfffffffff0, %l3, %o0 ! <39:4> = Address -> (RW)
108 cmp %i0, %o0
109 bne %xcc, test_fail
110 nop
111
112
113L2_ndt_0:
114! setx 0xffffffffffffffff, %l2, %g8
115 setx L2_ERR_NDT_REG0, %l3, %g5
116
117 stx %g7, [%g5]
118 ldx [%g5], %i0
119
120 setx 0x43ffffffffff0, %13, %o0 ! <2:0> = Address -> (RW)
121 cmp %i0, %o0
122 bne %xcc, test_fail
123 nop
124
125
126L2_inj_0:
127 setx L2_ERR_INJ_REG0, %l3, %g5
128
129 ldx [%g5], %i1
130
131 stx %g7, [%g5]
132 ldx [%g5], %i0
133
134 set 0x3, %o0 ! <2:0> = Address -> (RW)
135 cmp %i0, %o0
136 bne %xcc, test_fail
137 nop
138
139 stx %i1, [%g5] ! store back original value
140
141ba test_pass
142nop
143
144
145/******************************************************
146 * Exit code
147 *******************************************************/
148
149test_pass:
150EXIT_GOOD
151
152test_fail:
153EXIT_BAD
154
155