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