11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 rs1 += R_rs1_0.
read(ba) << 0;
37 csr += R_csr_0.
read(ba) << 0;
44 cp.
code() = std::string(
"//CSRRW\n");
47 cp.
code() +=
"etiss_coverage_count(1, 153);\n";
49 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
50 cp.
code() +=
"{ // block\n";
52 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
53 cp.
code() +=
"} // block\n";
56 cp.
code() +=
"etiss_coverage_count(1, 3249);\n";
57 cp.
code() +=
"{ // block\n";
58 cp.
code() +=
"etiss_uint64 xrs1 = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
59 cp.
code() +=
"etiss_coverage_count(4, 3222, 3221, 3220, 3218);\n";
60 cp.
code() +=
"etiss_coverage_count(1, 3223);\n";
61 if ((rd % 32ULL) != 0LL) {
62 cp.
code() +=
"etiss_coverage_count(5, 3229, 3226, 3224, 3227, 3228);\n";
64 cp.
code() +=
"etiss_coverage_count(1, 3244);\n";
65 cp.
code() +=
"{ // block\n";
66 cp.
code() +=
"etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL);\n";
67 cp.
code() +=
"etiss_coverage_count(3, 3233, 3232, 3231);\n";
68 cp.
code() +=
"RV64IMACFD_csr_write(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL, xrs1);\n";
69 cp.
code() +=
"etiss_coverage_count(3, 3236, 3234, 3235);\n";
70 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = xrd;\n";
71 cp.
code() +=
"etiss_coverage_count(5, 3243, 3241, 3240, 3238, 3242);\n";
72 cp.
code() +=
"} // block\n";
77 cp.
code() +=
"etiss_coverage_count(1, 3248);\n";
78 cp.
code() +=
"{ // block\n";
79 cp.
code() +=
"RV64IMACFD_csr_write(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL, xrs1);\n";
80 cp.
code() +=
"etiss_coverage_count(3, 3247, 3245, 3246);\n";
81 cp.
code() +=
"} // block\n";
84 cp.
code() +=
"} // block\n";
87 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
100 rd += R_rd_0.read(ba) << 0;
103 rs1 += R_rs1_0.read(ba) << 0;
106 csr += R_csr_0.read(ba) << 0;
110 std::stringstream ss;
112 ss <<
"csrrw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | csr=" + std::to_string(csr) +
"]");
134 rd += R_rd_0.
read(ba) << 0;
137 rs1 += R_rs1_0.
read(ba) << 0;
140 csr += R_csr_0.
read(ba) << 0;
147 cp.
code() = std::string(
"//CSRRS\n");
150 cp.
code() +=
"etiss_coverage_count(1, 154);\n";
152 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
153 cp.
code() +=
"{ // block\n";
155 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
156 cp.
code() +=
"} // block\n";
159 cp.
code() +=
"etiss_coverage_count(1, 3284);\n";
160 cp.
code() +=
"{ // block\n";
161 cp.
code() +=
"etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL);\n";
162 cp.
code() +=
"etiss_coverage_count(3, 3253, 3252, 3251);\n";
163 cp.
code() +=
"etiss_uint64 xrs1 = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
164 cp.
code() +=
"etiss_coverage_count(4, 3260, 3259, 3258, 3256);\n";
165 cp.
code() +=
"etiss_coverage_count(1, 3261);\n";
167 cp.
code() +=
"etiss_coverage_count(3, 3264, 3262, 3263);\n";
168 cp.
code() +=
"RV64IMACFD_csr_write(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL, xrd | xrs1);\n";
169 cp.
code() +=
"etiss_coverage_count(5, 3269, 3265, 3268, 3266, 3267);\n";
171 cp.
code() +=
"etiss_coverage_count(1, 3270);\n";
172 if ((rd % 32ULL) != 0LL) {
173 cp.
code() +=
"etiss_coverage_count(5, 3276, 3273, 3271, 3274, 3275);\n";
174 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = xrd;\n";
175 cp.
code() +=
"etiss_coverage_count(5, 3283, 3281, 3280, 3278, 3282);\n";
177 cp.
code() +=
"} // block\n";
180 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
193 rd += R_rd_0.read(ba) << 0;
196 rs1 += R_rs1_0.read(ba) << 0;
199 csr += R_csr_0.read(ba) << 0;
203 std::stringstream ss;
205 ss <<
"csrrs" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | csr=" + std::to_string(csr) +
"]");
227 rd += R_rd_0.
read(ba) << 0;
230 rs1 += R_rs1_0.
read(ba) << 0;
233 csr += R_csr_0.
read(ba) << 0;
240 cp.
code() = std::string(
"//CSRRC\n");
243 cp.
code() +=
"etiss_coverage_count(1, 155);\n";
245 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
246 cp.
code() +=
"{ // block\n";
248 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
249 cp.
code() +=
"} // block\n";
252 cp.
code() +=
"etiss_coverage_count(1, 3320);\n";
253 cp.
code() +=
"{ // block\n";
254 cp.
code() +=
"etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL);\n";
255 cp.
code() +=
"etiss_coverage_count(3, 3288, 3287, 3286);\n";
256 cp.
code() +=
"etiss_uint64 xrs1 = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
257 cp.
code() +=
"etiss_coverage_count(4, 3295, 3294, 3293, 3291);\n";
258 cp.
code() +=
"etiss_coverage_count(1, 3296);\n";
260 cp.
code() +=
"etiss_coverage_count(3, 3299, 3297, 3298);\n";
261 cp.
code() +=
"RV64IMACFD_csr_write(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL, xrd & ~(xrs1));\n";
262 cp.
code() +=
"etiss_coverage_count(6, 3305, 3300, 3304, 3301, 3303, 3302);\n";
264 cp.
code() +=
"etiss_coverage_count(1, 3306);\n";
265 if ((rd % 32ULL) != 0LL) {
266 cp.
code() +=
"etiss_coverage_count(5, 3312, 3309, 3307, 3310, 3311);\n";
267 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = xrd;\n";
268 cp.
code() +=
"etiss_coverage_count(5, 3319, 3317, 3316, 3314, 3318);\n";
270 cp.
code() +=
"} // block\n";
273 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
286 rd += R_rd_0.read(ba) << 0;
289 rs1 += R_rs1_0.read(ba) << 0;
292 csr += R_csr_0.read(ba) << 0;
296 std::stringstream ss;
298 ss <<
"csrrc" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | csr=" + std::to_string(csr) +
"]");
320 rd += R_rd_0.
read(ba) << 0;
323 zimm += R_zimm_0.
read(ba) << 0;
326 csr += R_csr_0.
read(ba) << 0;
333 cp.
code() = std::string(
"//CSRRWI\n");
336 cp.
code() +=
"etiss_coverage_count(1, 156);\n";
338 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
339 cp.
code() +=
"{ // block\n";
341 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
342 cp.
code() +=
"} // block\n";
345 cp.
code() +=
"etiss_coverage_count(1, 3344);\n";
346 cp.
code() +=
"{ // block\n";
347 cp.
code() +=
"etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL);\n";
348 cp.
code() +=
"etiss_coverage_count(3, 3324, 3323, 3322);\n";
349 cp.
code() +=
"RV64IMACFD_csr_write(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL, " + std::to_string((
etiss_uint64)(zimm)) +
"ULL);\n";
350 cp.
code() +=
"etiss_coverage_count(4, 3329, 3325, 3328, 3326);\n";
351 cp.
code() +=
"etiss_coverage_count(1, 3330);\n";
352 if ((rd % 32ULL) != 0LL) {
353 cp.
code() +=
"etiss_coverage_count(5, 3336, 3333, 3331, 3334, 3335);\n";
354 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = xrd;\n";
355 cp.
code() +=
"etiss_coverage_count(5, 3343, 3341, 3340, 3338, 3342);\n";
357 cp.
code() +=
"} // block\n";
360 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
373 rd += R_rd_0.read(ba) << 0;
376 zimm += R_zimm_0.read(ba) << 0;
379 csr += R_csr_0.read(ba) << 0;
383 std::stringstream ss;
385 ss <<
"csrrwi" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | zimm=" + std::to_string(zimm) +
" | csr=" + std::to_string(csr) +
"]");
407 rd += R_rd_0.
read(ba) << 0;
410 zimm += R_zimm_0.
read(ba) << 0;
413 csr += R_csr_0.
read(ba) << 0;
420 cp.
code() = std::string(
"//CSRRSI\n");
423 cp.
code() +=
"etiss_coverage_count(1, 157);\n";
425 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
426 cp.
code() +=
"{ // block\n";
428 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
429 cp.
code() +=
"} // block\n";
432 cp.
code() +=
"etiss_coverage_count(1, 3374);\n";
433 cp.
code() +=
"{ // block\n";
434 cp.
code() +=
"etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL);\n";
435 cp.
code() +=
"etiss_coverage_count(3, 3348, 3347, 3346);\n";
436 cp.
code() +=
"etiss_coverage_count(1, 3349);\n";
438 cp.
code() +=
"etiss_coverage_count(3, 3352, 3350, 3351);\n";
439 cp.
code() +=
"RV64IMACFD_csr_write(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL, xrd | " + std::to_string((
etiss_uint64)(zimm)) +
"ULL);\n";
440 cp.
code() +=
"etiss_coverage_count(6, 3359, 3353, 3358, 3354, 3357, 3355);\n";
442 cp.
code() +=
"etiss_coverage_count(1, 3360);\n";
443 if ((rd % 32ULL) != 0LL) {
444 cp.
code() +=
"etiss_coverage_count(5, 3366, 3363, 3361, 3364, 3365);\n";
445 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = xrd;\n";
446 cp.
code() +=
"etiss_coverage_count(5, 3373, 3371, 3370, 3368, 3372);\n";
448 cp.
code() +=
"} // block\n";
451 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
464 rd += R_rd_0.read(ba) << 0;
467 zimm += R_zimm_0.read(ba) << 0;
470 csr += R_csr_0.read(ba) << 0;
474 std::stringstream ss;
476 ss <<
"csrrsi" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | zimm=" + std::to_string(zimm) +
" | csr=" + std::to_string(csr) +
"]");
498 rd += R_rd_0.
read(ba) << 0;
501 zimm += R_zimm_0.
read(ba) << 0;
504 csr += R_csr_0.
read(ba) << 0;
511 cp.
code() = std::string(
"//CSRRCI\n");
514 cp.
code() +=
"etiss_coverage_count(1, 158);\n";
516 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
517 cp.
code() +=
"{ // block\n";
519 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
520 cp.
code() +=
"} // block\n";
523 cp.
code() +=
"etiss_coverage_count(1, 3406);\n";
524 cp.
code() +=
"{ // block\n";
525 cp.
code() +=
"etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL);\n";
526 cp.
code() +=
"etiss_coverage_count(3, 3378, 3377, 3376);\n";
527 cp.
code() +=
"etiss_coverage_count(1, 3379);\n";
529 cp.
code() +=
"etiss_coverage_count(3, 3382, 3380, 3381);\n";
530 cp.
code() +=
"RV64IMACFD_csr_write(cpu, system, plugin_pointers, " + std::to_string(csr) +
"ULL, xrd & " + std::to_string(~(((
etiss_uint64)(zimm)))) +
"ULL);\n";
531 cp.
code() +=
"etiss_coverage_count(8, 3391, 3383, 3390, 3384, 3389, 3387, 3385, 3388);\n";
533 cp.
code() +=
"etiss_coverage_count(1, 3392);\n";
534 if ((rd % 32ULL) != 0LL) {
535 cp.
code() +=
"etiss_coverage_count(5, 3398, 3395, 3393, 3396, 3397);\n";
536 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = xrd;\n";
537 cp.
code() +=
"etiss_coverage_count(5, 3405, 3403, 3402, 3400, 3404);\n";
539 cp.
code() +=
"} // block\n";
542 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
555 rd += R_rd_0.read(ba) << 0;
558 zimm += R_zimm_0.read(ba) << 0;
561 csr += R_csr_0.read(ba) << 0;
565 std::stringstream ss;
567 ss <<
"csrrci" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | zimm=" + std::to_string(zimm) +
" | csr=" + std::to_string(csr) +
"]");
etiss::instr::InstructionGroup ISA32_RV64IMACFD("ISA32_RV64IMACFD", 32)
static InstructionDefinition csrrs_rd_rs1_csr(ISA32_RV64IMACFD, "csrrs",(uint32_t) 0x002073,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRRS\n");cp.code()+="etiss_coverage_count(1, 154);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 3284);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL);\n";cp.code()+="etiss_coverage_count(3, 3253, 3252, 3251);\n";cp.code()+="etiss_uint64 xrs1 = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 3260, 3259, 3258, 3256);\n";cp.code()+="etiss_coverage_count(1, 3261);\n";if(rs1 !=0LL) { cp.code()+="etiss_coverage_count(3, 3264, 3262, 3263);\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL, xrd | xrs1);\n";cp.code()+="etiss_coverage_count(5, 3269, 3265, 3268, 3266, 3267);\n";} cp.code()+="etiss_coverage_count(1, 3270);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 3276, 3273, 3271, 3274, 3275);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = xrd;\n";cp.code()+="etiss_coverage_count(5, 3283, 3281, 3280, 3278, 3282);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;std::stringstream ss;ss<< "csrrs"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | csr="+std::to_string(csr)+"]");return ss.str();})
static InstructionDefinition csrrci_rd_zimm_csr(ISA32_RV64IMACFD, "csrrci",(uint32_t) 0x007073,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 zimm=0;static BitArrayRange R_zimm_0(19, 15);zimm+=R_zimm_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRRCI\n");cp.code()+="etiss_coverage_count(1, 158);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 3406);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL);\n";cp.code()+="etiss_coverage_count(3, 3378, 3377, 3376);\n";cp.code()+="etiss_coverage_count(1, 3379);\n";if(zimm !=0LL) { cp.code()+="etiss_coverage_count(3, 3382, 3380, 3381);\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL, xrd & "+std::to_string(~(((etiss_uint64)(zimm))))+"ULL);\n";cp.code()+="etiss_coverage_count(8, 3391, 3383, 3390, 3384, 3389, 3387, 3385, 3388);\n";} cp.code()+="etiss_coverage_count(1, 3392);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 3398, 3395, 3393, 3396, 3397);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = xrd;\n";cp.code()+="etiss_coverage_count(5, 3405, 3403, 3402, 3400, 3404);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 zimm=0;static BitArrayRange R_zimm_0(19, 15);zimm+=R_zimm_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;std::stringstream ss;ss<< "csrrci"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | zimm="+std::to_string(zimm)+" | csr="+std::to_string(csr)+"]");return ss.str();})
static InstructionDefinition csrrw_rd_rs1_csr(ISA32_RV64IMACFD, "csrrw",(uint32_t) 0x001073,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRRW\n");cp.code()+="etiss_coverage_count(1, 153);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 3249);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 xrs1 = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 3222, 3221, 3220, 3218);\n";cp.code()+="etiss_coverage_count(1, 3223);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 3229, 3226, 3224, 3227, 3228);\n";{ cp.code()+="etiss_coverage_count(1, 3244);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL);\n";cp.code()+="etiss_coverage_count(3, 3233, 3232, 3231);\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL, xrs1);\n";cp.code()+="etiss_coverage_count(3, 3236, 3234, 3235);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = xrd;\n";cp.code()+="etiss_coverage_count(5, 3243, 3241, 3240, 3238, 3242);\n";cp.code()+="} // block\n";} } else { { cp.code()+="etiss_coverage_count(1, 3248);\n";cp.code()+="{ // block\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL, xrs1);\n";cp.code()+="etiss_coverage_count(3, 3247, 3245, 3246);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;std::stringstream ss;ss<< "csrrw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | csr="+std::to_string(csr)+"]");return ss.str();})
static InstructionDefinition csrrwi_rd_zimm_csr(ISA32_RV64IMACFD, "csrrwi",(uint32_t) 0x005073,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 zimm=0;static BitArrayRange R_zimm_0(19, 15);zimm+=R_zimm_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRRWI\n");cp.code()+="etiss_coverage_count(1, 156);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 3344);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL);\n";cp.code()+="etiss_coverage_count(3, 3324, 3323, 3322);\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL, "+std::to_string((etiss_uint64)(zimm))+"ULL);\n";cp.code()+="etiss_coverage_count(4, 3329, 3325, 3328, 3326);\n";cp.code()+="etiss_coverage_count(1, 3330);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 3336, 3333, 3331, 3334, 3335);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = xrd;\n";cp.code()+="etiss_coverage_count(5, 3343, 3341, 3340, 3338, 3342);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 zimm=0;static BitArrayRange R_zimm_0(19, 15);zimm+=R_zimm_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;std::stringstream ss;ss<< "csrrwi"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | zimm="+std::to_string(zimm)+" | csr="+std::to_string(csr)+"]");return ss.str();})
static InstructionDefinition csrrc_rd_rs1_csr(ISA32_RV64IMACFD, "csrrc",(uint32_t) 0x003073,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRRC\n");cp.code()+="etiss_coverage_count(1, 155);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 3320);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL);\n";cp.code()+="etiss_coverage_count(3, 3288, 3287, 3286);\n";cp.code()+="etiss_uint64 xrs1 = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 3295, 3294, 3293, 3291);\n";cp.code()+="etiss_coverage_count(1, 3296);\n";if(rs1 !=0LL) { cp.code()+="etiss_coverage_count(3, 3299, 3297, 3298);\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL, xrd & ~(xrs1));\n";cp.code()+="etiss_coverage_count(6, 3305, 3300, 3304, 3301, 3303, 3302);\n";} cp.code()+="etiss_coverage_count(1, 3306);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 3312, 3309, 3307, 3310, 3311);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = xrd;\n";cp.code()+="etiss_coverage_count(5, 3319, 3317, 3316, 3314, 3318);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;std::stringstream ss;ss<< "csrrc"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | csr="+std::to_string(csr)+"]");return ss.str();})
static InstructionDefinition csrrsi_rd_zimm_csr(ISA32_RV64IMACFD, "csrrsi",(uint32_t) 0x006073,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 zimm=0;static BitArrayRange R_zimm_0(19, 15);zimm+=R_zimm_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRRSI\n");cp.code()+="etiss_coverage_count(1, 157);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 3374);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 xrd = RV64IMACFD_csr_read(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL);\n";cp.code()+="etiss_coverage_count(3, 3348, 3347, 3346);\n";cp.code()+="etiss_coverage_count(1, 3349);\n";if(zimm !=0LL) { cp.code()+="etiss_coverage_count(3, 3352, 3350, 3351);\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, "+std::to_string(csr)+"ULL, xrd | "+std::to_string((etiss_uint64)(zimm))+"ULL);\n";cp.code()+="etiss_coverage_count(6, 3359, 3353, 3358, 3354, 3357, 3355);\n";} cp.code()+="etiss_coverage_count(1, 3360);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 3366, 3363, 3361, 3364, 3365);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = xrd;\n";cp.code()+="etiss_coverage_count(5, 3373, 3371, 3370, 3368, 3372);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 zimm=0;static BitArrayRange R_zimm_0(19, 15);zimm+=R_zimm_0.read(ba)<< 0;etiss_uint16 csr=0;static BitArrayRange R_csr_0(31, 20);csr+=R_csr_0.read(ba)<< 0;std::stringstream ss;ss<< "csrrsi"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | zimm="+std::to_string(zimm)+" | csr="+std::to_string(csr)+"]");return ss.str();})
static __inline__ uint32_t
Contains a small code snipped.
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.