11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 uimm += R_uimm_6.
read(ba) << 6;
36 uimm += R_uimm_2.
read(ba) << 2;
39 rs1 += R_rs1_0.
read(ba) << 0;
41 uimm += R_uimm_3.
read(ba) << 3;
48 cp.
code() = std::string(
"//CFLW\n");
51 cp.
code() +=
"etiss_coverage_count(1, 114);\n";
53 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
54 cp.
code() +=
"{ // block\n";
56 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
57 cp.
code() +=
"} // block\n";
60 cp.
code() +=
"etiss_coverage_count(1, 4951);\n";
61 cp.
code() +=
"{ // block\n";
62 cp.
code() +=
"etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] + " + std::to_string(uimm) +
"ULL;\n";
63 cp.
code() +=
"etiss_coverage_count(7, 4916, 4915, 4913, 4912, 4910, 4911, 4914);\n";
64 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
65 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
66 cp.
code() +=
"if (cpu->exception) { // conditional\n";
68 cp.
code() +=
"{ // procedure\n";
69 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
71 cp.
code() +=
"} // procedure\n";
73 cp.
code() +=
"} // conditional\n";
74 cp.
code() +=
"etiss_uint32 res = (etiss_uint32)(mem_val_0);\n";
75 cp.
code() +=
"etiss_coverage_count(4, 4923, 4922, 4920, 4919);\n";
77 cp.
code() +=
"etiss_coverage_count(1, 4950);\n";
78 cp.
code() +=
"{ // block\n";
79 cp.
code() +=
"((RV32IMACFD*)cpu)->F[" + std::to_string(rd + 8ULL) +
"ULL] = -4294967296LL | res;\n";
80 cp.
code() +=
"etiss_coverage_count(7, 4949, 4939, 4938, 4936, 4937, 4948, 4947);\n";
81 cp.
code() +=
"} // block\n";
83 cp.
code() +=
"} // block\n";
86 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
93 cp.
code() = std::string(
"//CFLW\n");
96 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
108 rd += R_rd_0.read(ba) << 0;
111 uimm += R_uimm_6.read(ba) << 6;
113 uimm += R_uimm_2.read(ba) << 2;
116 rs1 += R_rs1_0.read(ba) << 0;
118 uimm += R_uimm_3.read(ba) << 3;
122 std::stringstream ss;
124 ss <<
"cflw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | uimm=" + std::to_string(uimm) +
" | rs1=" + std::to_string(rs1) +
"]");
146 rs2 += R_rs2_0.
read(ba) << 0;
149 uimm += R_uimm_6.
read(ba) << 6;
151 uimm += R_uimm_2.
read(ba) << 2;
154 rs1 += R_rs1_0.
read(ba) << 0;
156 uimm += R_uimm_3.
read(ba) << 3;
163 cp.
code() = std::string(
"//CFSW\n");
166 cp.
code() +=
"etiss_coverage_count(1, 115);\n";
168 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
169 cp.
code() +=
"{ // block\n";
171 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
172 cp.
code() +=
"} // block\n";
175 cp.
code() +=
"etiss_coverage_count(1, 4972);\n";
176 cp.
code() +=
"{ // block\n";
177 cp.
code() +=
"etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] + " + std::to_string(uimm) +
"ULL;\n";
178 cp.
code() +=
"etiss_coverage_count(7, 4960, 4959, 4957, 4956, 4954, 4955, 4958);\n";
179 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
180 cp.
code() +=
"mem_val_0 = (etiss_uint32)(((RV32IMACFD*)cpu)->F[" + std::to_string(rs2 + 8ULL) +
"ULL]);\n";
181 cp.
code() +=
"etiss_coverage_count(8, 4971, 4963, 4962, 4970, 4968, 4967, 4965, 4966);\n";
182 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
183 cp.
code() +=
"if (cpu->exception) { // conditional\n";
185 cp.
code() +=
"{ // procedure\n";
186 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
188 cp.
code() +=
"} // procedure\n";
190 cp.
code() +=
"} // conditional\n";
191 cp.
code() +=
"} // block\n";
194 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
201 cp.
code() = std::string(
"//CFSW\n");
204 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
216 rs2 += R_rs2_0.read(ba) << 0;
219 uimm += R_uimm_6.read(ba) << 6;
221 uimm += R_uimm_2.read(ba) << 2;
224 rs1 += R_rs1_0.read(ba) << 0;
226 uimm += R_uimm_3.read(ba) << 3;
230 std::stringstream ss;
232 ss <<
"cfsw" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | uimm=" + std::to_string(uimm) +
" | rs1=" + std::to_string(rs1) +
"]");
254 uimm += R_uimm_6.
read(ba) << 6;
256 uimm += R_uimm_2.
read(ba) << 2;
259 rd += R_rd_0.
read(ba) << 0;
261 uimm += R_uimm_5.
read(ba) << 5;
268 cp.
code() = std::string(
"//CFLWSP\n");
271 cp.
code() +=
"etiss_coverage_count(1, 116);\n";
273 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
274 cp.
code() +=
"{ // block\n";
276 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
277 cp.
code() +=
"} // block\n";
280 cp.
code() +=
"etiss_coverage_count(1, 5010);\n";
281 cp.
code() +=
"{ // block\n";
282 cp.
code() +=
"etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[2ULL] + " + std::to_string(uimm) +
"ULL;\n";
283 cp.
code() +=
"etiss_coverage_count(5, 4979, 4978, 4976, 4975, 4977);\n";
284 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
285 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
286 cp.
code() +=
"if (cpu->exception) { // conditional\n";
288 cp.
code() +=
"{ // procedure\n";
289 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
291 cp.
code() +=
"} // procedure\n";
293 cp.
code() +=
"} // conditional\n";
294 cp.
code() +=
"etiss_uint32 res = (etiss_uint32)(mem_val_0);\n";
295 cp.
code() +=
"etiss_coverage_count(4, 4986, 4985, 4983, 4982);\n";
297 cp.
code() +=
"etiss_coverage_count(1, 5009);\n";
298 cp.
code() +=
"{ // block\n";
299 cp.
code() +=
"((RV32IMACFD*)cpu)->F[" + std::to_string(rd) +
"ULL] = -4294967296LL | res;\n";
300 cp.
code() +=
"etiss_coverage_count(5, 5008, 4998, 4997, 5007, 5006);\n";
301 cp.
code() +=
"} // block\n";
303 cp.
code() +=
"} // block\n";
306 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
313 cp.
code() = std::string(
"//CFLWSP\n");
316 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
328 uimm += R_uimm_6.read(ba) << 6;
330 uimm += R_uimm_2.read(ba) << 2;
333 rd += R_rd_0.read(ba) << 0;
335 uimm += R_uimm_5.read(ba) << 5;
339 std::stringstream ss;
341 ss <<
"cflwsp" <<
" # " << ba << (
" [uimm=" + std::to_string(uimm) +
" | rd=" + std::to_string(rd) +
"]");
363 rs2 += R_rs2_0.
read(ba) << 0;
366 uimm += R_uimm_6.
read(ba) << 6;
368 uimm += R_uimm_2.
read(ba) << 2;
375 cp.
code() = std::string(
"//CFSWSP\n");
378 cp.
code() +=
"etiss_coverage_count(1, 117);\n";
380 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
381 cp.
code() +=
"{ // block\n";
383 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
384 cp.
code() +=
"} // block\n";
387 cp.
code() +=
"etiss_coverage_count(1, 5027);\n";
388 cp.
code() +=
"{ // block\n";
389 cp.
code() +=
"etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[2ULL] + " + std::to_string(uimm) +
"ULL;\n";
390 cp.
code() +=
"etiss_coverage_count(5, 5017, 5016, 5014, 5013, 5015);\n";
391 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
392 cp.
code() +=
"mem_val_0 = (etiss_uint32)(((RV32IMACFD*)cpu)->F[" + std::to_string(rs2) +
"ULL]);\n";
393 cp.
code() +=
"etiss_coverage_count(6, 5026, 5020, 5019, 5025, 5023, 5022);\n";
394 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
395 cp.
code() +=
"if (cpu->exception) { // conditional\n";
397 cp.
code() +=
"{ // procedure\n";
398 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
400 cp.
code() +=
"} // procedure\n";
402 cp.
code() +=
"} // conditional\n";
403 cp.
code() +=
"} // block\n";
406 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
413 cp.
code() = std::string(
"//CFSWSP\n");
416 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
428 rs2 += R_rs2_0.read(ba) << 0;
431 uimm += R_uimm_6.read(ba) << 6;
433 uimm += R_uimm_2.read(ba) << 2;
437 std::stringstream ss;
439 ss <<
"cfswsp" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | uimm=" + std::to_string(uimm) +
"]");
etiss::instr::InstructionGroup ISA16_RV32IMACFD("ISA16_RV32IMACFD", 16)
static InstructionDefinition cfswsp_rs2_uimm(ISA16_RV32IMACFD, "cfswsp",(uint16_t) 0xe002,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(8, 7);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(12, 9);uimm+=R_uimm_2.read(ba)<< 2;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CFSWSP\n");cp.code()+="etiss_coverage_count(1, 117);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 5027);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[2ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 5017, 5016, 5014, 5013, 5015);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_uint32)(((RV32IMACFD*)cpu)->F["+std::to_string(rs2)+"ULL]);\n";cp.code()+="etiss_coverage_count(6, 5026, 5020, 5019, 5025, 5023, 5022);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} { CodePart &cp=cs.append(CodePart::APPENDEDRETURNINGREQUIRED);cp.code()=std::string("//CFSWSP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(8, 7);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(12, 9);uimm+=R_uimm_2.read(ba)<< 2;std::stringstream ss;ss<< "cfswsp"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | uimm="+std::to_string(uimm)+"]");return ss.str();})
static InstructionDefinition cfsw_rs2_uimm_rs1(ISA16_RV32IMACFD, "cfsw",(uint16_t) 0xe000,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CFSW\n");cp.code()+="etiss_coverage_count(1, 115);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 4972);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 4960, 4959, 4957, 4956, 4954, 4955, 4958);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_uint32)(((RV32IMACFD*)cpu)->F["+std::to_string(rs2+8ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(8, 4971, 4963, 4962, 4970, 4968, 4967, 4965, 4966);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} { CodePart &cp=cs.append(CodePart::APPENDEDRETURNINGREQUIRED);cp.code()=std::string("//CFSW\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "cfsw"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | uimm="+std::to_string(uimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cflw_rd_uimm_rs1(ISA16_RV32IMACFD, "cflw",(uint16_t) 0x6000,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CFLW\n");cp.code()+="etiss_coverage_count(1, 114);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 4951);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 4916, 4915, 4913, 4912, 4910, 4911, 4914);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_uint32 res = (etiss_uint32)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 4923, 4922, 4920, 4919);\n";{ cp.code()+="etiss_coverage_count(1, 4950);\n";cp.code()+="{ // block\n";cp.code()+="((RV32IMACFD*)cpu)->F["+std::to_string(rd+8ULL)+"ULL] = -4294967296LL | res;\n";cp.code()+="etiss_coverage_count(7, 4949, 4939, 4938, 4936, 4937, 4948, 4947);\n";cp.code()+="} // block\n";} cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} { CodePart &cp=cs.append(CodePart::APPENDEDRETURNINGREQUIRED);cp.code()=std::string("//CFLW\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "cflw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | uimm="+std::to_string(uimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cflwsp_uimm_rd(ISA16_RV32IMACFD, "cflwsp",(uint16_t) 0x6002,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(3, 2);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 4);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_uimm_5(12, 12);uimm+=R_uimm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CFLWSP\n");cp.code()+="etiss_coverage_count(1, 116);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 5010);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[2ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 4979, 4978, 4976, 4975, 4977);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_uint32 res = (etiss_uint32)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 4986, 4985, 4983, 4982);\n";{ cp.code()+="etiss_coverage_count(1, 5009);\n";cp.code()+="{ // block\n";cp.code()+="((RV32IMACFD*)cpu)->F["+std::to_string(rd)+"ULL] = -4294967296LL | res;\n";cp.code()+="etiss_coverage_count(5, 5008, 4998, 4997, 5007, 5006);\n";cp.code()+="} // block\n";} cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} { CodePart &cp=cs.append(CodePart::APPENDEDRETURNINGREQUIRED);cp.code()=std::string("//CFLWSP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(3, 2);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 4);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_uimm_5(12, 12);uimm+=R_uimm_5.read(ba)<< 5;std::stringstream ss;ss<< "cflwsp"<< " # "<< ba<<(" [uimm="+std::to_string(uimm)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static __inline__ uint16_t
Contains a small code snipped.
@ APPENDEDRETURNINGREQUIRED
RegisterSet & getAffectedRegisters()
void append(const CodePart &part, CodePart::TYPE type)
void add(const RegisterPart &rp)
add a registerPart to the set or just its relevant bits if a register with the same name is already p...
Reading through it will only return bits within the range.
I read(const BitArray &ba)
reads bits from the range to the return value starting at the lsb.
this class contains parameters that persist in between instruction lookpus/translation within a trans...
uint64_t current_address_
start address of current instruction
holds information and translation callbacks for an instruction.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.