11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 imm += R_imm_12.
read(ba) << 12;
41 cp.
code() = std::string(
"//LUI\n");
44 cp.
code() +=
"etiss_coverage_count(1, 0);\n";
46 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
47 cp.
code() +=
"{ // block\n";
49 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
50 cp.
code() +=
"} // block\n";
52 cp.
code() +=
"etiss_coverage_count(1, 1170);\n";
53 if ((rd % 32ULL) != 0LL) {
54 cp.
code() +=
"etiss_coverage_count(5, 1176, 1173, 1171, 1174, 1175);\n";
55 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = " + std::to_string((
etiss_uint32)(((
etiss_int32)(imm)))) +
"ULL;\n";
56 cp.
code() +=
"etiss_coverage_count(8, 1187, 1181, 1180, 1178, 1186, 1183, 1182, 1184);\n";
59 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
72 rd += R_rd_0.read(ba) << 0;
75 imm += R_imm_12.read(ba) << 12;
81 ss <<
"lui" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | imm=" + std::to_string(imm) +
"]");
103 rd += R_rd_0.
read(ba) << 0;
106 imm += R_imm_12.
read(ba) << 12;
113 cp.
code() = std::string(
"//AUIPC\n");
116 cp.
code() +=
"etiss_coverage_count(1, 1);\n";
118 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
119 cp.
code() +=
"{ // block\n";
121 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
122 cp.
code() +=
"} // block\n";
124 cp.
code() +=
"etiss_coverage_count(1, 1188);\n";
125 if ((rd % 32ULL) != 0LL) {
126 cp.
code() +=
"etiss_coverage_count(5, 1194, 1191, 1189, 1192, 1193);\n";
128 cp.
code() +=
"etiss_coverage_count(8, 1204, 1199, 1198, 1196, 1203, 1200, 1202, 1201);\n";
131 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
144 rd += R_rd_0.read(ba) << 0;
147 imm += R_imm_12.read(ba) << 12;
151 std::stringstream ss;
153 ss <<
"auipc" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | imm=" + std::to_string(imm) +
"]");
175 rd += R_rd_0.
read(ba) << 0;
178 imm += R_imm_12.
read(ba) << 12;
180 imm += R_imm_11.
read(ba) << 11;
182 imm += R_imm_1.
read(ba) << 1;
184 imm += R_imm_20.
read(ba) << 20;
191 cp.
code() = std::string(
"//JAL\n");
194 cp.
code() +=
"etiss_coverage_count(1, 2);\n";
196 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
197 cp.
code() +=
"{ // block\n";
199 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
200 cp.
code() +=
"} // block\n";
203 cp.
code() +=
"etiss_coverage_count(1, 1236);\n";
204 cp.
code() +=
"{ // block\n";
205 cp.
code() +=
"etiss_coverage_count(1, 1205);\n";
207 cp.
code() +=
"etiss_coverage_count(2, 1208, 1206);\n";
209 cp.
code() +=
"etiss_coverage_count(1, 1212);\n";
210 cp.
code() +=
"{ // block\n";
212 cp.
code() +=
"{ // procedure\n";
213 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";
214 cp.
code() +=
"etiss_coverage_count(2, 1211, 1209);\n";
216 cp.
code() +=
"} // procedure\n";
218 cp.
code() +=
"} // block\n";
223 cp.
code() +=
"etiss_coverage_count(1, 1235);\n";
224 cp.
code() +=
"{ // block\n";
225 cp.
code() +=
"etiss_coverage_count(1, 1213);\n";
226 if ((rd % 32ULL) != 0LL) {
227 cp.
code() +=
"etiss_coverage_count(5, 1219, 1216, 1214, 1217, 1218);\n";
228 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = " + std::to_string(ic.
current_address_ + 4ULL) +
"ULL;\n";
229 cp.
code() +=
"etiss_coverage_count(7, 1228, 1224, 1223, 1221, 1227, 1225, 1226);\n";
232 cp.
code() +=
"etiss_coverage_count(6, 1234, 1229, 1233, 1230, 1232, 1231);\n";
233 cp.
code() +=
"} // block\n";
236 cp.
code() +=
"} // block\n";
239 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
246 cp.
code() = std::string(
"//JAL\n");
249 cp.
code() +=
"return cpu->exception;\n";
261 rd += R_rd_0.read(ba) << 0;
264 imm += R_imm_12.read(ba) << 12;
266 imm += R_imm_11.read(ba) << 11;
268 imm += R_imm_1.read(ba) << 1;
270 imm += R_imm_20.read(ba) << 20;
274 std::stringstream ss;
276 ss <<
"jal" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | imm=" + std::to_string(imm) +
"]");
298 rd += R_rd_0.
read(ba) << 0;
301 rs1 += R_rs1_0.
read(ba) << 0;
304 imm += R_imm_0.
read(ba) << 0;
311 cp.
code() = std::string(
"//JALR\n");
314 cp.
code() +=
"etiss_coverage_count(1, 3);\n";
316 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
317 cp.
code() +=
"{ // block\n";
319 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
320 cp.
code() +=
"} // block\n";
323 cp.
code() +=
"etiss_coverage_count(1, 1282);\n";
324 cp.
code() +=
"{ // block\n";
325 cp.
code() +=
"etiss_uint32 new_pc = (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL) & -2LL;\n";
326 cp.
code() +=
"etiss_coverage_count(9, 1250, 1249, 1245, 1242, 1241, 1239, 1244, 1243, 1246);\n";
327 cp.
code() +=
"etiss_coverage_count(1, 1251);\n";
328 cp.
code() +=
"if (new_pc % 2ULL) { // conditional\n";
329 cp.
code() +=
"etiss_coverage_count(2, 1254, 1252);\n";
331 cp.
code() +=
"etiss_coverage_count(1, 1258);\n";
332 cp.
code() +=
"{ // block\n";
334 cp.
code() +=
"{ // procedure\n";
335 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";
336 cp.
code() +=
"etiss_coverage_count(2, 1257, 1255);\n";
338 cp.
code() +=
"} // procedure\n";
340 cp.
code() +=
"} // block\n";
342 cp.
code() +=
"} // conditional\n";
343 cp.
code() +=
"else { // conditional\n";
345 cp.
code() +=
"etiss_coverage_count(1, 1281);\n";
346 cp.
code() +=
"{ // block\n";
347 cp.
code() +=
"etiss_coverage_count(1, 1259);\n";
348 if ((rd % 32ULL) != 0LL) {
349 cp.
code() +=
"etiss_coverage_count(5, 1265, 1262, 1260, 1263, 1264);\n";
350 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = " + std::to_string(ic.
current_address_ + 4ULL) +
"ULL;\n";
351 cp.
code() +=
"etiss_coverage_count(7, 1274, 1270, 1269, 1267, 1273, 1271, 1272);\n";
353 cp.
code() +=
"cpu->nextPc = new_pc & -2LL;\n";
354 cp.
code() +=
"etiss_coverage_count(4, 1280, 1275, 1279, 1276);\n";
355 cp.
code() +=
"} // block\n";
357 cp.
code() +=
"} // conditional\n";
358 cp.
code() +=
"} // block\n";
361 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
368 cp.
code() = std::string(
"//JALR\n");
371 cp.
code() +=
"return cpu->exception;\n";
383 rd += R_rd_0.read(ba) << 0;
386 rs1 += R_rs1_0.read(ba) << 0;
389 imm += R_imm_0.read(ba) << 0;
393 std::stringstream ss;
395 ss <<
"jalr" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
417 imm += R_imm_11.
read(ba) << 11;
419 imm += R_imm_1.
read(ba) << 1;
422 rs1 += R_rs1_0.
read(ba) << 0;
425 rs2 += R_rs2_0.
read(ba) << 0;
427 imm += R_imm_5.
read(ba) << 5;
429 imm += R_imm_12.
read(ba) << 12;
436 cp.
code() = std::string(
"//BEQ\n");
439 cp.
code() +=
"etiss_coverage_count(1, 4);\n";
441 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
442 cp.
code() +=
"{ // block\n";
444 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
445 cp.
code() +=
"} // block\n";
448 cp.
code() +=
"etiss_coverage_count(1, 1311);\n";
449 cp.
code() +=
"{ // block\n";
450 cp.
code() +=
"etiss_coverage_count(1, 1283);\n";
451 cp.
code() +=
"if (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] == *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) { // conditional\n";
452 cp.
code() +=
"etiss_coverage_count(7, 1294, 1288, 1287, 1285, 1293, 1292, 1290);\n";
454 cp.
code() +=
"etiss_coverage_count(1, 1310);\n";
455 cp.
code() +=
"{ // block\n";
456 cp.
code() +=
"etiss_coverage_count(1, 1295);\n";
458 cp.
code() +=
"etiss_coverage_count(2, 1298, 1296);\n";
460 cp.
code() +=
"etiss_coverage_count(1, 1302);\n";
461 cp.
code() +=
"{ // block\n";
463 cp.
code() +=
"{ // procedure\n";
464 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";
465 cp.
code() +=
"etiss_coverage_count(2, 1301, 1299);\n";
467 cp.
code() +=
"} // procedure\n";
469 cp.
code() +=
"} // block\n";
474 cp.
code() +=
"etiss_coverage_count(1, 1309);\n";
475 cp.
code() +=
"{ // block\n";
477 cp.
code() +=
"etiss_coverage_count(6, 1308, 1303, 1307, 1304, 1306, 1305);\n";
478 cp.
code() +=
"} // block\n";
481 cp.
code() +=
"} // block\n";
483 cp.
code() +=
"} // conditional\n";
484 cp.
code() +=
"} // block\n";
487 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
494 cp.
code() = std::string(
"//BEQ\n");
497 cp.
code() +=
"if (cpu->return_pending || cpu->exception || cpu->nextPc != " + std::to_string(ic.
current_address_ + 4) +
"ULL) return cpu->exception;\n";
509 imm += R_imm_11.read(ba) << 11;
511 imm += R_imm_1.read(ba) << 1;
514 rs1 += R_rs1_0.read(ba) << 0;
517 rs2 += R_rs2_0.read(ba) << 0;
519 imm += R_imm_5.read(ba) << 5;
521 imm += R_imm_12.read(ba) << 12;
525 std::stringstream ss;
527 ss <<
"beq" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
549 imm += R_imm_11.
read(ba) << 11;
551 imm += R_imm_1.
read(ba) << 1;
554 rs1 += R_rs1_0.
read(ba) << 0;
557 rs2 += R_rs2_0.
read(ba) << 0;
559 imm += R_imm_5.
read(ba) << 5;
561 imm += R_imm_12.
read(ba) << 12;
568 cp.
code() = std::string(
"//BNE\n");
571 cp.
code() +=
"etiss_coverage_count(1, 5);\n";
573 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
574 cp.
code() +=
"{ // block\n";
576 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
577 cp.
code() +=
"} // block\n";
580 cp.
code() +=
"etiss_coverage_count(1, 1340);\n";
581 cp.
code() +=
"{ // block\n";
582 cp.
code() +=
"etiss_coverage_count(1, 1312);\n";
583 cp.
code() +=
"if (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] != *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) { // conditional\n";
584 cp.
code() +=
"etiss_coverage_count(7, 1323, 1317, 1316, 1314, 1322, 1321, 1319);\n";
586 cp.
code() +=
"etiss_coverage_count(1, 1339);\n";
587 cp.
code() +=
"{ // block\n";
588 cp.
code() +=
"etiss_coverage_count(1, 1324);\n";
590 cp.
code() +=
"etiss_coverage_count(2, 1327, 1325);\n";
592 cp.
code() +=
"etiss_coverage_count(1, 1331);\n";
593 cp.
code() +=
"{ // block\n";
595 cp.
code() +=
"{ // procedure\n";
596 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";
597 cp.
code() +=
"etiss_coverage_count(2, 1330, 1328);\n";
599 cp.
code() +=
"} // procedure\n";
601 cp.
code() +=
"} // block\n";
606 cp.
code() +=
"etiss_coverage_count(1, 1338);\n";
607 cp.
code() +=
"{ // block\n";
609 cp.
code() +=
"etiss_coverage_count(6, 1337, 1332, 1336, 1333, 1335, 1334);\n";
610 cp.
code() +=
"} // block\n";
613 cp.
code() +=
"} // block\n";
615 cp.
code() +=
"} // conditional\n";
616 cp.
code() +=
"} // block\n";
619 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
626 cp.
code() = std::string(
"//BNE\n");
629 cp.
code() +=
"if (cpu->return_pending || cpu->exception || cpu->nextPc != " + std::to_string(ic.
current_address_ + 4) +
"ULL) return cpu->exception;\n";
641 imm += R_imm_11.read(ba) << 11;
643 imm += R_imm_1.read(ba) << 1;
646 rs1 += R_rs1_0.read(ba) << 0;
649 rs2 += R_rs2_0.read(ba) << 0;
651 imm += R_imm_5.read(ba) << 5;
653 imm += R_imm_12.read(ba) << 12;
657 std::stringstream ss;
659 ss <<
"bne" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
681 imm += R_imm_11.
read(ba) << 11;
683 imm += R_imm_1.
read(ba) << 1;
686 rs1 += R_rs1_0.
read(ba) << 0;
689 rs2 += R_rs2_0.
read(ba) << 0;
691 imm += R_imm_5.
read(ba) << 5;
693 imm += R_imm_12.
read(ba) << 12;
700 cp.
code() = std::string(
"//BLT\n");
703 cp.
code() +=
"etiss_coverage_count(1, 6);\n";
705 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
706 cp.
code() +=
"{ // block\n";
708 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
709 cp.
code() +=
"} // block\n";
712 cp.
code() +=
"etiss_coverage_count(1, 1373);\n";
713 cp.
code() +=
"{ // block\n";
714 cp.
code() +=
"etiss_coverage_count(1, 1341);\n";
715 cp.
code() +=
"if ((etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) < (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL])) { // conditional\n";
716 cp.
code() +=
"etiss_coverage_count(9, 1356, 1348, 1346, 1345, 1343, 1355, 1353, 1352, 1350);\n";
718 cp.
code() +=
"etiss_coverage_count(1, 1372);\n";
719 cp.
code() +=
"{ // block\n";
720 cp.
code() +=
"etiss_coverage_count(1, 1357);\n";
722 cp.
code() +=
"etiss_coverage_count(2, 1360, 1358);\n";
724 cp.
code() +=
"etiss_coverage_count(1, 1364);\n";
725 cp.
code() +=
"{ // block\n";
727 cp.
code() +=
"{ // procedure\n";
728 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";
729 cp.
code() +=
"etiss_coverage_count(2, 1363, 1361);\n";
731 cp.
code() +=
"} // procedure\n";
733 cp.
code() +=
"} // block\n";
738 cp.
code() +=
"etiss_coverage_count(1, 1371);\n";
739 cp.
code() +=
"{ // block\n";
741 cp.
code() +=
"etiss_coverage_count(6, 1370, 1365, 1369, 1366, 1368, 1367);\n";
742 cp.
code() +=
"} // block\n";
745 cp.
code() +=
"} // block\n";
747 cp.
code() +=
"} // conditional\n";
748 cp.
code() +=
"} // block\n";
751 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
758 cp.
code() = std::string(
"//BLT\n");
761 cp.
code() +=
"if (cpu->return_pending || cpu->exception || cpu->nextPc != " + std::to_string(ic.
current_address_ + 4) +
"ULL) return cpu->exception;\n";
773 imm += R_imm_11.read(ba) << 11;
775 imm += R_imm_1.read(ba) << 1;
778 rs1 += R_rs1_0.read(ba) << 0;
781 rs2 += R_rs2_0.read(ba) << 0;
783 imm += R_imm_5.read(ba) << 5;
785 imm += R_imm_12.read(ba) << 12;
789 std::stringstream ss;
791 ss <<
"blt" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
813 imm += R_imm_11.
read(ba) << 11;
815 imm += R_imm_1.
read(ba) << 1;
818 rs1 += R_rs1_0.
read(ba) << 0;
821 rs2 += R_rs2_0.
read(ba) << 0;
823 imm += R_imm_5.
read(ba) << 5;
825 imm += R_imm_12.
read(ba) << 12;
832 cp.
code() = std::string(
"//BGE\n");
835 cp.
code() +=
"etiss_coverage_count(1, 7);\n";
837 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
838 cp.
code() +=
"{ // block\n";
840 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
841 cp.
code() +=
"} // block\n";
844 cp.
code() +=
"etiss_coverage_count(1, 1406);\n";
845 cp.
code() +=
"{ // block\n";
846 cp.
code() +=
"etiss_coverage_count(1, 1374);\n";
847 cp.
code() +=
"if ((etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) >= (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL])) { // conditional\n";
848 cp.
code() +=
"etiss_coverage_count(9, 1389, 1381, 1379, 1378, 1376, 1388, 1386, 1385, 1383);\n";
850 cp.
code() +=
"etiss_coverage_count(1, 1405);\n";
851 cp.
code() +=
"{ // block\n";
852 cp.
code() +=
"etiss_coverage_count(1, 1390);\n";
854 cp.
code() +=
"etiss_coverage_count(2, 1393, 1391);\n";
856 cp.
code() +=
"etiss_coverage_count(1, 1397);\n";
857 cp.
code() +=
"{ // block\n";
859 cp.
code() +=
"{ // procedure\n";
860 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";
861 cp.
code() +=
"etiss_coverage_count(2, 1396, 1394);\n";
863 cp.
code() +=
"} // procedure\n";
865 cp.
code() +=
"} // block\n";
870 cp.
code() +=
"etiss_coverage_count(1, 1404);\n";
871 cp.
code() +=
"{ // block\n";
873 cp.
code() +=
"etiss_coverage_count(6, 1403, 1398, 1402, 1399, 1401, 1400);\n";
874 cp.
code() +=
"} // block\n";
877 cp.
code() +=
"} // block\n";
879 cp.
code() +=
"} // conditional\n";
880 cp.
code() +=
"} // block\n";
883 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
890 cp.
code() = std::string(
"//BGE\n");
893 cp.
code() +=
"if (cpu->return_pending || cpu->exception || cpu->nextPc != " + std::to_string(ic.
current_address_ + 4) +
"ULL) return cpu->exception;\n";
905 imm += R_imm_11.read(ba) << 11;
907 imm += R_imm_1.read(ba) << 1;
910 rs1 += R_rs1_0.read(ba) << 0;
913 rs2 += R_rs2_0.read(ba) << 0;
915 imm += R_imm_5.read(ba) << 5;
917 imm += R_imm_12.read(ba) << 12;
921 std::stringstream ss;
923 ss <<
"bge" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
945 imm += R_imm_11.
read(ba) << 11;
947 imm += R_imm_1.
read(ba) << 1;
950 rs1 += R_rs1_0.
read(ba) << 0;
953 rs2 += R_rs2_0.
read(ba) << 0;
955 imm += R_imm_5.
read(ba) << 5;
957 imm += R_imm_12.
read(ba) << 12;
964 cp.
code() = std::string(
"//BLTU\n");
967 cp.
code() +=
"etiss_coverage_count(1, 8);\n";
969 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
970 cp.
code() +=
"{ // block\n";
972 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
973 cp.
code() +=
"} // block\n";
976 cp.
code() +=
"etiss_coverage_count(1, 1435);\n";
977 cp.
code() +=
"{ // block\n";
978 cp.
code() +=
"etiss_coverage_count(1, 1407);\n";
979 cp.
code() +=
"if (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] < *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) { // conditional\n";
980 cp.
code() +=
"etiss_coverage_count(7, 1418, 1412, 1411, 1409, 1417, 1416, 1414);\n";
982 cp.
code() +=
"etiss_coverage_count(1, 1434);\n";
983 cp.
code() +=
"{ // block\n";
984 cp.
code() +=
"etiss_coverage_count(1, 1419);\n";
986 cp.
code() +=
"etiss_coverage_count(2, 1422, 1420);\n";
988 cp.
code() +=
"etiss_coverage_count(1, 1426);\n";
989 cp.
code() +=
"{ // block\n";
991 cp.
code() +=
"{ // procedure\n";
992 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";
993 cp.
code() +=
"etiss_coverage_count(2, 1425, 1423);\n";
995 cp.
code() +=
"} // procedure\n";
997 cp.
code() +=
"} // block\n";
1002 cp.
code() +=
"etiss_coverage_count(1, 1433);\n";
1003 cp.
code() +=
"{ // block\n";
1005 cp.
code() +=
"etiss_coverage_count(6, 1432, 1427, 1431, 1428, 1430, 1429);\n";
1006 cp.
code() +=
"} // block\n";
1009 cp.
code() +=
"} // block\n";
1011 cp.
code() +=
"} // conditional\n";
1012 cp.
code() +=
"} // block\n";
1015 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1022 cp.
code() = std::string(
"//BLTU\n");
1025 cp.
code() +=
"if (cpu->return_pending || cpu->exception || cpu->nextPc != " + std::to_string(ic.
current_address_ + 4) +
"ULL) return cpu->exception;\n";
1037 imm += R_imm_11.read(ba) << 11;
1039 imm += R_imm_1.read(ba) << 1;
1042 rs1 += R_rs1_0.read(ba) << 0;
1045 rs2 += R_rs2_0.read(ba) << 0;
1047 imm += R_imm_5.read(ba) << 5;
1049 imm += R_imm_12.read(ba) << 12;
1053 std::stringstream ss;
1055 ss <<
"bltu" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1077 imm += R_imm_11.
read(ba) << 11;
1079 imm += R_imm_1.
read(ba) << 1;
1082 rs1 += R_rs1_0.
read(ba) << 0;
1085 rs2 += R_rs2_0.
read(ba) << 0;
1087 imm += R_imm_5.
read(ba) << 5;
1089 imm += R_imm_12.
read(ba) << 12;
1096 cp.
code() = std::string(
"//BGEU\n");
1099 cp.
code() +=
"etiss_coverage_count(1, 9);\n";
1101 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1102 cp.
code() +=
"{ // block\n";
1104 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1105 cp.
code() +=
"} // block\n";
1108 cp.
code() +=
"etiss_coverage_count(1, 1464);\n";
1109 cp.
code() +=
"{ // block\n";
1110 cp.
code() +=
"etiss_coverage_count(1, 1436);\n";
1111 cp.
code() +=
"if (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] >= *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) { // conditional\n";
1112 cp.
code() +=
"etiss_coverage_count(7, 1447, 1441, 1440, 1438, 1446, 1445, 1443);\n";
1114 cp.
code() +=
"etiss_coverage_count(1, 1463);\n";
1115 cp.
code() +=
"{ // block\n";
1116 cp.
code() +=
"etiss_coverage_count(1, 1448);\n";
1118 cp.
code() +=
"etiss_coverage_count(2, 1451, 1449);\n";
1120 cp.
code() +=
"etiss_coverage_count(1, 1455);\n";
1121 cp.
code() +=
"{ // block\n";
1123 cp.
code() +=
"{ // procedure\n";
1124 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";
1125 cp.
code() +=
"etiss_coverage_count(2, 1454, 1452);\n";
1127 cp.
code() +=
"} // procedure\n";
1129 cp.
code() +=
"} // block\n";
1134 cp.
code() +=
"etiss_coverage_count(1, 1462);\n";
1135 cp.
code() +=
"{ // block\n";
1137 cp.
code() +=
"etiss_coverage_count(6, 1461, 1456, 1460, 1457, 1459, 1458);\n";
1138 cp.
code() +=
"} // block\n";
1141 cp.
code() +=
"} // block\n";
1143 cp.
code() +=
"} // conditional\n";
1144 cp.
code() +=
"} // block\n";
1147 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1154 cp.
code() = std::string(
"//BGEU\n");
1157 cp.
code() +=
"if (cpu->return_pending || cpu->exception || cpu->nextPc != " + std::to_string(ic.
current_address_ + 4) +
"ULL) return cpu->exception;\n";
1169 imm += R_imm_11.read(ba) << 11;
1171 imm += R_imm_1.read(ba) << 1;
1174 rs1 += R_rs1_0.read(ba) << 0;
1177 rs2 += R_rs2_0.read(ba) << 0;
1179 imm += R_imm_5.read(ba) << 5;
1181 imm += R_imm_12.read(ba) << 12;
1185 std::stringstream ss;
1187 ss <<
"bgeu" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1209 rd += R_rd_0.
read(ba) << 0;
1212 rs1 += R_rs1_0.
read(ba) << 0;
1215 imm += R_imm_0.
read(ba) << 0;
1222 cp.
code() = std::string(
"//LB\n");
1225 cp.
code() +=
"etiss_coverage_count(1, 10);\n";
1227 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1228 cp.
code() +=
"{ // block\n";
1230 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1231 cp.
code() +=
"} // block\n";
1234 cp.
code() +=
"etiss_coverage_count(1, 1498);\n";
1235 cp.
code() +=
"{ // block\n";
1236 cp.
code() +=
"etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
1237 cp.
code() +=
"etiss_coverage_count(7, 1474, 1473, 1470, 1469, 1467, 1472, 1471);\n";
1238 cp.
code() +=
"etiss_uint8 mem_val_0;\n";
1239 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 1);\n";
1240 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1242 cp.
code() +=
"{ // procedure\n";
1243 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1245 cp.
code() +=
"} // procedure\n";
1247 cp.
code() +=
"} // conditional\n";
1248 cp.
code() +=
"etiss_int8 res = (etiss_int8)(mem_val_0);\n";
1249 cp.
code() +=
"etiss_coverage_count(4, 1481, 1480, 1478, 1477);\n";
1250 cp.
code() +=
"etiss_coverage_count(1, 1482);\n";
1251 if ((rd % 32ULL) != 0LL) {
1252 cp.
code() +=
"etiss_coverage_count(5, 1488, 1485, 1483, 1486, 1487);\n";
1253 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint32)(res);\n";
1254 cp.
code() +=
"etiss_coverage_count(6, 1497, 1493, 1492, 1490, 1496, 1494);\n";
1256 cp.
code() +=
"} // block\n";
1259 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1266 cp.
code() = std::string(
"//LB\n");
1269 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1281 rd += R_rd_0.read(ba) << 0;
1284 rs1 += R_rs1_0.read(ba) << 0;
1287 imm += R_imm_0.read(ba) << 0;
1291 std::stringstream ss;
1293 ss <<
"lb" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
1315 rd += R_rd_0.
read(ba) << 0;
1318 rs1 += R_rs1_0.
read(ba) << 0;
1321 imm += R_imm_0.
read(ba) << 0;
1328 cp.
code() = std::string(
"//LH\n");
1331 cp.
code() +=
"etiss_coverage_count(1, 11);\n";
1333 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1334 cp.
code() +=
"{ // block\n";
1336 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1337 cp.
code() +=
"} // block\n";
1340 cp.
code() +=
"etiss_coverage_count(1, 1532);\n";
1341 cp.
code() +=
"{ // block\n";
1342 cp.
code() +=
"etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
1343 cp.
code() +=
"etiss_coverage_count(7, 1508, 1507, 1504, 1503, 1501, 1506, 1505);\n";
1344 cp.
code() +=
"etiss_uint16 mem_val_0;\n";
1345 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 2);\n";
1346 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1348 cp.
code() +=
"{ // procedure\n";
1349 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1351 cp.
code() +=
"} // procedure\n";
1353 cp.
code() +=
"} // conditional\n";
1354 cp.
code() +=
"etiss_int16 res = (etiss_int16)(mem_val_0);\n";
1355 cp.
code() +=
"etiss_coverage_count(4, 1515, 1514, 1512, 1511);\n";
1356 cp.
code() +=
"etiss_coverage_count(1, 1516);\n";
1357 if ((rd % 32ULL) != 0LL) {
1358 cp.
code() +=
"etiss_coverage_count(5, 1522, 1519, 1517, 1520, 1521);\n";
1359 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint32)(res);\n";
1360 cp.
code() +=
"etiss_coverage_count(6, 1531, 1527, 1526, 1524, 1530, 1528);\n";
1362 cp.
code() +=
"} // block\n";
1365 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1372 cp.
code() = std::string(
"//LH\n");
1375 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1387 rd += R_rd_0.read(ba) << 0;
1390 rs1 += R_rs1_0.read(ba) << 0;
1393 imm += R_imm_0.read(ba) << 0;
1397 std::stringstream ss;
1399 ss <<
"lh" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
1421 rd += R_rd_0.
read(ba) << 0;
1424 rs1 += R_rs1_0.
read(ba) << 0;
1427 imm += R_imm_0.
read(ba) << 0;
1434 cp.
code() = std::string(
"//LW\n");
1437 cp.
code() +=
"etiss_coverage_count(1, 12);\n";
1439 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1440 cp.
code() +=
"{ // block\n";
1442 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1443 cp.
code() +=
"} // block\n";
1446 cp.
code() +=
"etiss_coverage_count(1, 1566);\n";
1447 cp.
code() +=
"{ // block\n";
1448 cp.
code() +=
"etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
1449 cp.
code() +=
"etiss_coverage_count(7, 1542, 1541, 1538, 1537, 1535, 1540, 1539);\n";
1450 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
1451 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 4);\n";
1452 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1454 cp.
code() +=
"{ // procedure\n";
1455 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1457 cp.
code() +=
"} // procedure\n";
1459 cp.
code() +=
"} // conditional\n";
1460 cp.
code() +=
"etiss_int32 res = (etiss_int32)(mem_val_0);\n";
1461 cp.
code() +=
"etiss_coverage_count(4, 1549, 1548, 1546, 1545);\n";
1462 cp.
code() +=
"etiss_coverage_count(1, 1550);\n";
1463 if ((rd % 32ULL) != 0LL) {
1464 cp.
code() +=
"etiss_coverage_count(5, 1556, 1553, 1551, 1554, 1555);\n";
1465 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint32)(res);\n";
1466 cp.
code() +=
"etiss_coverage_count(6, 1565, 1561, 1560, 1558, 1564, 1562);\n";
1468 cp.
code() +=
"} // block\n";
1471 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1478 cp.
code() = std::string(
"//LW\n");
1481 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1493 rd += R_rd_0.read(ba) << 0;
1496 rs1 += R_rs1_0.read(ba) << 0;
1499 imm += R_imm_0.read(ba) << 0;
1503 std::stringstream ss;
1505 ss <<
"lw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
1527 rd += R_rd_0.
read(ba) << 0;
1530 rs1 += R_rs1_0.
read(ba) << 0;
1533 imm += R_imm_0.
read(ba) << 0;
1540 cp.
code() = std::string(
"//LBU\n");
1543 cp.
code() +=
"etiss_coverage_count(1, 13);\n";
1545 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1546 cp.
code() +=
"{ // block\n";
1548 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1549 cp.
code() +=
"} // block\n";
1552 cp.
code() +=
"etiss_coverage_count(1, 1600);\n";
1553 cp.
code() +=
"{ // block\n";
1554 cp.
code() +=
"etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
1555 cp.
code() +=
"etiss_coverage_count(7, 1576, 1575, 1572, 1571, 1569, 1574, 1573);\n";
1556 cp.
code() +=
"etiss_uint8 mem_val_0;\n";
1557 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 1);\n";
1558 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1560 cp.
code() +=
"{ // procedure\n";
1561 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1563 cp.
code() +=
"} // procedure\n";
1565 cp.
code() +=
"} // conditional\n";
1566 cp.
code() +=
"etiss_uint8 res = (etiss_uint8)(mem_val_0);\n";
1567 cp.
code() +=
"etiss_coverage_count(4, 1583, 1582, 1580, 1579);\n";
1568 cp.
code() +=
"etiss_coverage_count(1, 1584);\n";
1569 if ((rd % 32ULL) != 0LL) {
1570 cp.
code() +=
"etiss_coverage_count(5, 1590, 1587, 1585, 1588, 1589);\n";
1571 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint32)(res);\n";
1572 cp.
code() +=
"etiss_coverage_count(6, 1599, 1595, 1594, 1592, 1598, 1596);\n";
1574 cp.
code() +=
"} // block\n";
1577 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1584 cp.
code() = std::string(
"//LBU\n");
1587 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1599 rd += R_rd_0.read(ba) << 0;
1602 rs1 += R_rs1_0.read(ba) << 0;
1605 imm += R_imm_0.read(ba) << 0;
1609 std::stringstream ss;
1611 ss <<
"lbu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
1633 rd += R_rd_0.
read(ba) << 0;
1636 rs1 += R_rs1_0.
read(ba) << 0;
1639 imm += R_imm_0.
read(ba) << 0;
1646 cp.
code() = std::string(
"//LHU\n");
1649 cp.
code() +=
"etiss_coverage_count(1, 14);\n";
1651 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1652 cp.
code() +=
"{ // block\n";
1654 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1655 cp.
code() +=
"} // block\n";
1658 cp.
code() +=
"etiss_coverage_count(1, 1634);\n";
1659 cp.
code() +=
"{ // block\n";
1660 cp.
code() +=
"etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
1661 cp.
code() +=
"etiss_coverage_count(7, 1610, 1609, 1606, 1605, 1603, 1608, 1607);\n";
1662 cp.
code() +=
"etiss_uint16 mem_val_0;\n";
1663 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 2);\n";
1664 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1666 cp.
code() +=
"{ // procedure\n";
1667 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1669 cp.
code() +=
"} // procedure\n";
1671 cp.
code() +=
"} // conditional\n";
1672 cp.
code() +=
"etiss_uint16 res = (etiss_uint16)(mem_val_0);\n";
1673 cp.
code() +=
"etiss_coverage_count(4, 1617, 1616, 1614, 1613);\n";
1674 cp.
code() +=
"etiss_coverage_count(1, 1618);\n";
1675 if ((rd % 32ULL) != 0LL) {
1676 cp.
code() +=
"etiss_coverage_count(5, 1624, 1621, 1619, 1622, 1623);\n";
1677 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint32)(res);\n";
1678 cp.
code() +=
"etiss_coverage_count(6, 1633, 1629, 1628, 1626, 1632, 1630);\n";
1680 cp.
code() +=
"} // block\n";
1683 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1690 cp.
code() = std::string(
"//LHU\n");
1693 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1705 rd += R_rd_0.read(ba) << 0;
1708 rs1 += R_rs1_0.read(ba) << 0;
1711 imm += R_imm_0.read(ba) << 0;
1715 std::stringstream ss;
1717 ss <<
"lhu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
1739 imm += R_imm_0.
read(ba) << 0;
1742 rs1 += R_rs1_0.
read(ba) << 0;
1745 rs2 += R_rs2_0.
read(ba) << 0;
1747 imm += R_imm_5.
read(ba) << 5;
1754 cp.
code() = std::string(
"//SB\n");
1757 cp.
code() +=
"etiss_coverage_count(1, 15);\n";
1759 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1760 cp.
code() +=
"{ // block\n";
1762 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1763 cp.
code() +=
"} // block\n";
1766 cp.
code() +=
"etiss_coverage_count(1, 1656);\n";
1767 cp.
code() +=
"{ // block\n";
1768 cp.
code() +=
"etiss_uint32 store_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
1769 cp.
code() +=
"etiss_coverage_count(7, 1644, 1643, 1640, 1639, 1637, 1642, 1641);\n";
1770 cp.
code() +=
"etiss_uint8 mem_val_0;\n";
1771 cp.
code() +=
"mem_val_0 = (etiss_int8)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
1772 cp.
code() +=
"etiss_coverage_count(7, 1655, 1647, 1646, 1654, 1652, 1651, 1649);\n";
1773 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, store_address, (etiss_uint8*)&mem_val_0, 1);\n";
1774 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1776 cp.
code() +=
"{ // procedure\n";
1777 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1779 cp.
code() +=
"} // procedure\n";
1781 cp.
code() +=
"} // conditional\n";
1782 cp.
code() +=
"} // block\n";
1785 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1792 cp.
code() = std::string(
"//SB\n");
1795 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1807 imm += R_imm_0.read(ba) << 0;
1810 rs1 += R_rs1_0.read(ba) << 0;
1813 rs2 += R_rs2_0.read(ba) << 0;
1815 imm += R_imm_5.read(ba) << 5;
1819 std::stringstream ss;
1821 ss <<
"sb" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1843 imm += R_imm_0.
read(ba) << 0;
1846 rs1 += R_rs1_0.
read(ba) << 0;
1849 rs2 += R_rs2_0.
read(ba) << 0;
1851 imm += R_imm_5.
read(ba) << 5;
1858 cp.
code() = std::string(
"//SH\n");
1861 cp.
code() +=
"etiss_coverage_count(1, 16);\n";
1863 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1864 cp.
code() +=
"{ // block\n";
1866 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1867 cp.
code() +=
"} // block\n";
1870 cp.
code() +=
"etiss_coverage_count(1, 1678);\n";
1871 cp.
code() +=
"{ // block\n";
1872 cp.
code() +=
"etiss_uint32 store_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
1873 cp.
code() +=
"etiss_coverage_count(7, 1666, 1665, 1662, 1661, 1659, 1664, 1663);\n";
1874 cp.
code() +=
"etiss_uint16 mem_val_0;\n";
1875 cp.
code() +=
"mem_val_0 = (etiss_int16)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
1876 cp.
code() +=
"etiss_coverage_count(7, 1677, 1669, 1668, 1676, 1674, 1673, 1671);\n";
1877 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, store_address, (etiss_uint8*)&mem_val_0, 2);\n";
1878 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1880 cp.
code() +=
"{ // procedure\n";
1881 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1883 cp.
code() +=
"} // procedure\n";
1885 cp.
code() +=
"} // conditional\n";
1886 cp.
code() +=
"} // block\n";
1889 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1896 cp.
code() = std::string(
"//SH\n");
1899 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1911 imm += R_imm_0.read(ba) << 0;
1914 rs1 += R_rs1_0.read(ba) << 0;
1917 rs2 += R_rs2_0.read(ba) << 0;
1919 imm += R_imm_5.read(ba) << 5;
1923 std::stringstream ss;
1925 ss <<
"sh" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1947 imm += R_imm_0.
read(ba) << 0;
1950 rs1 += R_rs1_0.
read(ba) << 0;
1953 rs2 += R_rs2_0.
read(ba) << 0;
1955 imm += R_imm_5.
read(ba) << 5;
1962 cp.
code() = std::string(
"//SW\n");
1965 cp.
code() +=
"etiss_coverage_count(1, 17);\n";
1967 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1968 cp.
code() +=
"{ // block\n";
1970 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1971 cp.
code() +=
"} // block\n";
1974 cp.
code() +=
"etiss_coverage_count(1, 1700);\n";
1975 cp.
code() +=
"{ // block\n";
1976 cp.
code() +=
"etiss_uint32 store_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
1977 cp.
code() +=
"etiss_coverage_count(7, 1688, 1687, 1684, 1683, 1681, 1686, 1685);\n";
1978 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
1979 cp.
code() +=
"mem_val_0 = (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
1980 cp.
code() +=
"etiss_coverage_count(7, 1699, 1691, 1690, 1698, 1696, 1695, 1693);\n";
1981 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, store_address, (etiss_uint8*)&mem_val_0, 4);\n";
1982 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1984 cp.
code() +=
"{ // procedure\n";
1985 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1987 cp.
code() +=
"} // procedure\n";
1989 cp.
code() +=
"} // conditional\n";
1990 cp.
code() +=
"} // block\n";
1993 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2000 cp.
code() = std::string(
"//SW\n");
2003 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
2015 imm += R_imm_0.read(ba) << 0;
2018 rs1 += R_rs1_0.read(ba) << 0;
2021 rs2 += R_rs2_0.read(ba) << 0;
2023 imm += R_imm_5.read(ba) << 5;
2027 std::stringstream ss;
2029 ss <<
"sw" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
2051 rd += R_rd_0.
read(ba) << 0;
2054 rs1 += R_rs1_0.
read(ba) << 0;
2057 imm += R_imm_0.
read(ba) << 0;
2064 cp.
code() = std::string(
"//ADDI\n");
2067 cp.
code() +=
"etiss_coverage_count(1, 18);\n";
2069 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2070 cp.
code() +=
"{ // block\n";
2072 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2073 cp.
code() +=
"} // block\n";
2075 cp.
code() +=
"etiss_coverage_count(1, 1701);\n";
2076 if ((rd % 32ULL) != 0LL) {
2077 cp.
code() +=
"etiss_coverage_count(5, 1707, 1704, 1702, 1705, 1706);\n";
2078 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
2079 cp.
code() +=
"etiss_coverage_count(10, 1721, 1712, 1711, 1709, 1720, 1717, 1716, 1714, 1719, 1718);\n";
2082 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2095 rd += R_rd_0.read(ba) << 0;
2098 rs1 += R_rs1_0.read(ba) << 0;
2101 imm += R_imm_0.read(ba) << 0;
2105 std::stringstream ss;
2107 ss <<
"addi" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
2129 rd += R_rd_0.
read(ba) << 0;
2132 rs1 += R_rs1_0.
read(ba) << 0;
2135 imm += R_imm_0.
read(ba) << 0;
2142 cp.
code() = std::string(
"//SLTI\n");
2145 cp.
code() +=
"etiss_coverage_count(1, 19);\n";
2147 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2148 cp.
code() +=
"{ // block\n";
2150 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2151 cp.
code() +=
"} // block\n";
2153 cp.
code() +=
"etiss_coverage_count(1, 1722);\n";
2154 if ((rd % 32ULL) != 0LL) {
2155 cp.
code() +=
"etiss_coverage_count(5, 1728, 1725, 1723, 1726, 1727);\n";
2156 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (((etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) < " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL)) ? (1ULL) : (0LL);\n";
2157 cp.
code() +=
"etiss_coverage_count(15, 1747, 1733, 1732, 1730, 1746, 1742, 1739, 1738, 1737, 1735, 1741, 1740, 1743, 1744, 1745);\n";
2160 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2173 rd += R_rd_0.read(ba) << 0;
2176 rs1 += R_rs1_0.read(ba) << 0;
2179 imm += R_imm_0.read(ba) << 0;
2183 std::stringstream ss;
2185 ss <<
"slti" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
2207 rd += R_rd_0.
read(ba) << 0;
2210 rs1 += R_rs1_0.
read(ba) << 0;
2213 imm += R_imm_0.
read(ba) << 0;
2220 cp.
code() = std::string(
"//SLTIU\n");
2223 cp.
code() +=
"etiss_coverage_count(1, 20);\n";
2225 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2226 cp.
code() +=
"{ // block\n";
2228 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2229 cp.
code() +=
"} // block\n";
2231 cp.
code() +=
"etiss_coverage_count(1, 1748);\n";
2232 if ((rd % 32ULL) != 0LL) {
2233 cp.
code() +=
"etiss_coverage_count(5, 1754, 1751, 1749, 1752, 1753);\n";
2234 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = ((*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] < " + std::to_string((
etiss_uint32)((((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))))) +
"ULL)) ? (1ULL) : (0LL);\n";
2235 cp.
code() +=
"etiss_coverage_count(16, 1775, 1759, 1758, 1756, 1774, 1770, 1764, 1763, 1761, 1769, 1766, 1765, 1767, 1771, 1772, 1773);\n";
2238 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2251 rd += R_rd_0.read(ba) << 0;
2254 rs1 += R_rs1_0.read(ba) << 0;
2257 imm += R_imm_0.read(ba) << 0;
2261 std::stringstream ss;
2263 ss <<
"sltiu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
2285 rd += R_rd_0.
read(ba) << 0;
2288 rs1 += R_rs1_0.
read(ba) << 0;
2291 imm += R_imm_0.
read(ba) << 0;
2298 cp.
code() = std::string(
"//XORI\n");
2301 cp.
code() +=
"etiss_coverage_count(1, 21);\n";
2303 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2304 cp.
code() +=
"{ // block\n";
2306 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2307 cp.
code() +=
"} // block\n";
2309 cp.
code() +=
"etiss_coverage_count(1, 1776);\n";
2310 if ((rd % 32ULL) != 0LL) {
2311 cp.
code() +=
"etiss_coverage_count(5, 1782, 1779, 1777, 1780, 1781);\n";
2312 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] ^ " + std::to_string((
etiss_uint32)((((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))))) +
"ULL;\n";
2313 cp.
code() +=
"etiss_coverage_count(12, 1799, 1787, 1786, 1784, 1798, 1792, 1791, 1789, 1797, 1794, 1793, 1795);\n";
2316 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2329 rd += R_rd_0.read(ba) << 0;
2332 rs1 += R_rs1_0.read(ba) << 0;
2335 imm += R_imm_0.read(ba) << 0;
2339 std::stringstream ss;
2341 ss <<
"xori" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
2363 rd += R_rd_0.
read(ba) << 0;
2366 rs1 += R_rs1_0.
read(ba) << 0;
2369 imm += R_imm_0.
read(ba) << 0;
2376 cp.
code() = std::string(
"//ORI\n");
2379 cp.
code() +=
"etiss_coverage_count(1, 22);\n";
2381 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2382 cp.
code() +=
"{ // block\n";
2384 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2385 cp.
code() +=
"} // block\n";
2387 cp.
code() +=
"etiss_coverage_count(1, 1800);\n";
2388 if ((rd % 32ULL) != 0LL) {
2389 cp.
code() +=
"etiss_coverage_count(5, 1806, 1803, 1801, 1804, 1805);\n";
2390 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] | " + std::to_string((
etiss_uint32)((((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))))) +
"ULL;\n";
2391 cp.
code() +=
"etiss_coverage_count(12, 1823, 1811, 1810, 1808, 1822, 1816, 1815, 1813, 1821, 1818, 1817, 1819);\n";
2394 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2407 rd += R_rd_0.read(ba) << 0;
2410 rs1 += R_rs1_0.read(ba) << 0;
2413 imm += R_imm_0.read(ba) << 0;
2417 std::stringstream ss;
2419 ss <<
"ori" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
2441 rd += R_rd_0.
read(ba) << 0;
2444 rs1 += R_rs1_0.
read(ba) << 0;
2447 imm += R_imm_0.
read(ba) << 0;
2454 cp.
code() = std::string(
"//ANDI\n");
2457 cp.
code() +=
"etiss_coverage_count(1, 23);\n";
2459 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2460 cp.
code() +=
"{ // block\n";
2462 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2463 cp.
code() +=
"} // block\n";
2465 cp.
code() +=
"etiss_coverage_count(1, 1824);\n";
2466 if ((rd % 32ULL) != 0LL) {
2467 cp.
code() +=
"etiss_coverage_count(5, 1830, 1827, 1825, 1828, 1829);\n";
2468 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] & " + std::to_string((
etiss_uint32)((((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))))) +
"ULL;\n";
2469 cp.
code() +=
"etiss_coverage_count(12, 1847, 1835, 1834, 1832, 1846, 1840, 1839, 1837, 1845, 1842, 1841, 1843);\n";
2472 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2485 rd += R_rd_0.read(ba) << 0;
2488 rs1 += R_rs1_0.read(ba) << 0;
2491 imm += R_imm_0.read(ba) << 0;
2495 std::stringstream ss;
2497 ss <<
"andi" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
2519 rd += R_rd_0.
read(ba) << 0;
2522 rs1 += R_rs1_0.
read(ba) << 0;
2525 shamt += R_shamt_0.
read(ba) << 0;
2532 cp.
code() = std::string(
"//SLLI\n");
2535 cp.
code() +=
"etiss_coverage_count(1, 24);\n";
2537 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2538 cp.
code() +=
"{ // block\n";
2540 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2541 cp.
code() +=
"} // block\n";
2543 cp.
code() +=
"etiss_coverage_count(1, 1848);\n";
2544 if ((rd % 32ULL) != 0LL) {
2545 cp.
code() +=
"etiss_coverage_count(5, 1854, 1851, 1849, 1852, 1853);\n";
2546 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] << " + std::to_string(shamt) +
"ULL;\n";
2547 cp.
code() +=
"etiss_coverage_count(9, 1867, 1859, 1858, 1856, 1866, 1864, 1863, 1861, 1865);\n";
2550 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2563 rd += R_rd_0.read(ba) << 0;
2566 rs1 += R_rs1_0.read(ba) << 0;
2569 shamt += R_shamt_0.read(ba) << 0;
2573 std::stringstream ss;
2575 ss <<
"slli" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
2597 rd += R_rd_0.
read(ba) << 0;
2600 rs1 += R_rs1_0.
read(ba) << 0;
2603 shamt += R_shamt_0.
read(ba) << 0;
2610 cp.
code() = std::string(
"//SRLI\n");
2613 cp.
code() +=
"etiss_coverage_count(1, 25);\n";
2615 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2616 cp.
code() +=
"{ // block\n";
2618 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2619 cp.
code() +=
"} // block\n";
2621 cp.
code() +=
"etiss_coverage_count(1, 1868);\n";
2622 if ((rd % 32ULL) != 0LL) {
2623 cp.
code() +=
"etiss_coverage_count(5, 1874, 1871, 1869, 1872, 1873);\n";
2624 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] >> " + std::to_string(shamt) +
"ULL;\n";
2625 cp.
code() +=
"etiss_coverage_count(9, 1887, 1879, 1878, 1876, 1886, 1884, 1883, 1881, 1885);\n";
2628 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2641 rd += R_rd_0.read(ba) << 0;
2644 rs1 += R_rs1_0.read(ba) << 0;
2647 shamt += R_shamt_0.read(ba) << 0;
2651 std::stringstream ss;
2653 ss <<
"srli" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
2675 rd += R_rd_0.
read(ba) << 0;
2678 rs1 += R_rs1_0.
read(ba) << 0;
2681 shamt += R_shamt_0.
read(ba) << 0;
2688 cp.
code() = std::string(
"//SRAI\n");
2691 cp.
code() +=
"etiss_coverage_count(1, 26);\n";
2693 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2694 cp.
code() +=
"{ // block\n";
2696 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2697 cp.
code() +=
"} // block\n";
2699 cp.
code() +=
"etiss_coverage_count(1, 1888);\n";
2700 if ((rd % 32ULL) != 0LL) {
2701 cp.
code() +=
"etiss_coverage_count(5, 1894, 1891, 1889, 1892, 1893);\n";
2702 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) >> " + std::to_string(shamt) +
"ULL;\n";
2703 cp.
code() +=
"etiss_coverage_count(10, 1909, 1899, 1898, 1896, 1908, 1906, 1904, 1903, 1901, 1907);\n";
2706 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2719 rd += R_rd_0.read(ba) << 0;
2722 rs1 += R_rs1_0.read(ba) << 0;
2725 shamt += R_shamt_0.read(ba) << 0;
2729 std::stringstream ss;
2731 ss <<
"srai" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
2753 rd += R_rd_0.
read(ba) << 0;
2756 rs1 += R_rs1_0.
read(ba) << 0;
2759 rs2 += R_rs2_0.
read(ba) << 0;
2766 cp.
code() = std::string(
"//ADD\n");
2769 cp.
code() +=
"etiss_coverage_count(1, 27);\n";
2771 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2772 cp.
code() +=
"{ // block\n";
2774 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2775 cp.
code() +=
"} // block\n";
2777 cp.
code() +=
"etiss_coverage_count(1, 1910);\n";
2778 if ((rd % 32ULL) != 0LL) {
2779 cp.
code() +=
"etiss_coverage_count(5, 1916, 1913, 1911, 1914, 1915);\n";
2780 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
2781 cp.
code() +=
"etiss_coverage_count(11, 1933, 1921, 1920, 1918, 1932, 1926, 1925, 1923, 1931, 1930, 1928);\n";
2784 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2797 rd += R_rd_0.read(ba) << 0;
2800 rs1 += R_rs1_0.read(ba) << 0;
2803 rs2 += R_rs2_0.read(ba) << 0;
2807 std::stringstream ss;
2809 ss <<
"add" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
2831 rd += R_rd_0.
read(ba) << 0;
2834 rs1 += R_rs1_0.
read(ba) << 0;
2837 rs2 += R_rs2_0.
read(ba) << 0;
2844 cp.
code() = std::string(
"//SUB\n");
2847 cp.
code() +=
"etiss_coverage_count(1, 28);\n";
2849 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2850 cp.
code() +=
"{ // block\n";
2852 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2853 cp.
code() +=
"} // block\n";
2855 cp.
code() +=
"etiss_coverage_count(1, 1934);\n";
2856 if ((rd % 32ULL) != 0LL) {
2857 cp.
code() +=
"etiss_coverage_count(5, 1940, 1937, 1935, 1938, 1939);\n";
2858 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] - *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
2859 cp.
code() +=
"etiss_coverage_count(11, 1957, 1945, 1944, 1942, 1956, 1950, 1949, 1947, 1955, 1954, 1952);\n";
2862 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2875 rd += R_rd_0.read(ba) << 0;
2878 rs1 += R_rs1_0.read(ba) << 0;
2881 rs2 += R_rs2_0.read(ba) << 0;
2885 std::stringstream ss;
2887 ss <<
"sub" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
2909 rd += R_rd_0.
read(ba) << 0;
2912 rs1 += R_rs1_0.
read(ba) << 0;
2915 rs2 += R_rs2_0.
read(ba) << 0;
2922 cp.
code() = std::string(
"//SLL\n");
2925 cp.
code() +=
"etiss_coverage_count(1, 29);\n";
2927 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2928 cp.
code() +=
"{ // block\n";
2930 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2931 cp.
code() +=
"} // block\n";
2933 cp.
code() +=
"etiss_coverage_count(1, 1958);\n";
2934 if ((rd % 32ULL) != 0LL) {
2935 cp.
code() +=
"etiss_coverage_count(5, 1964, 1961, 1959, 1962, 1963);\n";
2936 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] << (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL] & 31ULL);\n";
2937 cp.
code() +=
"etiss_coverage_count(13, 1987, 1969, 1968, 1966, 1986, 1974, 1973, 1971, 1984, 1979, 1978, 1976, 1985);\n";
2940 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2953 rd += R_rd_0.read(ba) << 0;
2956 rs1 += R_rs1_0.read(ba) << 0;
2959 rs2 += R_rs2_0.read(ba) << 0;
2963 std::stringstream ss;
2965 ss <<
"sll" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
2987 rd += R_rd_0.
read(ba) << 0;
2990 rs1 += R_rs1_0.
read(ba) << 0;
2993 rs2 += R_rs2_0.
read(ba) << 0;
3000 cp.
code() = std::string(
"//SLT\n");
3003 cp.
code() +=
"etiss_coverage_count(1, 30);\n";
3005 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
3006 cp.
code() +=
"{ // block\n";
3008 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
3009 cp.
code() +=
"} // block\n";
3011 cp.
code() +=
"etiss_coverage_count(1, 1988);\n";
3012 if ((rd % 32ULL) != 0LL) {
3013 cp.
code() +=
"etiss_coverage_count(5, 1994, 1991, 1989, 1992, 1993);\n";
3014 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = ((etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) < (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL])) ? (1ULL) : (0LL);\n";
3015 cp.
code() +=
"etiss_coverage_count(16, 2016, 1999, 1998, 1996, 2015, 2012, 2005, 2004, 2003, 2001, 2011, 2010, 2009, 2007, 2013, 2014);\n";
3018 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
3031 rd += R_rd_0.read(ba) << 0;
3034 rs1 += R_rs1_0.read(ba) << 0;
3037 rs2 += R_rs2_0.read(ba) << 0;
3041 std::stringstream ss;
3043 ss <<
"slt" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
3065 rd += R_rd_0.
read(ba) << 0;
3068 rs1 += R_rs1_0.
read(ba) << 0;
3071 rs2 += R_rs2_0.
read(ba) << 0;
3078 cp.
code() = std::string(
"//SLTU\n");
3081 cp.
code() +=
"etiss_coverage_count(1, 31);\n";
3083 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
3084 cp.
code() +=
"{ // block\n";
3086 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
3087 cp.
code() +=
"} // block\n";
3089 cp.
code() +=
"etiss_coverage_count(1, 2017);\n";
3090 if ((rd % 32ULL) != 0LL) {
3091 cp.
code() +=
"etiss_coverage_count(5, 2023, 2020, 2018, 2021, 2022);\n";
3092 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] < *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) ? (1ULL) : (0LL);\n";
3093 cp.
code() +=
"etiss_coverage_count(14, 2043, 2028, 2027, 2025, 2042, 2039, 2033, 2032, 2030, 2038, 2037, 2035, 2040, 2041);\n";
3096 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
3109 rd += R_rd_0.read(ba) << 0;
3112 rs1 += R_rs1_0.read(ba) << 0;
3115 rs2 += R_rs2_0.read(ba) << 0;
3119 std::stringstream ss;
3121 ss <<
"sltu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
3143 rd += R_rd_0.
read(ba) << 0;
3146 rs1 += R_rs1_0.
read(ba) << 0;
3149 rs2 += R_rs2_0.
read(ba) << 0;
3156 cp.
code() = std::string(
"//XOR\n");
3159 cp.
code() +=
"etiss_coverage_count(1, 32);\n";
3161 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
3162 cp.
code() +=
"{ // block\n";
3164 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
3165 cp.
code() +=
"} // block\n";
3167 cp.
code() +=
"etiss_coverage_count(1, 2044);\n";
3168 if ((rd % 32ULL) != 0LL) {
3169 cp.
code() +=
"etiss_coverage_count(5, 2050, 2047, 2045, 2048, 2049);\n";
3170 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] ^ *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
3171 cp.
code() +=
"etiss_coverage_count(11, 2067, 2055, 2054, 2052, 2066, 2060, 2059, 2057, 2065, 2064, 2062);\n";
3174 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
3187 rd += R_rd_0.read(ba) << 0;
3190 rs1 += R_rs1_0.read(ba) << 0;
3193 rs2 += R_rs2_0.read(ba) << 0;
3197 std::stringstream ss;
3199 ss <<
"xor" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
3221 rd += R_rd_0.
read(ba) << 0;
3224 rs1 += R_rs1_0.
read(ba) << 0;
3227 rs2 += R_rs2_0.
read(ba) << 0;
3234 cp.
code() = std::string(
"//SRL\n");
3237 cp.
code() +=
"etiss_coverage_count(1, 33);\n";
3239 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
3240 cp.
code() +=
"{ // block\n";
3242 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
3243 cp.
code() +=
"} // block\n";
3245 cp.
code() +=
"etiss_coverage_count(1, 2068);\n";
3246 if ((rd % 32ULL) != 0LL) {
3247 cp.
code() +=
"etiss_coverage_count(5, 2074, 2071, 2069, 2072, 2073);\n";
3248 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] >> (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL] & 31ULL);\n";
3249 cp.
code() +=
"etiss_coverage_count(13, 2097, 2079, 2078, 2076, 2096, 2084, 2083, 2081, 2094, 2089, 2088, 2086, 2095);\n";
3252 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
3265 rd += R_rd_0.read(ba) << 0;
3268 rs1 += R_rs1_0.read(ba) << 0;
3271 rs2 += R_rs2_0.read(ba) << 0;
3275 std::stringstream ss;
3277 ss <<
"srl" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
3299 rd += R_rd_0.
read(ba) << 0;
3302 rs1 += R_rs1_0.
read(ba) << 0;
3305 rs2 += R_rs2_0.
read(ba) << 0;
3312 cp.
code() = std::string(
"//SRA\n");
3315 cp.
code() +=
"etiss_coverage_count(1, 34);\n";
3317 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
3318 cp.
code() +=
"{ // block\n";
3320 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
3321 cp.
code() +=
"} // block\n";
3323 cp.
code() +=
"etiss_coverage_count(1, 2098);\n";
3324 if ((rd % 32ULL) != 0LL) {
3325 cp.
code() +=
"etiss_coverage_count(5, 2104, 2101, 2099, 2102, 2103);\n";
3326 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) >> (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL] & 31ULL);\n";
3327 cp.
code() +=
"etiss_coverage_count(14, 2128, 2109, 2108, 2106, 2127, 2115, 2114, 2113, 2111, 2125, 2120, 2119, 2117, 2126);\n";
3330 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
3343 rd += R_rd_0.read(ba) << 0;
3346 rs1 += R_rs1_0.read(ba) << 0;
3349 rs2 += R_rs2_0.read(ba) << 0;
3353 std::stringstream ss;
3355 ss <<
"sra" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
3377 rd += R_rd_0.
read(ba) << 0;
3380 rs1 += R_rs1_0.
read(ba) << 0;
3383 rs2 += R_rs2_0.
read(ba) << 0;
3390 cp.
code() = std::string(
"//OR\n");
3393 cp.
code() +=
"etiss_coverage_count(1, 35);\n";
3395 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
3396 cp.
code() +=
"{ // block\n";
3398 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
3399 cp.
code() +=
"} // block\n";
3401 cp.
code() +=
"etiss_coverage_count(1, 2129);\n";
3402 if ((rd % 32ULL) != 0LL) {
3403 cp.
code() +=
"etiss_coverage_count(5, 2135, 2132, 2130, 2133, 2134);\n";
3404 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] | *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
3405 cp.
code() +=
"etiss_coverage_count(11, 2152, 2140, 2139, 2137, 2151, 2145, 2144, 2142, 2150, 2149, 2147);\n";
3408 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
3421 rd += R_rd_0.read(ba) << 0;
3424 rs1 += R_rs1_0.read(ba) << 0;
3427 rs2 += R_rs2_0.read(ba) << 0;
3431 std::stringstream ss;
3433 ss <<
"or" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
3455 rd += R_rd_0.
read(ba) << 0;
3458 rs1 += R_rs1_0.
read(ba) << 0;
3461 rs2 += R_rs2_0.
read(ba) << 0;
3468 cp.
code() = std::string(
"//AND\n");
3471 cp.
code() +=
"etiss_coverage_count(1, 36);\n";
3473 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
3474 cp.
code() +=
"{ // block\n";
3476 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
3477 cp.
code() +=
"} // block\n";
3479 cp.
code() +=
"etiss_coverage_count(1, 2153);\n";
3480 if ((rd % 32ULL) != 0LL) {
3481 cp.
code() +=
"etiss_coverage_count(5, 2159, 2156, 2154, 2157, 2158);\n";
3482 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] & *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
3483 cp.
code() +=
"etiss_coverage_count(11, 2176, 2164, 2163, 2161, 2175, 2169, 2168, 2166, 2174, 2173, 2171);\n";
3486 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
3499 rd += R_rd_0.read(ba) << 0;
3502 rs1 += R_rs1_0.read(ba) << 0;
3505 rs2 += R_rs2_0.read(ba) << 0;
3509 std::stringstream ss;
3511 ss <<
"and" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
3533 rd += R_rd_0.
read(ba) << 0;
3536 rs1 += R_rs1_0.
read(ba) << 0;
3539 succ += R_succ_0.
read(ba) << 0;
3542 pred += R_pred_0.
read(ba) << 0;
3545 fm += R_fm_0.
read(ba) << 0;
3552 cp.
code() = std::string(
"//FENCE\n");
3555 cp.
code() +=
"etiss_coverage_count(1, 37);\n";
3557 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
3558 cp.
code() +=
"{ // block\n";
3560 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
3561 cp.
code() +=
"} // block\n";
3563 cp.
code() +=
"((RV32IMACFD*)cpu)->FENCE[0ULL] = " + std::to_string(pred << 4ULL | succ) +
"ULL;\n";
3564 cp.
code() +=
"etiss_coverage_count(7, 2185, 2179, 2184, 2182, 2180, 2181, 2183);\n";
3566 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
3579 rd += R_rd_0.read(ba) << 0;
3582 rs1 += R_rs1_0.read(ba) << 0;
3585 succ += R_succ_0.read(ba) << 0;
3588 pred += R_pred_0.read(ba) << 0;
3591 fm += R_fm_0.read(ba) << 0;
3595 std::stringstream ss;
3597 ss <<
"fence" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | succ=" + std::to_string(succ) +
" | pred=" + std::to_string(pred) +
" | fm=" + std::to_string(fm) +
"]");
etiss::instr::InstructionGroup ISA32_RV32IMACFD("ISA32_RV32IMACFD", 32)
static InstructionDefinition lb_rd_rs1_imm(ISA32_RV32IMACFD, "lb",(uint32_t) 0x000003,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LB\n");cp.code()+="etiss_coverage_count(1, 10);\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, 1498);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 1474, 1473, 1470, 1469, 1467, 1472, 1471);\n";cp.code()+="etiss_uint8 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 1);\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_int8 res = (etiss_int8)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 1481, 1480, 1478, 1477);\n";cp.code()+="etiss_coverage_count(1, 1482);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1488, 1485, 1483, 1486, 1487);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint32)(res);\n";cp.code()+="etiss_coverage_count(6, 1497, 1493, 1492, 1490, 1496, 1494);\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("//LB\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(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "lb"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition sb_imm_rs1_rs2(ISA32_RV32IMACFD, "sb",(uint32_t) 0x000023,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SB\n");cp.code()+="etiss_coverage_count(1, 15);\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, 1656);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 store_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 1644, 1643, 1640, 1639, 1637, 1642, 1641);\n";cp.code()+="etiss_uint8 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_int8)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 1655, 1647, 1646, 1654, 1652, 1651, 1649);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, store_address, (etiss_uint8*)&mem_val_0, 1);\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("//SB\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "sb"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition srai_rd_rs1_shamt(ISA32_RV32IMACFD, "srai",(uint32_t) 0x40005013,(uint32_t) 0xfe00707f, [](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_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRAI\n");cp.code()+="etiss_coverage_count(1, 26);\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, 1888);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1894, 1891, 1889, 1892, 1893);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(10, 1909, 1899, 1898, 1896, 1908, 1906, 1904, 1903, 1901, 1907);\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_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "srai"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition fence_rd_rs1_succ_pred_fm(ISA32_RV32IMACFD, "fence",(uint32_t) 0x00000f,(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_uint8 succ=0;static BitArrayRange R_succ_0(23, 20);succ+=R_succ_0.read(ba)<< 0;etiss_uint8 pred=0;static BitArrayRange R_pred_0(27, 24);pred+=R_pred_0.read(ba)<< 0;etiss_uint8 fm=0;static BitArrayRange R_fm_0(31, 28);fm+=R_fm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//FENCE\n");cp.code()+="etiss_coverage_count(1, 37);\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()+="((RV32IMACFD*)cpu)->FENCE[0ULL] = "+std::to_string(pred<< 4ULL|succ)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 2185, 2179, 2184, 2182, 2180, 2181, 2183);\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_uint8 succ=0;static BitArrayRange R_succ_0(23, 20);succ+=R_succ_0.read(ba)<< 0;etiss_uint8 pred=0;static BitArrayRange R_pred_0(27, 24);pred+=R_pred_0.read(ba)<< 0;etiss_uint8 fm=0;static BitArrayRange R_fm_0(31, 28);fm+=R_fm_0.read(ba)<< 0;std::stringstream ss;ss<< "fence"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | succ="+std::to_string(succ)+" | pred="+std::to_string(pred)+" | fm="+std::to_string(fm)+"]");return ss.str();})
static InstructionDefinition auipc_rd_imm(ISA32_RV32IMACFD, "auipc",(uint32_t) 0x000017,(uint32_t) 0x00007f, [](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_uint32 imm=0;static BitArrayRange R_imm_12(31, 12);imm+=R_imm_12.read(ba)<< 12;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AUIPC\n");cp.code()+="etiss_coverage_count(1, 1);\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, 1188);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1194, 1191, 1189, 1192, 1193);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = "+std::to_string(ic.current_address_+(etiss_int32)(imm))+"LL;\n";cp.code()+="etiss_coverage_count(8, 1204, 1199, 1198, 1196, 1203, 1200, 1202, 1201);\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_uint32 imm=0;static BitArrayRange R_imm_12(31, 12);imm+=R_imm_12.read(ba)<< 12;std::stringstream ss;ss<< "auipc"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition jal_rd_imm(ISA32_RV32IMACFD, "jal",(uint32_t) 0x00006f,(uint32_t) 0x00007f, [](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_uint32 imm=0;static BitArrayRange R_imm_12(19, 12);imm+=R_imm_12.read(ba)<< 12;static BitArrayRange R_imm_11(20, 20);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(30, 21);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_20(31, 31);imm+=R_imm_20.read(ba)<< 20;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//JAL\n");cp.code()+="etiss_coverage_count(1, 2);\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, 1236);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1205);\n";if(imm % 2ULL) { cp.code()+="etiss_coverage_count(2, 1208, 1206);\n";{ cp.code()+="etiss_coverage_count(1, 1212);\n";cp.code()+="{ // block\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";cp.code()+="etiss_coverage_count(2, 1211, 1209);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // block\n";} } else { { cp.code()+="etiss_coverage_count(1, 1235);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1213);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1219, 1216, 1214, 1217, 1218);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = "+std::to_string(ic.current_address_+4ULL)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 1228, 1224, 1223, 1221, 1227, 1225, 1226);\n";} cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int32)(((etiss_int32) imm)<<(11)) >>(11)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 1234, 1229, 1233, 1230, 1232, 1231);\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("//JAL\n");cp.code()+="return cpu->exception;\n";} 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_uint32 imm=0;static BitArrayRange R_imm_12(19, 12);imm+=R_imm_12.read(ba)<< 12;static BitArrayRange R_imm_11(20, 20);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(30, 21);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_20(31, 31);imm+=R_imm_20.read(ba)<< 20;std::stringstream ss;ss<< "jal"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition srl_rd_rs1_rs2(ISA32_RV32IMACFD, "srl",(uint32_t) 0x005033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRL\n");cp.code()+="etiss_coverage_count(1, 33);\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, 2068);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2074, 2071, 2069, 2072, 2073);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] >> (*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL] & 31ULL);\n";cp.code()+="etiss_coverage_count(13, 2097, 2079, 2078, 2076, 2096, 2084, 2083, 2081, 2094, 2089, 2088, 2086, 2095);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "srl"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition and_rd_rs1_rs2(ISA32_RV32IMACFD, "and",(uint32_t) 0x007033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AND\n");cp.code()+="etiss_coverage_count(1, 36);\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, 2153);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2159, 2156, 2154, 2157, 2158);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] & *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(11, 2176, 2164, 2163, 2161, 2175, 2169, 2168, 2166, 2174, 2173, 2171);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "and"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition bge_imm_rs1_rs2(ISA32_RV32IMACFD, "bge",(uint32_t) 0x005063,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//BGE\n");cp.code()+="etiss_coverage_count(1, 7);\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, 1406);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1374);\n";cp.code()+="if ((etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) >= (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) { // conditional\n";cp.code()+="etiss_coverage_count(9, 1389, 1381, 1379, 1378, 1376, 1388, 1386, 1385, 1383);\n";{ cp.code()+="etiss_coverage_count(1, 1405);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1390);\n";if(imm % 2ULL) { cp.code()+="etiss_coverage_count(2, 1393, 1391);\n";{ cp.code()+="etiss_coverage_count(1, 1397);\n";cp.code()+="{ // block\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";cp.code()+="etiss_coverage_count(2, 1396, 1394);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // block\n";} } else { { cp.code()+="etiss_coverage_count(1, 1404);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(3)) >>(3)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 1403, 1398, 1402, 1399, 1401, 1400);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\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("//BGE\n");cp.code()+="if (cpu->return_pending || cpu->exception || cpu->nextPc != "+std::to_string(ic.current_address_+4)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;std::stringstream ss;ss<< "bge"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition slli_rd_rs1_shamt(ISA32_RV32IMACFD, "slli",(uint32_t) 0x001013,(uint32_t) 0xfe00707f, [](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_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLLI\n");cp.code()+="etiss_coverage_count(1, 24);\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, 1848);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1854, 1851, 1849, 1852, 1853);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] << "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 1867, 1859, 1858, 1856, 1866, 1864, 1863, 1861, 1865);\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_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "slli"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition beq_imm_rs1_rs2(ISA32_RV32IMACFD, "beq",(uint32_t) 0x000063,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//BEQ\n");cp.code()+="etiss_coverage_count(1, 4);\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, 1311);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1283);\n";cp.code()+="if (*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] == *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) { // conditional\n";cp.code()+="etiss_coverage_count(7, 1294, 1288, 1287, 1285, 1293, 1292, 1290);\n";{ cp.code()+="etiss_coverage_count(1, 1310);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1295);\n";if(imm % 2ULL) { cp.code()+="etiss_coverage_count(2, 1298, 1296);\n";{ cp.code()+="etiss_coverage_count(1, 1302);\n";cp.code()+="{ // block\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";cp.code()+="etiss_coverage_count(2, 1301, 1299);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // block\n";} } else { { cp.code()+="etiss_coverage_count(1, 1309);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(3)) >>(3)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 1308, 1303, 1307, 1304, 1306, 1305);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\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("//BEQ\n");cp.code()+="if (cpu->return_pending || cpu->exception || cpu->nextPc != "+std::to_string(ic.current_address_+4)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;std::stringstream ss;ss<< "beq"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition lh_rd_rs1_imm(ISA32_RV32IMACFD, "lh",(uint32_t) 0x001003,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LH\n");cp.code()+="etiss_coverage_count(1, 11);\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, 1532);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 1508, 1507, 1504, 1503, 1501, 1506, 1505);\n";cp.code()+="etiss_uint16 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 2);\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_int16 res = (etiss_int16)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 1515, 1514, 1512, 1511);\n";cp.code()+="etiss_coverage_count(1, 1516);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1522, 1519, 1517, 1520, 1521);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint32)(res);\n";cp.code()+="etiss_coverage_count(6, 1531, 1527, 1526, 1524, 1530, 1528);\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("//LH\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(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "lh"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition xor_rd_rs1_rs2(ISA32_RV32IMACFD, "xor",(uint32_t) 0x004033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//XOR\n");cp.code()+="etiss_coverage_count(1, 32);\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, 2044);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2050, 2047, 2045, 2048, 2049);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] ^ *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(11, 2067, 2055, 2054, 2052, 2066, 2060, 2059, 2057, 2065, 2064, 2062);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "xor"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition slt_rd_rs1_rs2(ISA32_RV32IMACFD, "slt",(uint32_t) 0x002033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLT\n");cp.code()+="etiss_coverage_count(1, 30);\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, 1988);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1994, 1991, 1989, 1992, 1993);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = ((etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) < (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) ? (1ULL) : (0LL);\n";cp.code()+="etiss_coverage_count(16, 2016, 1999, 1998, 1996, 2015, 2012, 2005, 2004, 2003, 2001, 2011, 2010, 2009, 2007, 2013, 2014);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "slt"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition jalr_rd_rs1_imm(ISA32_RV32IMACFD, "jalr",(uint32_t) 0x000067,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//JALR\n");cp.code()+="etiss_coverage_count(1, 3);\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, 1282);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 new_pc = (*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL) & -2LL;\n";cp.code()+="etiss_coverage_count(9, 1250, 1249, 1245, 1242, 1241, 1239, 1244, 1243, 1246);\n";cp.code()+="etiss_coverage_count(1, 1251);\n";cp.code()+="if (new_pc % 2ULL) { // conditional\n";cp.code()+="etiss_coverage_count(2, 1254, 1252);\n";{ cp.code()+="etiss_coverage_count(1, 1258);\n";cp.code()+="{ // block\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";cp.code()+="etiss_coverage_count(2, 1257, 1255);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // block\n";} cp.code()+="} // conditional\n";cp.code()+="else { // conditional\n";{ cp.code()+="etiss_coverage_count(1, 1281);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1259);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1265, 1262, 1260, 1263, 1264);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = "+std::to_string(ic.current_address_+4ULL)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 1274, 1270, 1269, 1267, 1273, 1271, 1272);\n";} cp.code()+="cpu->nextPc = new_pc & -2LL;\n";cp.code()+="etiss_coverage_count(4, 1280, 1275, 1279, 1276);\n";cp.code()+="} // block\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("//JALR\n");cp.code()+="return cpu->exception;\n";} 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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "jalr"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition bne_imm_rs1_rs2(ISA32_RV32IMACFD, "bne",(uint32_t) 0x001063,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//BNE\n");cp.code()+="etiss_coverage_count(1, 5);\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, 1340);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1312);\n";cp.code()+="if (*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] != *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) { // conditional\n";cp.code()+="etiss_coverage_count(7, 1323, 1317, 1316, 1314, 1322, 1321, 1319);\n";{ cp.code()+="etiss_coverage_count(1, 1339);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1324);\n";if(imm % 2ULL) { cp.code()+="etiss_coverage_count(2, 1327, 1325);\n";{ cp.code()+="etiss_coverage_count(1, 1331);\n";cp.code()+="{ // block\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";cp.code()+="etiss_coverage_count(2, 1330, 1328);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // block\n";} } else { { cp.code()+="etiss_coverage_count(1, 1338);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(3)) >>(3)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 1337, 1332, 1336, 1333, 1335, 1334);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\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("//BNE\n");cp.code()+="if (cpu->return_pending || cpu->exception || cpu->nextPc != "+std::to_string(ic.current_address_+4)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;std::stringstream ss;ss<< "bne"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition lhu_rd_rs1_imm(ISA32_RV32IMACFD, "lhu",(uint32_t) 0x005003,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LHU\n");cp.code()+="etiss_coverage_count(1, 14);\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, 1634);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 1610, 1609, 1606, 1605, 1603, 1608, 1607);\n";cp.code()+="etiss_uint16 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 2);\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_uint16 res = (etiss_uint16)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 1617, 1616, 1614, 1613);\n";cp.code()+="etiss_coverage_count(1, 1618);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1624, 1621, 1619, 1622, 1623);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint32)(res);\n";cp.code()+="etiss_coverage_count(6, 1633, 1629, 1628, 1626, 1632, 1630);\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("//LHU\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(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "lhu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition blt_imm_rs1_rs2(ISA32_RV32IMACFD, "blt",(uint32_t) 0x004063,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//BLT\n");cp.code()+="etiss_coverage_count(1, 6);\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, 1373);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1341);\n";cp.code()+="if ((etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) < (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) { // conditional\n";cp.code()+="etiss_coverage_count(9, 1356, 1348, 1346, 1345, 1343, 1355, 1353, 1352, 1350);\n";{ cp.code()+="etiss_coverage_count(1, 1372);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1357);\n";if(imm % 2ULL) { cp.code()+="etiss_coverage_count(2, 1360, 1358);\n";{ cp.code()+="etiss_coverage_count(1, 1364);\n";cp.code()+="{ // block\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";cp.code()+="etiss_coverage_count(2, 1363, 1361);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // block\n";} } else { { cp.code()+="etiss_coverage_count(1, 1371);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(3)) >>(3)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 1370, 1365, 1369, 1366, 1368, 1367);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\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("//BLT\n");cp.code()+="if (cpu->return_pending || cpu->exception || cpu->nextPc != "+std::to_string(ic.current_address_+4)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;std::stringstream ss;ss<< "blt"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition addi_rd_rs1_imm(ISA32_RV32IMACFD, "addi",(uint32_t) 0x000013,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//ADDI\n");cp.code()+="etiss_coverage_count(1, 18);\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, 1701);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1707, 1704, 1702, 1705, 1706);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(10, 1721, 1712, 1711, 1709, 1720, 1717, 1716, 1714, 1719, 1718);\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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "addi"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition bltu_imm_rs1_rs2(ISA32_RV32IMACFD, "bltu",(uint32_t) 0x006063,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//BLTU\n");cp.code()+="etiss_coverage_count(1, 8);\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, 1435);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1407);\n";cp.code()+="if (*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] < *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) { // conditional\n";cp.code()+="etiss_coverage_count(7, 1418, 1412, 1411, 1409, 1417, 1416, 1414);\n";{ cp.code()+="etiss_coverage_count(1, 1434);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1419);\n";if(imm % 2ULL) { cp.code()+="etiss_coverage_count(2, 1422, 1420);\n";{ cp.code()+="etiss_coverage_count(1, 1426);\n";cp.code()+="{ // block\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";cp.code()+="etiss_coverage_count(2, 1425, 1423);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // block\n";} } else { { cp.code()+="etiss_coverage_count(1, 1433);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(3)) >>(3)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 1432, 1427, 1431, 1428, 1430, 1429);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\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("//BLTU\n");cp.code()+="if (cpu->return_pending || cpu->exception || cpu->nextPc != "+std::to_string(ic.current_address_+4)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;std::stringstream ss;ss<< "bltu"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition sltu_rd_rs1_rs2(ISA32_RV32IMACFD, "sltu",(uint32_t) 0x003033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLTU\n");cp.code()+="etiss_coverage_count(1, 31);\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, 2017);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2023, 2020, 2018, 2021, 2022);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] < *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) ? (1ULL) : (0LL);\n";cp.code()+="etiss_coverage_count(14, 2043, 2028, 2027, 2025, 2042, 2039, 2033, 2032, 2030, 2038, 2037, 2035, 2040, 2041);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "sltu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition sw_imm_rs1_rs2(ISA32_RV32IMACFD, "sw",(uint32_t) 0x002023,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SW\n");cp.code()+="etiss_coverage_count(1, 17);\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, 1700);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 store_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 1688, 1687, 1684, 1683, 1681, 1686, 1685);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 1699, 1691, 1690, 1698, 1696, 1695, 1693);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, store_address, (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("//SW\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "sw"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition sltiu_rd_rs1_imm(ISA32_RV32IMACFD, "sltiu",(uint32_t) 0x003013,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLTIU\n");cp.code()+="etiss_coverage_count(1, 20);\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, 1748);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1754, 1751, 1749, 1752, 1753);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = ((*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] < "+std::to_string((etiss_uint32)((((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))))+"ULL)) ? (1ULL) : (0LL);\n";cp.code()+="etiss_coverage_count(16, 1775, 1759, 1758, 1756, 1774, 1770, 1764, 1763, 1761, 1769, 1766, 1765, 1767, 1771, 1772, 1773);\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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "sltiu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition lw_rd_rs1_imm(ISA32_RV32IMACFD, "lw",(uint32_t) 0x002003,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LW\n");cp.code()+="etiss_coverage_count(1, 12);\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, 1566);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 1542, 1541, 1538, 1537, 1535, 1540, 1539);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (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_int32 res = (etiss_int32)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 1549, 1548, 1546, 1545);\n";cp.code()+="etiss_coverage_count(1, 1550);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1556, 1553, 1551, 1554, 1555);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint32)(res);\n";cp.code()+="etiss_coverage_count(6, 1565, 1561, 1560, 1558, 1564, 1562);\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("//LW\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(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "lw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition xori_rd_rs1_imm(ISA32_RV32IMACFD, "xori",(uint32_t) 0x004013,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//XORI\n");cp.code()+="etiss_coverage_count(1, 21);\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, 1776);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1782, 1779, 1777, 1780, 1781);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] ^ "+std::to_string((etiss_uint32)((((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))))+"ULL;\n";cp.code()+="etiss_coverage_count(12, 1799, 1787, 1786, 1784, 1798, 1792, 1791, 1789, 1797, 1794, 1793, 1795);\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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "xori"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition bgeu_imm_rs1_rs2(ISA32_RV32IMACFD, "bgeu",(uint32_t) 0x007063,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//BGEU\n");cp.code()+="etiss_coverage_count(1, 9);\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, 1464);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1436);\n";cp.code()+="if (*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] >= *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) { // conditional\n";cp.code()+="etiss_coverage_count(7, 1447, 1441, 1440, 1438, 1446, 1445, 1443);\n";{ cp.code()+="etiss_coverage_count(1, 1463);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 1448);\n";if(imm % 2ULL) { cp.code()+="etiss_coverage_count(2, 1451, 1449);\n";{ cp.code()+="etiss_coverage_count(1, 1455);\n";cp.code()+="{ // block\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 0LL);\n";cp.code()+="etiss_coverage_count(2, 1454, 1452);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // block\n";} } else { { cp.code()+="etiss_coverage_count(1, 1462);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(3)) >>(3)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 1461, 1456, 1460, 1457, 1459, 1458);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\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("//BGEU\n");cp.code()+="if (cpu->return_pending || cpu->exception || cpu->nextPc != "+std::to_string(ic.current_address_+4)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_11(7, 7);imm+=R_imm_11.read(ba)<< 11;static BitArrayRange R_imm_1(11, 8);imm+=R_imm_1.read(ba)<< 1;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(30, 25);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_12(31, 31);imm+=R_imm_12.read(ba)<< 12;std::stringstream ss;ss<< "bgeu"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition slti_rd_rs1_imm(ISA32_RV32IMACFD, "slti",(uint32_t) 0x002013,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLTI\n");cp.code()+="etiss_coverage_count(1, 19);\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, 1722);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1728, 1725, 1723, 1726, 1727);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (((etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) < "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL)) ? (1ULL) : (0LL);\n";cp.code()+="etiss_coverage_count(15, 1747, 1733, 1732, 1730, 1746, 1742, 1739, 1738, 1737, 1735, 1741, 1740, 1743, 1744, 1745);\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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "slti"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition add_rd_rs1_rs2(ISA32_RV32IMACFD, "add",(uint32_t) 0x000033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//ADD\n");cp.code()+="etiss_coverage_count(1, 27);\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, 1910);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1916, 1913, 1911, 1914, 1915);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(11, 1933, 1921, 1920, 1918, 1932, 1926, 1925, 1923, 1931, 1930, 1928);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "add"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition or_rd_rs1_rs2(ISA32_RV32IMACFD, "or",(uint32_t) 0x006033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//OR\n");cp.code()+="etiss_coverage_count(1, 35);\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, 2129);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2135, 2132, 2130, 2133, 2134);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] | *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(11, 2152, 2140, 2139, 2137, 2151, 2145, 2144, 2142, 2150, 2149, 2147);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "or"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition lbu_rd_rs1_imm(ISA32_RV32IMACFD, "lbu",(uint32_t) 0x004003,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LBU\n");cp.code()+="etiss_coverage_count(1, 13);\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, 1600);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 1576, 1575, 1572, 1571, 1569, 1574, 1573);\n";cp.code()+="etiss_uint8 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 1);\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_uint8 res = (etiss_uint8)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 1583, 1582, 1580, 1579);\n";cp.code()+="etiss_coverage_count(1, 1584);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1590, 1587, 1585, 1588, 1589);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint32)(res);\n";cp.code()+="etiss_coverage_count(6, 1599, 1595, 1594, 1592, 1598, 1596);\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("//LBU\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(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "lbu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition andi_rd_rs1_imm(ISA32_RV32IMACFD, "andi",(uint32_t) 0x007013,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//ANDI\n");cp.code()+="etiss_coverage_count(1, 23);\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, 1824);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1830, 1827, 1825, 1828, 1829);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] & "+std::to_string((etiss_uint32)((((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))))+"ULL;\n";cp.code()+="etiss_coverage_count(12, 1847, 1835, 1834, 1832, 1846, 1840, 1839, 1837, 1845, 1842, 1841, 1843);\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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "andi"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition sra_rd_rs1_rs2(ISA32_RV32IMACFD, "sra",(uint32_t) 0x40005033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRA\n");cp.code()+="etiss_coverage_count(1, 34);\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, 2098);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2104, 2101, 2099, 2102, 2103);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) >> (*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL] & 31ULL);\n";cp.code()+="etiss_coverage_count(14, 2128, 2109, 2108, 2106, 2127, 2115, 2114, 2113, 2111, 2125, 2120, 2119, 2117, 2126);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "sra"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition sll_rd_rs1_rs2(ISA32_RV32IMACFD, "sll",(uint32_t) 0x001033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLL\n");cp.code()+="etiss_coverage_count(1, 29);\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, 1958);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1964, 1961, 1959, 1962, 1963);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] << (*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL] & 31ULL);\n";cp.code()+="etiss_coverage_count(13, 1987, 1969, 1968, 1966, 1986, 1974, 1973, 1971, 1984, 1979, 1978, 1976, 1985);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "sll"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition sub_rd_rs1_rs2(ISA32_RV32IMACFD, "sub",(uint32_t) 0x40000033,(uint32_t) 0xfe00707f, [](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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SUB\n");cp.code()+="etiss_coverage_count(1, 28);\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, 1934);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1940, 1937, 1935, 1938, 1939);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] - *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(11, 1957, 1945, 1944, 1942, 1956, 1950, 1949, 1947, 1955, 1954, 1952);\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "sub"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition lui_rd_imm(ISA32_RV32IMACFD, "lui",(uint32_t) 0x000037,(uint32_t) 0x00007f, [](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_uint32 imm=0;static BitArrayRange R_imm_12(31, 12);imm+=R_imm_12.read(ba)<< 12;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LUI\n");cp.code()+="etiss_coverage_count(1, 0);\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, 1170);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1176, 1173, 1171, 1174, 1175);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = "+std::to_string((etiss_uint32)(((etiss_int32)(imm))))+"ULL;\n";cp.code()+="etiss_coverage_count(8, 1187, 1181, 1180, 1178, 1186, 1183, 1182, 1184);\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_uint32 imm=0;static BitArrayRange R_imm_12(31, 12);imm+=R_imm_12.read(ba)<< 12;std::stringstream ss;ss<< "lui"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition ori_rd_rs1_imm(ISA32_RV32IMACFD, "ori",(uint32_t) 0x006013,(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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//ORI\n");cp.code()+="etiss_coverage_count(1, 22);\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, 1800);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1806, 1803, 1801, 1804, 1805);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] | "+std::to_string((etiss_uint32)((((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))))+"ULL;\n";cp.code()+="etiss_coverage_count(12, 1823, 1811, 1810, 1808, 1822, 1816, 1815, 1813, 1821, 1818, 1817, 1819);\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 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "ori"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition srli_rd_rs1_shamt(ISA32_RV32IMACFD, "srli",(uint32_t) 0x005013,(uint32_t) 0xfe00707f, [](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_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRLI\n");cp.code()+="etiss_coverage_count(1, 25);\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, 1868);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 1874, 1871, 1869, 1872, 1873);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 1887, 1879, 1878, 1876, 1886, 1884, 1883, 1881, 1885);\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_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "srli"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition sh_imm_rs1_rs2(ISA32_RV32IMACFD, "sh",(uint32_t) 0x001023,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SH\n");cp.code()+="etiss_coverage_count(1, 16);\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, 1678);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 store_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 1666, 1665, 1662, 1661, 1659, 1664, 1663);\n";cp.code()+="etiss_uint16 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_int16)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 1677, 1669, 1668, 1676, 1674, 1673, 1671);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, store_address, (etiss_uint8*)&mem_val_0, 2);\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("//SH\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "sh"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static __inline__ uint32_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.