ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
RV32IMACFDGDBCore.h
Go to the documentation of this file.
1
10#ifndef ETISS_RV32IMACFDArch_RV32IMACFDGDBCORE_H_
11#define ETISS_RV32IMACFDArch_RV32IMACFDGDBCORE_H_
12
14#include <sstream>
15
34{
35 public:
36 std::string mapRegister(unsigned index)
37 {
38 switch (index)
39 {
40 case 0:
41 return "X0"; // zero
42 case 1:
43 return "X1"; // ra
44 case 2:
45 return "X2"; // sp
46 case 3:
47 return "X3"; // gp
48 case 4:
49 return "X4"; // tp
50 case 5:
51 return "X5"; // t0
52 case 6:
53 return "X6"; // t1
54 case 7:
55 return "X7"; // t2
56 case 8:
57 return "X8"; // fp
58 case 9:
59 return "X9"; // s1
60 case 10:
61 return "X10"; // a0
62 case 11:
63 return "X11"; // a1
64 case 12:
65 return "X12"; // a2
66 case 13:
67 return "X13"; // a3
68 case 14:
69 return "X14"; // a4
70 case 15:
71 return "X15"; // a5
72 case 16:
73 return "X16"; // a6
74 case 17:
75 return "X17"; // a7
76 case 18:
77 return "X18"; // s2
78 case 19:
79 return "X19"; // s3
80 case 20:
81 return "X20"; // s4
82 case 21:
83 return "X21"; // s5
84 case 22:
85 return "X22"; // s6
86 case 23:
87 return "X23"; // s7
88 case 24:
89 return "X24"; // s8
90 case 25:
91 return "X25"; // s9
92 case 26:
93 return "X26"; // s10
94 case 27:
95 return "X27"; // s11
96 case 28:
97 return "X28"; // t3
98 case 29:
99 return "X29"; // t4
100 case 30:
101 return "X30"; // t5
102 case 31:
103 return "X31"; // t6
104 case 32:
105 return "instructionPointer"; // pc
106 case 33:
107 return "F0"; // ft0
108 case 34:
109 return "F1"; // ft1
110 case 35:
111 return "F2"; // ft2
112 case 36:
113 return "F3"; // ft3
114 case 37:
115 return "F4"; // ft4
116 case 38:
117 return "F5"; // ft5
118 case 39:
119 return "F6"; // ft6
120 case 40:
121 return "F7"; // ft7
122 case 41:
123 return "F8"; // fs0
124 case 42:
125 return "F9"; // fs1
126 case 43:
127 return "F10"; // fa0
128 case 44:
129 return "F11"; // fa1
130 case 45:
131 return "F12"; // fa2
132 case 46:
133 return "F13"; // fa3
134 case 47:
135 return "F14"; // fa4
136 case 48:
137 return "F15"; // fa5
138 case 49:
139 return "F16"; // fa6
140 case 50:
141 return "F17"; // fa7
142 case 51:
143 return "F18"; // fs2
144 case 52:
145 return "F19"; // fs3
146 case 53:
147 return "F20"; // fs4
148 case 54:
149 return "F21"; // fs5
150 case 55:
151 return "F22"; // fs6
152 case 56:
153 return "F23"; // fs7
154 case 57:
155 return "F24"; // fs8
156 case 58:
157 return "F25"; // fs9
158 case 59:
159 return "F26"; // fs10
160 case 60:
161 return "F27"; // fs11
162 case 61:
163 return "F28"; // ft8
164 case 62:
165 return "F29"; // ft9
166 case 63:
167 return "F30"; // ft10
168 case 64:
169 return "F31"; // ft11
170 case 66:
171 return "CSR1"; // fflags
172 case 67:
173 return "CSR2"; // frm
174 case 68:
175 return "CSR3"; // fcsr
176 case 3923:
177 return "CSR3858"; // marchid
178 case 3924:
179 return "CSR3859"; // mimpid
180 case 3925:
181 return "CSR3860"; // mhartid
182 case 833:
183 return "CSR768"; // mstatus
184 case 834:
185 return "CSR769"; // misa
186 case 835:
187 return "CSR770"; // medeleg
188 case 836:
189 return "CSR771"; // mideleg
190 case 837:
191 return "CSR772"; // mie
192 case 838:
193 return "CSR773"; // mtvec
194 case 839:
195 return "CSR774"; // mcounteren
196 case 897:
197 return "CSR832"; // mscratch
198 case 898:
199 return "CSR833"; // mepc
200 case 899:
201 return "CSR834"; // mcause
202 case 900:
203 return "CSR835"; // mtval
204 case 901:
205 return "CSR836"; // mip
206 case 2881:
207 return "CSR2816"; // mcycle
208 case 3009:
209 return "CSR2944"; // mcycleh
210 case 2883:
211 return "CSR2818"; // minstret
212 case 3011:
213 return "CSR2946"; // minstreth
214 case 3137:
215 return "CSR3072"; // cycle
216 case 3265:
217 return "CSR3200"; // cycleh
218 case 3138:
219 return "CSR3073"; // time
220 case 3266:
221 return "CSR3201"; // timeh
222 case 3139:
223 return "CSR3074"; // instret
224 case 3267:
225 return "CSR3202"; // instreth
226 /**************************************************************************
227 * Further register should be added here to send data over gdbserver *
228 **************************************************************************/
229 }
230 return "";
231 }
232
233 unsigned mapRegister(std::string name) { return INVALIDMAPPING; }
234
236 {
237 // Modify according to sent register number
238 return 33;
239 }
240
241 etiss::uint64 getInstructionPointer(ETISS_CPU *cpu) { return cpu->instructionPointer; }
242
244 {
245 // Modify according to RV32IMACFD manual
246 return true;
247 }
248};
249
250#endif
Generated on Tue, 11 Aug 2026 12:31:38 +0000.
unsigned mapRegister(std::string name)
returns the index of the given register name in the list of registers as defined by gdb.
unsigned mappedRegisterCount()
returns the number of registers in the gdb defined register list
etiss::uint64 getInstructionPointer(ETISS_CPU *cpu)
allows to calculate the index of the instruction to be executed for breakpoint checks.
bool isLittleEndian()
returns true if the values are expected to be little endian
std::string mapRegister(unsigned index)
the returned string identifies the register at the given index as defined by gdb.
provides to architecture dependent registers as defined by gdb
Definition GDBCore.h:39
static const unsigned INVALIDMAPPING
Definition GDBCore.h:70
basic cpu state structure needed for execution of any cpu architecture.
Definition CPU.h:51
etiss_uint64 instructionPointer
pointer to next instruction.
Definition CPU.h:54