Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / n2 / lib / ras / bin / N2_RasState.py
CommitLineData
920dae64
AT
1# ========== Copyright Header Begin ==========================================
2#
3# OpenSPARC T2 Processor File: N2_RasState.py
4# Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
5# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6#
7# The above named program is free software; you can redistribute it and/or
8# modify it under the terms of the GNU General Public
9# License version 2 as published by the Free Software Foundation.
10#
11# The above named program is distributed in the hope that it will be
12# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public
17# License along with this work; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19#
20# ========== Copyright Header End ============================================
21
22import sys
23
24from SS_State import *
25from SS_Setup import *
26
27setup = setups[sys.argv[1]]
28
29
30n2_ras_regs=[
31
32SS_RasCtrReg('N2','icache_addressing_fields',0,0,0,64,
33 [
34 ('rsvd0' , 0, 1,RO,0),
35 ('instr' , 2, 4,RW,0),
36 ('sets' , 5, 10,RW,0),
37 ('tag' ,11,39,RW,0),
38 ],
39 [ 'static const uint32_t ICACHE_WAYS = 8;\n'
40 ' static const uint32_t N2_ICACHE_LINE_SIZE = 32'])
41, SS_RasCtrReg('N2','icache_diag_tag_addr_fields',0,0,0,64,
42 [
43 ('rsvd0' , 0,5,RO,0),
44 ('index' ,6,11,RW,0),
45 ('way' ,12,14,RW,0),
46 ('vb_err_en ' ,15,15,RW,0),
47 ('perren' ,16,16,RW,0),
48 ])
49, SS_RasCtrReg('N2','icache_instr_st_reg',0,0,0,64,
50 [
51 ('instr' , 0, 31,RW,0),
52 ('perrinj' , 32,32,RW,0)
53 ],
54 [ 'static const uint32_t ICACHE_DATA_SIZE_MASK = 0x1ffffffff'])
55, SS_RasCtrReg('N2','icache_tag_ld_reg',0,0,0,64,
56 [
57 ('valid0' ,0,0,RW,0),
58 ('valid1' ,1,1,RW,0),
59 ('tag' ,2,30,RW,0),
60 ('tag_parity' ,31,31,RW,0),
61 ],
62 [ 'static const uint32_t ICACHE_TAG_SIZE_MASK = 0xffffffff'])
63, SS_RasCtrReg('N2','icache_diag_instr_addr_fields',0,0,0,64,
64 [
65 ('rsvd0' , 0, 2,RO,0),
66 ('word' ,3,5,RW,0),
67 ('index' ,6,11,RW,0),
68 ('way' ,12,14,RW,0),
69 ])
70, SS_RasCtrReg('N2','dcache_addressing_fields',0,0,0,64,
71 [
72 ('data' , 0,3,RW,0),
73 ('sets' ,4,10,RW,0),
74 ('tag' ,11,39,RW,0),
75 ],['static const uint32_t DCACHE_WAYS = 4;\n'
76 ' static const uint32_t N2_DCACHE_LINE_SIZE = 16'])
77, SS_RasCtrReg('N2','dcache_diag_data_st_addr_fields',0,0,0,64,
78 [
79 ('rsvd0' , 0, 2,RO,0),
80 ('doubleword' , 3, 3,RW,0),
81 ('index' , 4, 10,RW,0),
82 ('way' , 11, 12,RW,0),
83 ('perrmask' , 13, 20,RW,0),
84 ])
85, SS_RasCtrReg('N2','dcache_diag_data_ld_addr_fields',0,0,0,64,
86 [
87 ('rsvd0' , 0, 2,RO,0),
88 ('doubleword' , 3, 3,RW,0),
89 ('index' , 4, 10,RW,0),
90 ('way' , 11, 12,RW,0),
91 ('data_notparity' , 13, 13,RW,0),
92 ])
93, SS_RasCtrReg('N2','dcache_diag_tag_addr_fields',0,0,0,64,
94 [
95 ('rsvd0' , 0, 3,RO,0),
96 ('index' , 4, 10,RW,0),
97 ('way' , 11, 12,RW,0),
98 ('perren' , 13, 13,RW,0),
99 ('vb_err_en' , 14, 14,RW,0),
100 ])
101, SS_RasCtrReg('N2','dcache_tag_ld_reg',0,0,0,64,
102 [
103 ('valid0' ,0,0,RW,0),
104 ('valid1' ,1,1,RW,0),
105 ('tag' ,2,30,RW,0),
106 ('tag_parity' ,31,31,RW,0),
107 ],
108 [ 'static const uint32_t DCACHE_TAG_SIZE_MASK = 0xffffffff'])
109, SS_RasCtrReg('N2','dcache_data_st_reg',0,0,0,64,
110 [
111 ('data' , 0, 63,RW,0),
112 ],
113 [ 'static const uint64_t DCACHE_DATA_SIZE_MASK = 0xffffffffffffffff'])
114, SS_RasCtrReg('N2','stb_access_da_reg',0,0,0,64,
115 [
116 ('data' , 0, 63,RW,0),
117 ])
118, SS_RasCtrReg('N2','stb_access_addr_fields',0,0,0,64,
119 [
120 ('rsvd0' ,0,2,RO,0),
121 ('entry' ,3,5,RW,0),
122 ('field' ,6,8,RW,0),
123 ('rsvd1' ,9,63,RO,0),
124 ],
125 [ 'static const uint_t DATA_FIELD = 0;\n'
126 ' static const uint_t ECC_FIELD = 1;\n'
127 ' static const uint_t CNTRL_PARITY_FIELD = 2;\n'
128 ' static const uint_t CAM_FIELD = 3;\n'
129 ' static const uint_t STB_POINTER_FIELD = 4'])
130, SS_RasCtrReg('N2','stb_access_cam_reg',0,0,0,64,
131 [
132 ('rsvd0' ,0,2,RO,0),
133 ('pa' ,3,39,RW,0),
134 ('bm_asi' ,40,47,RW,0),
135 ('rsvd1' ,48,63,RO,0),
136 ])
137, SS_RasCtrReg('N2','stb_access_ctl_reg',0,0,0,64,
138 [
139 ('control' ,0,2,RW,0),
140 ('c_p' ,3,3,RW,0),
141 ('rsvd0' ,4,63,RO,0),
142 ],
143 [ 'const static uint_t CTL_USER = 0;\n'
144 ' const static uint_t CTL_PRIV = 3;\n'
145 ' const static uint_t CTL_HPRIV = 5'])
146, SS_RasCtrReg('N2','stb_access_ecc_reg',0,0,0,64,
147 [
148 ('ecc_even' ,0,6,RW,0),
149 ('ecc_odd' ,7,13,RW,0),
150 ('rsvd0' ,14,63,RO,0),
151 ])
152]
153
154h_file=open('%s' % sys.argv[2],'w')
155
156h_base_name = sys.argv[2].split('/')[-1].split('.')[0]
157
158h_file.write('#ifndef __'+h_base_name+'_h__\n')
159h_file.write('#define __'+h_base_name+'_h__\n')
160h_file.write('\n')
161#h_file.write('#include "SS_AsiCtrReg.h"\n')
162h_file.write('\n')
163
164for reg in n2_ras_regs:
165 reg.cpp(h_file)
166
167h_file.write('\n')
168h_file.write('#endif\n')
169h_file.write('\n')
170
171h_file.close()
172
173
174
175
176