dt_constants.hh (5268:5bfc53fe60e7) dt_constants.hh (6376:eaf61ef6a8f2)
1/*
2 * Copyright (c) 2007 MIPS Technologies, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 18 unchanged lines hidden (view full) ---

27 *
28 * Authors: Jaidev Patwardhan
29 */
30
31#ifndef __ARCH_MIPS_DT_CONSTANTS_HH__
32#define __ARCH_MIPS_DT_CONSTANTS_HH__
33
34#include "arch/mips/types.hh"
1/*
2 * Copyright (c) 2007 MIPS Technologies, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 18 unchanged lines hidden (view full) ---

27 *
28 * Authors: Jaidev Patwardhan
29 */
30
31#ifndef __ARCH_MIPS_DT_CONSTANTS_HH__
32#define __ARCH_MIPS_DT_CONSTANTS_HH__
33
34#include "arch/mips/types.hh"
35#include "base/bitunion.hh"
35
36namespace MipsISA
37{
36
37namespace MipsISA
38{
38 // See the EJTAG Specification - Revision 4.10
39 // Also see PDTrace Specification - Revision 4.30
40
39
41 // Debug Register - CP0 Reg 23, Sel 0
42 const unsigned Debug_DBD = 31;
43 const unsigned Debug_DM_HI = 30;
44 const unsigned Debug_DM_LO = 30;
45 const unsigned Debug_NODCR = 29;
46 const unsigned Debug_LSNM = 28;
47 const unsigned Debug_DOZE = 27;
48 const unsigned Debug_HALT = 26;
49 const unsigned Debug_COUNTDM = 25;
50 const unsigned Debug_IBUSEP = 24;
51 const unsigned Debug_MCHECKEP = 23;
52 const unsigned Debug_CACHEEP = 22;
53 const unsigned Debug_DBUSEP = 21;
54 const unsigned Debug_IEXI_HI = 20;
55 const unsigned Debug_IEXI_LO = 20;
56 const unsigned Debug_DDBS_IMPR = 19;
57 const unsigned Debug_DDBL_IMPR = 18;
58 const unsigned Debug_EJTAGVER_2 =17;
59 const unsigned Debug_EJTAGVER_1 =16;
60 const unsigned Debug_EJTAGVER_0 =15;
61 const unsigned Debug_EJTAGVER_HI = 17;
62 const unsigned Debug_EJTAGVER_LO = 15;
63 const unsigned Debug_DEXC_CODE_HI = 14;
64 const unsigned Debug_DEXC_CODE_LO = 10;
65 const unsigned Debug_NOSST = 9;
66 const unsigned Debug_SST = 8;
67 const unsigned Debug_OFFLINE = 7;
68 const unsigned Debug_DIBIMPR = 6;
69 const unsigned Debug_DINT = 5;
70 const unsigned Debug_DIB = 4;
71 const unsigned Debug_DDBS = 3;
72 const unsigned Debug_DDBL = 2;
73 const unsigned Debug_DBp = 1;
74 const unsigned Debug_DSS = 0;
40BitUnion32(DebugReg)
41 Bitfield<31> dbd;
42 Bitfield<30> dm;
43 Bitfield<29> nodcr;
44 Bitfield<28> lsnm;
45 Bitfield<27> doze;
46 Bitfield<26> halt;
47 Bitfield<25> conutdm;
48 Bitfield<24> ibusep;
49 Bitfield<23> mcheckep;
50 Bitfield<22> cacheep;
51 Bitfield<21> dbusep;
52 Bitfield<20, 19> iexi;
53 Bitfield<19> ddbsImpr;
54 Bitfield<18> ddblImpr;
55 SubBitUnion(ejtagVer, 17, 15)
56 Bitfield<17> ejtagVer2;
57 Bitfield<16> ejtagVer1;
58 Bitfield<15> ejtagVer0;
59 EndSubBitUnion(ejtagVer)
60 Bitfield<14, 10> dexcCode;
61 Bitfield<9> nosst;
62 Bitfield<8> sst;
63 Bitfield<7> offline;
64 Bitfield<6> dibimpr;
65 Bitfield<5> dint;
66 Bitfield<4> dib;
67 Bitfield<3> ddbs;
68 Bitfield<2> ddbl;
69 Bitfield<1> dbp;
70 Bitfield<0> dss;
71EndBitUnion(DebugReg)
75
72
73BitUnion32(TraceControlReg)
74 Bitfield<31> ts;
75 Bitfield<30> ut;
76 Bitfield<27> tb;
77 Bitfield<26> io;
78 Bitfield<25> d;
79 Bitfield<24> e;
80 Bitfield<23> k;
81 Bitfield<22> s;
82 Bitfield<21> u;
83 Bitfield<20, 13> asidM;
84 Bitfield<12, 5> asid;
85 Bitfield<4> g;
86 Bitfield<3> tfcr;
87 Bitfield<2> tlsm;
88 Bitfield<1> tim;
89 Bitfield<0> on;
90EndBitUnion(TraceControlReg)
76
91
77 // TraceControl Register - CP0 Reg 23, Sel 1
78 const unsigned TraceControl_TS = 31;
79 const unsigned TraceControl_UT = 30;
80 const unsigned TraceControl_TB = 27;
81 const unsigned TraceControl_IO = 26;
82 const unsigned TraceControl_D = 25;
83 const unsigned TraceControl_E = 24;
84 const unsigned TraceControl_K = 23;
85 const unsigned TraceControl_S = 22;
86 const unsigned TraceControl_U = 21;
87 const unsigned TraceControl_ASID_M_HI = 20;
88 const unsigned TraceControl_ASID_M_LO = 13;
89 const unsigned TraceControl_ASID_HI = 12;
90 const unsigned TraceControl_ASID_LO = 5;
91 const unsigned TraceControl_G = 4;
92 const unsigned TraceControl_TFCR = 3;
93 const unsigned TraceControl_TLSM = 2;
94 const unsigned TraceControl_TIM = 1;
95 const unsigned TraceControl_ON = 0;
92BitUnion32(TraceControl2Reg)
93 Bitfield<29> cpuidv;
94 Bitfield<28, 21> cpuid;
95 Bitfield<20> tcv;
96 Bitfield<19, 12> tcnum;
97 Bitfield<11, 7> mode;
98 Bitfield<6, 5> validModes;
99 Bitfield<4> tbi;
100 Bitfield<3> tbu;
101 Bitfield<2, 0> syp;
102EndBitUnion(TraceControl2Reg)
96
103
97 // TraceControl2 Register - CP0 Reg 23, Sel 2
98 const unsigned TraceControl2_CPUIDV = 29;
99 const unsigned TraceControl2_CPUID_HI = 28;
100 const unsigned TraceControl2_CPUID_LO = 21;
101 const unsigned TraceControl2_TCV = 20;
102 const unsigned TraceControl2_TCNUM_HI = 19;
103 const unsigned TraceControl2_TCNUM_LO = 12;
104 const unsigned TraceControl2_MODE_HI = 11;
105 const unsigned TraceControl2_MODE_LO = 7;
106 const unsigned TraceControl2_VALIDMODES_HI = 6;
107 const unsigned TraceControl2_VALIDMODES_LO = 5;
108 const unsigned TraceControl2_TBI = 4;
109 const unsigned TraceControl2_TBU = 3;
110 const unsigned TraceControl2_SYP_HI = 2;
111 const unsigned TraceControl2_SYP_LO = 0;
104BitUnion32(TraceBPCReg)
105 Bitfield<31> mb;
106 Bitfield<28> e;
107 Bitfield<27> ate;
108 Bitfield<26, 24> bpc8;
109 Bitfield<23, 21> bpc7;
110 Bitfield<20, 18> bpc6;
111 Bitfield<17, 15> bpc5;
112 Bitfield<14, 12> bpc4;
113 Bitfield<11, 9> bpc3;
114 Bitfield<8, 6> bpc2;
115 Bitfield<5, 3> bpc1;
116 Bitfield<2, 0> bpc0;
117EndBitUnion(TraceBPCReg)
112
118
113 // UserTraceData Register - CP0 Reg 23, Sel 3
114 // Just holds 32-bits (or 64-bits) of data
119BitUnion32(TraceBPC2Reg)
120 Bitfield<17, 15> bpc14;
121 Bitfield<14, 12> bpc13;
122 Bitfield<11, 9> bpc12;
123 Bitfield<8, 6> bpc11;
124 Bitfield<5, 3> bpc10;
125 Bitfield<2, 0> bpc9;
126EndBitUnion(TraceBPC2Reg)
115
127
116 // TraceIBPC Register - CP0 Reg 23, Sel 4
117 const unsigned TraceIBPC_MB = 31;
118 const unsigned TraceIBPC_IE = 28;
119 const unsigned TraceIBPC_ATE = 27;
120 const unsigned TraceIBPC_IBPC8_HI = 26;
121 const unsigned TraceIBPC_IBPC8_LO = 24;
122 const unsigned TraceIBPC_IBPC7_HI = 23;
123 const unsigned TraceIBPC_IBPC7_LO = 21;
124 const unsigned TraceIBPC_IBPC6_HI = 20;
125 const unsigned TraceIBPC_IBPC6_LO = 18;
126 const unsigned TraceIBPC_IBPC5_HI = 17;
127 const unsigned TraceIBPC_IBPC5_LO = 15;
128 const unsigned TraceIBPC_IBPC4_HI = 14;
129 const unsigned TraceIBPC_IBPC4_LO = 12;
130 const unsigned TraceIBPC_IBPC3_HI = 11;
131 const unsigned TraceIBPC_IBPC3_LO = 9;
132 const unsigned TraceIBPC_IBPC2_HI = 8;
133 const unsigned TraceIBPC_IBPC2_LO = 6;
134 const unsigned TraceIBPC_IBPC1_HI = 5;
135 const unsigned TraceIBPC_IBPC1_LO = 3;
136 const unsigned TraceIBPC_IBPC0_HI = 2;
137 const unsigned TraceIBPC_IBPC0_LO = 0;
138
139
140 // TraceDBPC Register - CP0 Reg 23, Sel 5
141 const unsigned TRACEDBPC_MB = 31;
142 const unsigned TRACEDBPC_DE = 28;
143 const unsigned TRACEDBPC_ATE = 27;
144 const unsigned TRACEDBPC_DBPC8_HI = 26;
145 const unsigned TRACEDBPC_DBPC8_LO = 24;
146 const unsigned TRACEDBPC_DBPC7_HI = 23;
147 const unsigned TRACEDBPC_DBPC7_LO = 21;
148 const unsigned TRACEDBPC_DBPC6_HI = 20;
149 const unsigned TRACEDBPC_DBPC6_LO = 18;
150 const unsigned TRACEDBPC_DBPC5_HI = 17;
151 const unsigned TRACEDBPC_DBPC5_LO = 15;
152 const unsigned TRACEDBPC_DBPC4_HI = 14;
153 const unsigned TRACEDBPC_DBPC4_LO = 12;
154 const unsigned TRACEDBPC_DBPC3_HI = 11;
155 const unsigned TRACEDBPC_DBPC3_LO = 9;
156 const unsigned TRACEDBPC_DBPC2_HI = 8;
157 const unsigned TRACEDBPC_DBPC2_LO = 6;
158 const unsigned TRACEDBPC_DBPC1_HI = 5;
159 const unsigned TRACEDBPC_DBPC1_LO = 3;
160 const unsigned TRACEDBPC_DBPC0_HI = 2;
161 const unsigned TRACEDBPC_DBPC0_LO = 0;
162
163 // TraceIBPC2 - Not part of CP0, but part of TRACE
164 const unsigned TraceIBPC_IBPC14_HI = 17;
165 const unsigned TraceIBPC_IBPC14_LO = 15;
166 const unsigned TraceIBPC_IBPC13_HI = 14;
167 const unsigned TraceIBPC_IBPC13_LO = 12;
168 const unsigned TraceIBPC_IBPC12_HI = 11;
169 const unsigned TraceIBPC_IBPC12_LO = 9;
170 const unsigned TraceIBPC_IBPC11_HI = 8;
171 const unsigned TraceIBPC_IBPC11_LO = 6;
172 const unsigned TraceIBPC_IBPC10_HI = 5;
173 const unsigned TraceIBPC_IBPC10_LO = 3;
174 const unsigned TraceIBPC_IBPC9_HI = 2;
175 const unsigned TraceIBPC_IBPC9_LO = 0;
176
177
178 // TraceDBPC2 - Not part of CP0, but part of TRACE
179 const unsigned TRACEDBPC_DBPC14_HI = 17;
180 const unsigned TRACEDBPC_DBPC14_LO = 15;
181 const unsigned TRACEDBPC_DBPC13_HI = 14;
182 const unsigned TRACEDBPC_DBPC13_LO = 12;
183 const unsigned TRACEDBPC_DBPC12_HI = 11;
184 const unsigned TRACEDBPC_DBPC12_LO = 9;
185 const unsigned TRACEDBPC_DBPC11_HI = 8;
186 const unsigned TRACEDBPC_DBPC11_LO = 6;
187 const unsigned TRACEDBPC_DBPC10_HI = 5;
188 const unsigned TRACEDBPC_DBPC10_LO = 3;
189 const unsigned TRACEDBPC_DBPC9_HI = 2;
190 const unsigned TRACEDBPC_DBPC9_LO = 0;
191
192
193 // Debug Register 2 - CP0 Reg 23, Sel 6
194 const unsigned DEBUG2_PRM = 3;
195 const unsigned DEBUG2_DQ = 2;
196 const unsigned DEBUG2_TUP = 1;
197 const unsigned DEBUG2_PACO = 0;
198
199 // DEPC Register - CP0 Reg 24, Sel 0
200 // Debug Exception Program Counter
201 const unsigned DEPC_HI = 31;
202 const unsigned DEPC_LO = 0;
203
204
205
206 // DESAVE - CP0 Reg 31, Sel 0
207 // Debug Exception Save Register
208 const unsigned DESAVE_HI = 31;
209 const unsigned DESAVE_LO = 0;
210
211
212
128BitUnion32(Debug2Reg)
129 Bitfield<3> prm;
130 Bitfield<2> dq;
131 Bitfield<1> tup;
132 Bitfield<0> paco;
133EndBitUnion(Debug2Reg)
213} // namespace MipsISA
214
215#endif
134} // namespace MipsISA
135
136#endif