ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
RV64IMACFDGDBCore.h
Go to the documentation of this file.
1
10#ifndef ETISS_RV64IMACFDArch_RV64IMACFDGDBCORE_H_
11#define ETISS_RV64IMACFDArch_RV64IMACFDGDBCORE_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 2883:
210 return "CSR2818"; // minstret
211 case 3137:
212 return "CSR3072"; // cycle
213 case 3138:
214 return "CSR3073"; // time
215 case 3139:
216 return "CSR3074"; // instret
217 /**************************************************************************
218 * Further register should be added here to send data over gdbserver *
219 **************************************************************************/
220 }
221 return "";
222 }
223
224 unsigned mapRegister(std::string name) { return INVALIDMAPPING; }
225
227 {
228 // Modify according to sent register number
229 return 33;
230 }
231
232 etiss::uint64 getInstructionPointer(ETISS_CPU *cpu) { return cpu->instructionPointer; }
233
235 {
236 // Modify according to RV64IMACFD manual
237 return true;
238 }
239};
240
241#endif
Generated on Wed, 28 Oct 2026 07:20:58 +0000.
bool isLittleEndian()
returns true if the values are expected to be little endian
unsigned mappedRegisterCount()
returns the number of registers in the gdb defined register list
unsigned mapRegister(std::string name)
returns the index of the given register name in the list of registers as defined by gdb.
std::string mapRegister(unsigned index)
the returned string identifies the register at the given index as defined by gdb.
etiss::uint64 getInstructionPointer(ETISS_CPU *cpu)
allows to calculate the index of the instruction to be executed for breakpoint checks.
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