11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 imm += R_imm_3.
read(ba) << 3;
36 imm += R_imm_2.
read(ba) << 2;
38 imm += R_imm_6.
read(ba) << 6;
40 imm += R_imm_4.
read(ba) << 4;
47 cp.
code() = std::string(
"//CADDI4SPN\n");
50 cp.
code() +=
"etiss_coverage_count(1, 42);\n";
52 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
53 cp.
code() +=
"{ // block\n";
55 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
56 cp.
code() +=
"} // block\n";
58 cp.
code() +=
"etiss_coverage_count(1, 2327);\n";
60 cp.
code() +=
"etiss_coverage_count(1, 2328);\n";
61 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[2ULL] + " + std::to_string(imm) +
"ULL;\n";
62 cp.
code() +=
"etiss_coverage_count(9, 2339, 2333, 2332, 2330, 2331, 2338, 2336, 2335, 2337);\n";
66 cp.
code() +=
"{ // procedure\n";
67 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
68 cp.
code() +=
"etiss_coverage_count(2, 2342, 2340);\n";
70 cp.
code() +=
"} // procedure\n";
74 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
81 cp.
code() = std::string(
"//CADDI4SPN\n");
84 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
96 rd += R_rd_0.read(ba) << 0;
99 imm += R_imm_3.read(ba) << 3;
101 imm += R_imm_2.read(ba) << 2;
103 imm += R_imm_6.read(ba) << 6;
105 imm += R_imm_4.read(ba) << 4;
109 std::stringstream ss;
111 ss <<
"caddi4spn" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | imm=" + std::to_string(imm) +
"]");
133 rd += R_rd_0.
read(ba) << 0;
136 uimm += R_uimm_6.
read(ba) << 6;
138 uimm += R_uimm_2.
read(ba) << 2;
141 rs1 += R_rs1_0.
read(ba) << 0;
143 uimm += R_uimm_3.
read(ba) << 3;
150 cp.
code() = std::string(
"//CLW\n");
153 cp.
code() +=
"etiss_coverage_count(1, 43);\n";
155 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
156 cp.
code() +=
"{ // block\n";
158 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
159 cp.
code() +=
"} // block\n";
162 cp.
code() +=
"etiss_coverage_count(1, 2363);\n";
163 cp.
code() +=
"{ // block\n";
164 cp.
code() +=
"etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] + " + std::to_string(uimm) +
"ULL;\n";
165 cp.
code() +=
"etiss_coverage_count(7, 2351, 2350, 2348, 2347, 2345, 2346, 2349);\n";
166 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
167 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 4);\n";
168 cp.
code() +=
"if (cpu->exception) { // conditional\n";
170 cp.
code() +=
"{ // procedure\n";
171 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
173 cp.
code() +=
"} // procedure\n";
175 cp.
code() +=
"} // conditional\n";
176 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = (etiss_int32)(mem_val_0);\n";
177 cp.
code() +=
"etiss_coverage_count(8, 2362, 2356, 2355, 2353, 2354, 2361, 2359, 2358);\n";
178 cp.
code() +=
"} // block\n";
181 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
188 cp.
code() = std::string(
"//CLW\n");
191 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
203 rd += R_rd_0.read(ba) << 0;
206 uimm += R_uimm_6.read(ba) << 6;
208 uimm += R_uimm_2.read(ba) << 2;
211 rs1 += R_rs1_0.read(ba) << 0;
213 uimm += R_uimm_3.read(ba) << 3;
217 std::stringstream ss;
219 ss <<
"clw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | uimm=" + std::to_string(uimm) +
" | rs1=" + std::to_string(rs1) +
"]");
241 rs2 += R_rs2_0.
read(ba) << 0;
244 uimm += R_uimm_6.
read(ba) << 6;
246 uimm += R_uimm_2.
read(ba) << 2;
249 rs1 += R_rs1_0.
read(ba) << 0;
251 uimm += R_uimm_3.
read(ba) << 3;
258 cp.
code() = std::string(
"//CSW\n");
261 cp.
code() +=
"etiss_coverage_count(1, 44);\n";
263 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
264 cp.
code() +=
"{ // block\n";
266 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
267 cp.
code() +=
"} // block\n";
270 cp.
code() +=
"etiss_coverage_count(1, 2384);\n";
271 cp.
code() +=
"{ // block\n";
272 cp.
code() +=
"etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] + " + std::to_string(uimm) +
"ULL;\n";
273 cp.
code() +=
"etiss_coverage_count(7, 2372, 2371, 2369, 2368, 2366, 2367, 2370);\n";
274 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
275 cp.
code() +=
"mem_val_0 = (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL]);\n";
276 cp.
code() +=
"etiss_coverage_count(8, 2383, 2375, 2374, 2382, 2380, 2379, 2377, 2378);\n";
277 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 4);\n";
278 cp.
code() +=
"if (cpu->exception) { // conditional\n";
280 cp.
code() +=
"{ // procedure\n";
281 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
283 cp.
code() +=
"} // procedure\n";
285 cp.
code() +=
"} // conditional\n";
286 cp.
code() +=
"} // block\n";
289 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
296 cp.
code() = std::string(
"//CSW\n");
299 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
311 rs2 += R_rs2_0.read(ba) << 0;
314 uimm += R_uimm_6.read(ba) << 6;
316 uimm += R_uimm_2.read(ba) << 2;
319 rs1 += R_rs1_0.read(ba) << 0;
321 uimm += R_uimm_3.read(ba) << 3;
325 std::stringstream ss;
327 ss <<
"csw" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | uimm=" + std::to_string(uimm) +
" | rs1=" + std::to_string(rs1) +
"]");
349 imm += R_imm_0.
read(ba) << 0;
352 rs1 += R_rs1_0.
read(ba) << 0;
354 imm += R_imm_5.
read(ba) << 5;
361 cp.
code() = std::string(
"//CADDI\n");
364 cp.
code() +=
"etiss_coverage_count(1, 45);\n";
366 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
367 cp.
code() +=
"{ // block\n";
369 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
370 cp.
code() +=
"} // block\n";
372 cp.
code() +=
"etiss_coverage_count(1, 2385);\n";
373 if ((rs1 % 32ULL) != 0LL) {
374 cp.
code() +=
"etiss_coverage_count(5, 2391, 2388, 2386, 2389, 2390);\n";
375 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int8)(((
etiss_int8)imm) << (2)) >> (2))) +
"LL;\n";
376 cp.
code() +=
"etiss_coverage_count(10, 2406, 2396, 2395, 2393, 2405, 2401, 2400, 2398, 2404, 2402);\n";
379 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
392 imm += R_imm_0.read(ba) << 0;
395 rs1 += R_rs1_0.read(ba) << 0;
397 imm += R_imm_5.read(ba) << 5;
401 std::stringstream ss;
403 ss <<
"caddi" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
425 nzimm += R_nzimm_0.
read(ba) << 0;
427 nzimm += R_nzimm_5.
read(ba) << 5;
434 cp.
code() = std::string(
"//CNOP\n");
437 cp.
code() +=
"etiss_coverage_count(1, 46);\n";
439 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
440 cp.
code() +=
"{ // block\n";
442 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
443 cp.
code() +=
"} // block\n";
446 cp.
code() +=
"etiss_coverage_count(1, 2407);\n";
447 cp.
code() +=
"{ // block\n";
448 cp.
code() +=
"} // block\n";
451 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
464 nzimm += R_nzimm_0.read(ba) << 0;
466 nzimm += R_nzimm_5.read(ba) << 5;
470 std::stringstream ss;
472 ss <<
"cnop" <<
" # " << ba << (
" [nzimm=" + std::to_string(nzimm) +
"]");
494 imm += R_imm_5.
read(ba) << 5;
496 imm += R_imm_1.
read(ba) << 1;
498 imm += R_imm_7.
read(ba) << 7;
500 imm += R_imm_6.
read(ba) << 6;
502 imm += R_imm_10.
read(ba) << 10;
504 imm += R_imm_8.
read(ba) << 8;
506 imm += R_imm_4.
read(ba) << 4;
508 imm += R_imm_11.
read(ba) << 11;
515 cp.
code() = std::string(
"//CJAL\n");
518 cp.
code() +=
"etiss_coverage_count(1, 47);\n";
520 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
521 cp.
code() +=
"{ // block\n";
523 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
524 cp.
code() +=
"} // block\n";
527 cp.
code() +=
"etiss_coverage_count(1, 2422);\n";
528 cp.
code() +=
"{ // block\n";
529 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[1ULL] = " + std::to_string(ic.
current_address_ + 2ULL) +
"ULL;\n";
530 cp.
code() +=
"etiss_coverage_count(6, 2414, 2410, 2409, 2413, 2411, 2412);\n";
532 cp.
code() +=
"etiss_coverage_count(6, 2421, 2415, 2420, 2416, 2419, 2417);\n";
533 cp.
code() +=
"} // block\n";
536 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
543 cp.
code() = std::string(
"//CJAL\n");
546 cp.
code() +=
"return cpu->exception;\n";
558 imm += R_imm_5.read(ba) << 5;
560 imm += R_imm_1.read(ba) << 1;
562 imm += R_imm_7.read(ba) << 7;
564 imm += R_imm_6.read(ba) << 6;
566 imm += R_imm_10.read(ba) << 10;
568 imm += R_imm_8.read(ba) << 8;
570 imm += R_imm_4.read(ba) << 4;
572 imm += R_imm_11.read(ba) << 11;
576 std::stringstream ss;
578 ss <<
"cjal" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
"]");
600 imm += R_imm_0.
read(ba) << 0;
603 rd += R_rd_0.
read(ba) << 0;
605 imm += R_imm_5.
read(ba) << 5;
612 cp.
code() = std::string(
"//CLI\n");
615 cp.
code() +=
"etiss_coverage_count(1, 48);\n";
617 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
618 cp.
code() +=
"{ // block\n";
620 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
621 cp.
code() +=
"} // block\n";
624 cp.
code() +=
"etiss_coverage_count(1, 2439);\n";
625 cp.
code() +=
"{ // block\n";
626 cp.
code() +=
"etiss_coverage_count(1, 2423);\n";
627 if ((rd % 32ULL) != 0LL) {
628 cp.
code() +=
"etiss_coverage_count(5, 2429, 2426, 2424, 2427, 2428);\n";
629 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = " + std::to_string(((
etiss_int8)(((
etiss_int8)imm) << (2)) >> (2))) +
"LL;\n";
630 cp.
code() +=
"etiss_coverage_count(6, 2438, 2434, 2433, 2431, 2437, 2435);\n";
632 cp.
code() +=
"} // block\n";
635 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
648 imm += R_imm_0.read(ba) << 0;
651 rd += R_rd_0.read(ba) << 0;
653 imm += R_imm_5.read(ba) << 5;
657 std::stringstream ss;
659 ss <<
"cli" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rd=" + std::to_string(rd) +
"]");
681 imm += R_imm_12.
read(ba) << 12;
684 rd += R_rd_0.
read(ba) << 0;
686 imm += R_imm_17.
read(ba) << 17;
693 cp.
code() = std::string(
"//CLUI\n");
696 cp.
code() +=
"etiss_coverage_count(1, 49);\n";
698 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
699 cp.
code() +=
"{ // block\n";
701 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
702 cp.
code() +=
"} // block\n";
705 cp.
code() +=
"etiss_coverage_count(1, 2463);\n";
706 cp.
code() +=
"{ // block\n";
707 cp.
code() +=
"etiss_coverage_count(1, 2440);\n";
709 cp.
code() +=
"etiss_coverage_count(3, 2443, 2441, 2442);\n";
711 cp.
code() +=
"{ // procedure\n";
712 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
713 cp.
code() +=
"etiss_coverage_count(2, 2446, 2444);\n";
715 cp.
code() +=
"} // procedure\n";
718 cp.
code() +=
"etiss_coverage_count(1, 2447);\n";
719 if ((rd % 32ULL) != 0LL) {
720 cp.
code() +=
"etiss_coverage_count(5, 2453, 2450, 2448, 2451, 2452);\n";
721 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = " + std::to_string(((
etiss_int32)(((
etiss_int32)imm) << (14)) >> (14))) +
"LL;\n";
722 cp.
code() +=
"etiss_coverage_count(6, 2462, 2458, 2457, 2455, 2461, 2459);\n";
724 cp.
code() +=
"} // block\n";
727 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
734 cp.
code() = std::string(
"//CLUI\n");
737 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
749 imm += R_imm_12.read(ba) << 12;
752 rd += R_rd_0.read(ba) << 0;
754 imm += R_imm_17.read(ba) << 17;
758 std::stringstream ss;
760 ss <<
"clui" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rd=" + std::to_string(rd) +
"]");
782 nzimm += R_nzimm_5.
read(ba) << 5;
784 nzimm += R_nzimm_7.
read(ba) << 7;
786 nzimm += R_nzimm_6.
read(ba) << 6;
788 nzimm += R_nzimm_4.
read(ba) << 4;
790 nzimm += R_nzimm_9.
read(ba) << 9;
797 cp.
code() = std::string(
"//CADDI16SP\n");
800 cp.
code() +=
"etiss_coverage_count(1, 50);\n";
802 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
803 cp.
code() +=
"{ // block\n";
805 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
806 cp.
code() +=
"} // block\n";
808 cp.
code() +=
"etiss_coverage_count(1, 2464);\n";
810 cp.
code() +=
"etiss_coverage_count(1, 2465);\n";
811 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[2ULL] = *((RV32IMACFD*)cpu)->X[2ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)nzimm) << (6)) >> (6))) +
"LL;\n";
812 cp.
code() +=
"etiss_coverage_count(8, 2476, 2468, 2467, 2475, 2471, 2470, 2474, 2472);\n";
816 cp.
code() +=
"{ // procedure\n";
817 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
818 cp.
code() +=
"etiss_coverage_count(2, 2479, 2477);\n";
820 cp.
code() +=
"} // procedure\n";
824 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
831 cp.
code() = std::string(
"//CADDI16SP\n");
834 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
846 nzimm += R_nzimm_5.read(ba) << 5;
848 nzimm += R_nzimm_7.read(ba) << 7;
850 nzimm += R_nzimm_6.read(ba) << 6;
852 nzimm += R_nzimm_4.read(ba) << 4;
854 nzimm += R_nzimm_9.read(ba) << 9;
858 std::stringstream ss;
860 ss <<
"caddi16sp" <<
" # " << ba << (
" [nzimm=" + std::to_string(nzimm) +
"]");
882 rd += R_rd_0.
read(ba) << 0;
889 cp.
code() = std::string(
"//__reserved_clui\n");
892 cp.
code() +=
"etiss_coverage_count(1, 51);\n";
894 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
895 cp.
code() +=
"{ // block\n";
897 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
898 cp.
code() +=
"} // block\n";
901 cp.
code() +=
"{ // procedure\n";
902 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
903 cp.
code() +=
"etiss_coverage_count(2, 2482, 2480);\n";
905 cp.
code() +=
"} // procedure\n";
908 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
915 cp.
code() = std::string(
"//__reserved_clui\n");
918 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
930 rd += R_rd_0.read(ba) << 0;
934 std::stringstream ss;
936 ss <<
"__reserved_clui" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
"]");
958 shamt += R_shamt_0.
read(ba) << 0;
961 rs1 += R_rs1_0.
read(ba) << 0;
968 cp.
code() = std::string(
"//CSRLI\n");
971 cp.
code() +=
"etiss_coverage_count(1, 52);\n";
973 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
974 cp.
code() +=
"{ // block\n";
976 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
977 cp.
code() +=
"} // block\n";
980 cp.
code() +=
"etiss_coverage_count(1, 2496);\n";
981 cp.
code() +=
"{ // block\n";
982 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] >> " + std::to_string(shamt) +
"ULL;\n";
983 cp.
code() +=
"etiss_coverage_count(11, 2495, 2487, 2486, 2484, 2485, 2494, 2492, 2491, 2489, 2490, 2493);\n";
984 cp.
code() +=
"} // block\n";
987 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1000 shamt += R_shamt_0.read(ba) << 0;
1003 rs1 += R_rs1_0.read(ba) << 0;
1007 std::stringstream ss;
1009 ss <<
"csrli" <<
" # " << ba << (
" [shamt=" + std::to_string(shamt) +
" | rs1=" + std::to_string(rs1) +
"]");
1031 shamt += R_shamt_0.
read(ba) << 0;
1034 rs1 += R_rs1_0.
read(ba) << 0;
1041 cp.
code() = std::string(
"//CSRAI\n");
1044 cp.
code() +=
"etiss_coverage_count(1, 53);\n";
1046 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1047 cp.
code() +=
"{ // block\n";
1049 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1050 cp.
code() +=
"} // block\n";
1053 cp.
code() +=
"etiss_coverage_count(1, 2536);\n";
1054 cp.
code() +=
"{ // block\n";
1055 cp.
code() +=
"etiss_coverage_count(1, 2497);\n";
1057 cp.
code() +=
"etiss_coverage_count(1, 2498);\n";
1059 cp.
code() +=
"etiss_coverage_count(1, 2518);\n";
1060 cp.
code() +=
"{ // block\n";
1061 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] = ((etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL])) >> " + std::to_string(shamt) +
"ULL;\n";
1062 cp.
code() +=
"etiss_coverage_count(13, 2517, 2506, 2505, 2503, 2504, 2516, 2513, 2511, 2510, 2508, 2509, 2514, 2515);\n";
1063 cp.
code() +=
"} // block\n";
1066 cp.
code() +=
"} // block\n";
1069 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1082 shamt += R_shamt_0.read(ba) << 0;
1085 rs1 += R_rs1_0.read(ba) << 0;
1089 std::stringstream ss;
1091 ss <<
"csrai" <<
" # " << ba << (
" [shamt=" + std::to_string(shamt) +
" | rs1=" + std::to_string(rs1) +
"]");
1113 imm += R_imm_0.
read(ba) << 0;
1116 rs1 += R_rs1_0.
read(ba) << 0;
1118 imm += R_imm_5.
read(ba) << 5;
1125 cp.
code() = std::string(
"//CANDI\n");
1128 cp.
code() +=
"etiss_coverage_count(1, 54);\n";
1130 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1131 cp.
code() +=
"{ // block\n";
1133 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1134 cp.
code() +=
"} // block\n";
1137 cp.
code() +=
"etiss_coverage_count(1, 2552);\n";
1138 cp.
code() +=
"{ // block\n";
1139 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] & " + std::to_string(((
etiss_int8)(((
etiss_int8)imm) << (2)) >> (2))) +
"LL;\n";
1140 cp.
code() +=
"etiss_coverage_count(12, 2551, 2541, 2540, 2538, 2539, 2550, 2546, 2545, 2543, 2544, 2549, 2547);\n";
1141 cp.
code() +=
"} // block\n";
1144 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1157 imm += R_imm_0.read(ba) << 0;
1160 rs1 += R_rs1_0.read(ba) << 0;
1162 imm += R_imm_5.read(ba) << 5;
1166 std::stringstream ss;
1168 ss <<
"candi" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
1190 rs2 += R_rs2_0.
read(ba) << 0;
1193 rd += R_rd_0.
read(ba) << 0;
1200 cp.
code() = std::string(
"//CSUB\n");
1203 cp.
code() +=
"etiss_coverage_count(1, 55);\n";
1205 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1206 cp.
code() +=
"{ // block\n";
1208 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1209 cp.
code() +=
"} // block\n";
1212 cp.
code() +=
"etiss_coverage_count(1, 2570);\n";
1213 cp.
code() +=
"{ // block\n";
1214 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] - *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL];\n";
1215 cp.
code() +=
"etiss_coverage_count(14, 2569, 2557, 2556, 2554, 2555, 2568, 2562, 2561, 2559, 2560, 2567, 2566, 2564, 2565);\n";
1216 cp.
code() +=
"} // block\n";
1219 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1232 rs2 += R_rs2_0.read(ba) << 0;
1235 rd += R_rd_0.read(ba) << 0;
1239 std::stringstream ss;
1241 ss <<
"csub" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1263 rs2 += R_rs2_0.
read(ba) << 0;
1266 rd += R_rd_0.
read(ba) << 0;
1273 cp.
code() = std::string(
"//CXOR\n");
1276 cp.
code() +=
"etiss_coverage_count(1, 56);\n";
1278 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1279 cp.
code() +=
"{ // block\n";
1281 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1282 cp.
code() +=
"} // block\n";
1285 cp.
code() +=
"etiss_coverage_count(1, 2588);\n";
1286 cp.
code() +=
"{ // block\n";
1287 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] ^ *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL];\n";
1288 cp.
code() +=
"etiss_coverage_count(14, 2587, 2575, 2574, 2572, 2573, 2586, 2580, 2579, 2577, 2578, 2585, 2584, 2582, 2583);\n";
1289 cp.
code() +=
"} // block\n";
1292 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1305 rs2 += R_rs2_0.read(ba) << 0;
1308 rd += R_rd_0.read(ba) << 0;
1312 std::stringstream ss;
1314 ss <<
"cxor" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1336 rs2 += R_rs2_0.
read(ba) << 0;
1339 rd += R_rd_0.
read(ba) << 0;
1346 cp.
code() = std::string(
"//COR\n");
1349 cp.
code() +=
"etiss_coverage_count(1, 57);\n";
1351 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1352 cp.
code() +=
"{ // block\n";
1354 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1355 cp.
code() +=
"} // block\n";
1358 cp.
code() +=
"etiss_coverage_count(1, 2606);\n";
1359 cp.
code() +=
"{ // block\n";
1360 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] | *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL];\n";
1361 cp.
code() +=
"etiss_coverage_count(14, 2605, 2593, 2592, 2590, 2591, 2604, 2598, 2597, 2595, 2596, 2603, 2602, 2600, 2601);\n";
1362 cp.
code() +=
"} // block\n";
1365 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1378 rs2 += R_rs2_0.read(ba) << 0;
1381 rd += R_rd_0.read(ba) << 0;
1385 std::stringstream ss;
1387 ss <<
"cor" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1409 rs2 += R_rs2_0.
read(ba) << 0;
1412 rd += R_rd_0.
read(ba) << 0;
1419 cp.
code() = std::string(
"//CAND\n");
1422 cp.
code() +=
"etiss_coverage_count(1, 58);\n";
1424 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1425 cp.
code() +=
"{ // block\n";
1427 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1428 cp.
code() +=
"} // block\n";
1431 cp.
code() +=
"etiss_coverage_count(1, 2624);\n";
1432 cp.
code() +=
"{ // block\n";
1433 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] & *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL];\n";
1434 cp.
code() +=
"etiss_coverage_count(14, 2623, 2611, 2610, 2608, 2609, 2622, 2616, 2615, 2613, 2614, 2621, 2620, 2618, 2619);\n";
1435 cp.
code() +=
"} // block\n";
1438 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1451 rs2 += R_rs2_0.read(ba) << 0;
1454 rd += R_rd_0.read(ba) << 0;
1458 std::stringstream ss;
1460 ss <<
"cand" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1482 imm += R_imm_5.
read(ba) << 5;
1484 imm += R_imm_1.
read(ba) << 1;
1486 imm += R_imm_7.
read(ba) << 7;
1488 imm += R_imm_6.
read(ba) << 6;
1490 imm += R_imm_10.
read(ba) << 10;
1492 imm += R_imm_8.
read(ba) << 8;
1494 imm += R_imm_4.
read(ba) << 4;
1496 imm += R_imm_11.
read(ba) << 11;
1503 cp.
code() = std::string(
"//CJ\n");
1506 cp.
code() +=
"etiss_coverage_count(1, 59);\n";
1508 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1509 cp.
code() +=
"{ // block\n";
1511 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1512 cp.
code() +=
"} // block\n";
1515 cp.
code() +=
"etiss_coverage_count(6, 2631, 2625, 2630, 2626, 2629, 2627);\n";
1517 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1524 cp.
code() = std::string(
"//CJ\n");
1527 cp.
code() +=
"return cpu->exception;\n";
1539 imm += R_imm_5.read(ba) << 5;
1541 imm += R_imm_1.read(ba) << 1;
1543 imm += R_imm_7.read(ba) << 7;
1545 imm += R_imm_6.read(ba) << 6;
1547 imm += R_imm_10.read(ba) << 10;
1549 imm += R_imm_8.read(ba) << 8;
1551 imm += R_imm_4.read(ba) << 4;
1553 imm += R_imm_11.read(ba) << 11;
1557 std::stringstream ss;
1559 ss <<
"cj" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
"]");
1581 imm += R_imm_5.
read(ba) << 5;
1583 imm += R_imm_1.
read(ba) << 1;
1585 imm += R_imm_6.
read(ba) << 6;
1588 rs1 += R_rs1_0.
read(ba) << 0;
1590 imm += R_imm_3.
read(ba) << 3;
1592 imm += R_imm_8.
read(ba) << 8;
1599 cp.
code() = std::string(
"//CBEQZ\n");
1602 cp.
code() +=
"etiss_coverage_count(1, 60);\n";
1604 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1605 cp.
code() +=
"{ // block\n";
1607 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1608 cp.
code() +=
"} // block\n";
1610 cp.
code() +=
"etiss_coverage_count(1, 2632);\n";
1611 cp.
code() +=
"if (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] == 0LL) { // conditional\n";
1612 cp.
code() +=
"etiss_coverage_count(6, 2639, 2637, 2636, 2634, 2635, 2638);\n";
1614 cp.
code() +=
"etiss_coverage_count(6, 2646, 2640, 2645, 2641, 2644, 2642);\n";
1615 cp.
code() +=
"} // conditional\n";
1617 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1624 cp.
code() = std::string(
"//CBEQZ\n");
1627 cp.
code() +=
"if (cpu->nextPc != " + std::to_string(ic.
current_address_ + 2) +
"ULL) return cpu->exception;\n";
1639 imm += R_imm_5.read(ba) << 5;
1641 imm += R_imm_1.read(ba) << 1;
1643 imm += R_imm_6.read(ba) << 6;
1646 rs1 += R_rs1_0.read(ba) << 0;
1648 imm += R_imm_3.read(ba) << 3;
1650 imm += R_imm_8.read(ba) << 8;
1654 std::stringstream ss;
1656 ss <<
"cbeqz" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
1678 imm += R_imm_5.
read(ba) << 5;
1680 imm += R_imm_1.
read(ba) << 1;
1682 imm += R_imm_6.
read(ba) << 6;
1685 rs1 += R_rs1_0.
read(ba) << 0;
1687 imm += R_imm_3.
read(ba) << 3;
1689 imm += R_imm_8.
read(ba) << 8;
1696 cp.
code() = std::string(
"//CBNEZ\n");
1699 cp.
code() +=
"etiss_coverage_count(1, 61);\n";
1701 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1702 cp.
code() +=
"{ // block\n";
1704 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1705 cp.
code() +=
"} // block\n";
1707 cp.
code() +=
"etiss_coverage_count(1, 2647);\n";
1708 cp.
code() +=
"if (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] != 0LL) { // conditional\n";
1709 cp.
code() +=
"etiss_coverage_count(6, 2654, 2652, 2651, 2649, 2650, 2653);\n";
1711 cp.
code() +=
"etiss_coverage_count(6, 2661, 2655, 2660, 2656, 2659, 2657);\n";
1712 cp.
code() +=
"} // conditional\n";
1714 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1721 cp.
code() = std::string(
"//CBNEZ\n");
1724 cp.
code() +=
"if (cpu->nextPc != " + std::to_string(ic.
current_address_ + 2) +
"ULL) return cpu->exception;\n";
1736 imm += R_imm_5.read(ba) << 5;
1738 imm += R_imm_1.read(ba) << 1;
1740 imm += R_imm_6.read(ba) << 6;
1743 rs1 += R_rs1_0.read(ba) << 0;
1745 imm += R_imm_3.read(ba) << 3;
1747 imm += R_imm_8.read(ba) << 8;
1751 std::stringstream ss;
1753 ss <<
"cbnez" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
1775 nzuimm += R_nzuimm_0.
read(ba) << 0;
1778 rs1 += R_rs1_0.
read(ba) << 0;
1785 cp.
code() = std::string(
"//CSLLI\n");
1788 cp.
code() +=
"etiss_coverage_count(1, 62);\n";
1790 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1791 cp.
code() +=
"{ // block\n";
1793 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1794 cp.
code() +=
"} // block\n";
1796 cp.
code() +=
"etiss_coverage_count(1, 2662);\n";
1798 cp.
code() +=
"etiss_coverage_count(1, 2663);\n";
1799 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] << " + std::to_string(nzuimm) +
"ULL;\n";
1800 cp.
code() +=
"etiss_coverage_count(9, 2676, 2668, 2667, 2665, 2675, 2673, 2672, 2670, 2674);\n";
1803 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1816 nzuimm += R_nzuimm_0.read(ba) << 0;
1819 rs1 += R_rs1_0.read(ba) << 0;
1823 std::stringstream ss;
1825 ss <<
"cslli" <<
" # " << ba << (
" [nzuimm=" + std::to_string(nzuimm) +
" | rs1=" + std::to_string(rs1) +
"]");
1847 uimm += R_uimm_6.
read(ba) << 6;
1849 uimm += R_uimm_2.
read(ba) << 2;
1852 rd += R_rd_0.
read(ba) << 0;
1854 uimm += R_uimm_5.
read(ba) << 5;
1861 cp.
code() = std::string(
"//CLWSP\n");
1864 cp.
code() +=
"etiss_coverage_count(1, 63);\n";
1866 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1867 cp.
code() +=
"{ // block\n";
1869 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1870 cp.
code() +=
"} // block\n";
1873 cp.
code() +=
"etiss_coverage_count(1, 2703);\n";
1874 cp.
code() +=
"{ // block\n";
1875 cp.
code() +=
"etiss_coverage_count(1, 2677);\n";
1877 cp.
code() +=
"etiss_coverage_count(2, 2680, 2678);\n";
1879 cp.
code() +=
"etiss_coverage_count(1, 2699);\n";
1880 cp.
code() +=
"{ // block\n";
1881 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
1882 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, *((RV32IMACFD*)cpu)->X[2ULL] + " + std::to_string(uimm) +
"ULL, (etiss_uint8*)&mem_val_0, 4);\n";
1883 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1885 cp.
code() +=
"{ // procedure\n";
1886 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1888 cp.
code() +=
"} // procedure\n";
1890 cp.
code() +=
"} // conditional\n";
1891 cp.
code() +=
"etiss_int32 res = mem_val_0;\n";
1892 cp.
code() +=
"etiss_coverage_count(6, 2689, 2688, 2687, 2685, 2684, 2686);\n";
1893 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int32)(res);\n";
1894 cp.
code() +=
"etiss_coverage_count(6, 2698, 2694, 2693, 2691, 2697, 2695);\n";
1895 cp.
code() +=
"} // block\n";
1900 cp.
code() +=
"{ // procedure\n";
1901 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";
1902 cp.
code() +=
"etiss_coverage_count(3, 2702, 2700, 2701);\n";
1904 cp.
code() +=
"} // procedure\n";
1907 cp.
code() +=
"} // block\n";
1910 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1917 cp.
code() = std::string(
"//CLWSP\n");
1920 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1932 uimm += R_uimm_6.read(ba) << 6;
1934 uimm += R_uimm_2.read(ba) << 2;
1937 rd += R_rd_0.read(ba) << 0;
1939 uimm += R_uimm_5.read(ba) << 5;
1943 std::stringstream ss;
1945 ss <<
"clwsp" <<
" # " << ba << (
" [uimm=" + std::to_string(uimm) +
" | rd=" + std::to_string(rd) +
"]");
1967 rs2 += R_rs2_0.
read(ba) << 0;
1970 rd += R_rd_0.
read(ba) << 0;
1977 cp.
code() = std::string(
"//CMV\n");
1980 cp.
code() +=
"etiss_coverage_count(1, 64);\n";
1982 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1983 cp.
code() +=
"{ // block\n";
1985 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1986 cp.
code() +=
"} // block\n";
1988 cp.
code() +=
"etiss_coverage_count(1, 2704);\n";
1989 if ((rd % 32ULL) != 0LL) {
1990 cp.
code() +=
"etiss_coverage_count(5, 2710, 2707, 2705, 2708, 2709);\n";
1991 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
1992 cp.
code() +=
"etiss_coverage_count(7, 2721, 2715, 2714, 2712, 2720, 2719, 2717);\n";
1995 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2008 rs2 += R_rs2_0.read(ba) << 0;
2011 rd += R_rd_0.read(ba) << 0;
2015 std::stringstream ss;
2017 ss <<
"cmv" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
2039 rs1 += R_rs1_0.
read(ba) << 0;
2046 cp.
code() = std::string(
"//CJR\n");
2049 cp.
code() +=
"etiss_coverage_count(1, 65);\n";
2051 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2052 cp.
code() +=
"{ // block\n";
2054 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2055 cp.
code() +=
"} // block\n";
2057 cp.
code() +=
"etiss_coverage_count(1, 2722);\n";
2059 cp.
code() +=
"etiss_coverage_count(1, 2723);\n";
2060 cp.
code() +=
"cpu->nextPc = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] & -2LL;\n";
2061 cp.
code() +=
"etiss_coverage_count(6, 2733, 2724, 2732, 2729, 2728, 2726);\n";
2065 cp.
code() +=
"{ // procedure\n";
2066 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";
2067 cp.
code() +=
"etiss_coverage_count(3, 2736, 2734, 2735);\n";
2069 cp.
code() +=
"} // procedure\n";
2073 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2080 cp.
code() = std::string(
"//CJR\n");
2083 cp.
code() +=
"return cpu->exception;\n";
2095 rs1 += R_rs1_0.read(ba) << 0;
2099 std::stringstream ss;
2101 ss <<
"cjr" <<
" # " << ba << (
" [rs1=" + std::to_string(rs1) +
"]");
2127 cp.
code() = std::string(
"//__reserved_cmv\n");
2130 cp.
code() +=
"etiss_coverage_count(1, 66);\n";
2132 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2133 cp.
code() +=
"{ // block\n";
2135 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2136 cp.
code() +=
"} // block\n";
2139 cp.
code() +=
"{ // procedure\n";
2140 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";
2141 cp.
code() +=
"etiss_coverage_count(3, 2739, 2737, 2738);\n";
2143 cp.
code() +=
"} // procedure\n";
2146 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2153 cp.
code() = std::string(
"//__reserved_cmv\n");
2156 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
2169 std::stringstream ss;
2171 ss <<
"__reserved_cmv" <<
" # " << ba << (
" []");
2193 rs2 += R_rs2_0.
read(ba) << 0;
2196 rd += R_rd_0.
read(ba) << 0;
2203 cp.
code() = std::string(
"//CADD\n");
2206 cp.
code() +=
"etiss_coverage_count(1, 67);\n";
2208 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2209 cp.
code() +=
"{ // block\n";
2211 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2212 cp.
code() +=
"} // block\n";
2214 cp.
code() +=
"etiss_coverage_count(1, 2740);\n";
2215 if ((rd % 32ULL) != 0LL) {
2216 cp.
code() +=
"etiss_coverage_count(5, 2746, 2743, 2741, 2744, 2745);\n";
2217 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] + *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
2218 cp.
code() +=
"etiss_coverage_count(11, 2763, 2751, 2750, 2748, 2762, 2756, 2755, 2753, 2761, 2760, 2758);\n";
2221 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2234 rs2 += R_rs2_0.read(ba) << 0;
2237 rd += R_rd_0.read(ba) << 0;
2241 std::stringstream ss;
2243 ss <<
"cadd" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
2265 rs1 += R_rs1_0.
read(ba) << 0;
2272 cp.
code() = std::string(
"//CJALR\n");
2275 cp.
code() +=
"etiss_coverage_count(1, 68);\n";
2277 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2278 cp.
code() +=
"{ // block\n";
2280 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2281 cp.
code() +=
"} // block\n";
2284 cp.
code() +=
"etiss_coverage_count(1, 2784);\n";
2285 cp.
code() +=
"{ // block\n";
2286 cp.
code() +=
"etiss_uint32 new_pc = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
2287 cp.
code() +=
"etiss_coverage_count(4, 2770, 2769, 2768, 2766);\n";
2288 cp.
code() +=
"*((RV32IMACFD*)cpu)->X[1ULL] = " + std::to_string(ic.
current_address_ + 2ULL) +
"ULL;\n";
2289 cp.
code() +=
"etiss_coverage_count(6, 2777, 2773, 2772, 2776, 2774, 2775);\n";
2290 cp.
code() +=
"cpu->nextPc = new_pc & -2LL;\n";
2291 cp.
code() +=
"etiss_coverage_count(4, 2783, 2778, 2782, 2779);\n";
2292 cp.
code() +=
"} // block\n";
2295 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2302 cp.
code() = std::string(
"//CJALR\n");
2305 cp.
code() +=
"return cpu->exception;\n";
2317 rs1 += R_rs1_0.read(ba) << 0;
2321 std::stringstream ss;
2323 ss <<
"cjalr" <<
" # " << ba << (
" [rs1=" + std::to_string(rs1) +
"]");
2349 cp.
code() = std::string(
"//CEBREAK\n");
2352 cp.
code() +=
"etiss_coverage_count(1, 69);\n";
2354 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2355 cp.
code() +=
"{ // block\n";
2357 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2358 cp.
code() +=
"} // block\n";
2361 cp.
code() +=
"{ // procedure\n";
2362 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 3LL);\n";
2363 cp.
code() +=
"etiss_coverage_count(2, 2787, 2785);\n";
2365 cp.
code() +=
"} // procedure\n";
2368 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2375 cp.
code() = std::string(
"//CEBREAK\n");
2378 cp.
code() +=
"return cpu->exception;\n";
2391 std::stringstream ss;
2393 ss <<
"cebreak" <<
" # " << ba << (
" []");
2415 rs2 += R_rs2_0.
read(ba) << 0;
2418 uimm += R_uimm_6.
read(ba) << 6;
2420 uimm += R_uimm_2.
read(ba) << 2;
2427 cp.
code() = std::string(
"//CSWSP\n");
2430 cp.
code() +=
"etiss_coverage_count(1, 70);\n";
2432 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2433 cp.
code() +=
"{ // block\n";
2435 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2436 cp.
code() +=
"} // block\n";
2439 cp.
code() +=
"etiss_coverage_count(1, 2806);\n";
2440 cp.
code() +=
"{ // block\n";
2441 cp.
code() +=
"etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[2ULL] + " + std::to_string(uimm) +
"ULL;\n";
2442 cp.
code() +=
"etiss_coverage_count(5, 2794, 2793, 2791, 2790, 2792);\n";
2443 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
2444 cp.
code() +=
"mem_val_0 = (etiss_uint32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
2445 cp.
code() +=
"etiss_coverage_count(7, 2805, 2797, 2796, 2804, 2802, 2801, 2799);\n";
2446 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
2447 cp.
code() +=
"if (cpu->exception) { // conditional\n";
2449 cp.
code() +=
"{ // procedure\n";
2450 cp.
code() +=
"RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
2452 cp.
code() +=
"} // procedure\n";
2454 cp.
code() +=
"} // conditional\n";
2455 cp.
code() +=
"} // block\n";
2458 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2465 cp.
code() = std::string(
"//CSWSP\n");
2468 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
2480 rs2 += R_rs2_0.read(ba) << 0;
2483 uimm += R_uimm_6.read(ba) << 6;
2485 uimm += R_uimm_2.read(ba) << 2;
2489 std::stringstream ss;
2491 ss <<
"cswsp" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | uimm=" + std::to_string(uimm) +
"]");
2517 cp.
code() = std::string(
"//DII\n");
2520 cp.
code() +=
"etiss_coverage_count(1, 71);\n";
2522 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2523 cp.
code() +=
"{ // block\n";
2525 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2526 cp.
code() +=
"} // block\n";
2529 cp.
code() +=
"{ // procedure\n";
2530 cp.
code() +=
"RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
2531 cp.
code() +=
"etiss_coverage_count(2, 2809, 2807);\n";
2533 cp.
code() +=
"} // procedure\n";
2536 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2543 cp.
code() = std::string(
"//DII\n");
2546 cp.
code() +=
"return cpu->exception;\n";
2559 std::stringstream ss;
2561 ss <<
"dii" <<
" # " << ba << (
" []");
etiss::instr::InstructionGroup ISA16_RV32IMACFD("ISA16_RV32IMACFD", 16)
static InstructionDefinition cswsp_rs2_uimm(ISA16_RV32IMACFD, "cswsp",(uint16_t) 0xc002,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(8, 7);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(12, 9);uimm+=R_uimm_2.read(ba)<< 2;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSWSP\n");cp.code()+="etiss_coverage_count(1, 70);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2806);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[2ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 2794, 2793, 2791, 2790, 2792);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_uint32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 2805, 2797, 2796, 2804, 2802, 2801, 2799);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} { CodePart &cp=cs.append(CodePart::APPENDEDRETURNINGREQUIRED);cp.code()=std::string("//CSWSP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(8, 7);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(12, 9);uimm+=R_uimm_2.read(ba)<< 2;std::stringstream ss;ss<< "cswsp"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | uimm="+std::to_string(uimm)+"]");return ss.str();})
static InstructionDefinition dii_(ISA16_RV32IMACFD, "dii",(uint16_t) 0x00,(uint16_t) 0xffff, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { { CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//DII\n");cp.code()+="etiss_coverage_count(1, 71);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2809, 2807);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//DII\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { std::stringstream ss;ss<< "dii"<< " # "<< ba<<(" []");return ss.str();})
static InstructionDefinition cli_imm_rd(ISA16_RV32IMACFD, "cli",(uint16_t) 0x4001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLI\n");cp.code()+="etiss_coverage_count(1, 48);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2439);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2423);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2429, 2426, 2424, 2427, 2428);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = "+std::to_string(((etiss_int8)(((etiss_int8) imm)<<(2)) >>(2)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2438, 2434, 2433, 2431, 2437, 2435);\n";} cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "cli"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition csub_rs2_rd(ISA16_RV32IMACFD, "csub",(uint16_t) 0x8c01,(uint16_t) 0xfc63, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSUB\n");cp.code()+="etiss_coverage_count(1, 55);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2570);\n";cp.code()+="{ // block\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] - *((RV32IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(14, 2569, 2557, 2556, 2554, 2555, 2568, 2562, 2561, 2559, 2560, 2567, 2566, 2564, 2565);\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "csub"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cbnez_imm_rs1(ISA16_RV32IMACFD, "cbnez",(uint16_t) 0xe001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(4, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_6(6, 5);imm+=R_imm_6.read(ba)<< 6;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_3(11, 10);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_8(12, 12);imm+=R_imm_8.read(ba)<< 8;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CBNEZ\n");cp.code()+="etiss_coverage_count(1, 61);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2647);\n";cp.code()+="if (*((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] != 0LL) { // conditional\n";cp.code()+="etiss_coverage_count(6, 2654, 2652, 2651, 2649, 2650, 2653);\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(7)) >>(7)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2661, 2655, 2660, 2656, 2659, 2657);\n";cp.code()+="} // conditional\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("//CBNEZ\n");cp.code()+="if (cpu->nextPc != "+std::to_string(ic.current_address_+2)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(4, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_6(6, 5);imm+=R_imm_6.read(ba)<< 6;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_3(11, 10);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_8(12, 12);imm+=R_imm_8.read(ba)<< 8;std::stringstream ss;ss<< "cbnez"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cnop_nzimm(ISA16_RV32IMACFD, "cnop",(uint16_t) 0x01,(uint16_t) 0xef83, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 nzimm=0;static BitArrayRange R_nzimm_0(6, 2);nzimm+=R_nzimm_0.read(ba)<< 0;static BitArrayRange R_nzimm_5(12, 12);nzimm+=R_nzimm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CNOP\n");cp.code()+="etiss_coverage_count(1, 46);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2407);\n";cp.code()+="{ // block\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 nzimm=0;static BitArrayRange R_nzimm_0(6, 2);nzimm+=R_nzimm_0.read(ba)<< 0;static BitArrayRange R_nzimm_5(12, 12);nzimm+=R_nzimm_5.read(ba)<< 5;std::stringstream ss;ss<< "cnop"<< " # "<< ba<<(" [nzimm="+std::to_string(nzimm)+"]");return ss.str();})
static InstructionDefinition caddi4spn_rd_imm(ISA16_RV32IMACFD, "caddi4spn",(uint16_t) 0x00,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_3(5, 5);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_2(6, 6);imm+=R_imm_2.read(ba)<< 2;static BitArrayRange R_imm_6(10, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_4(12, 11);imm+=R_imm_4.read(ba)<< 4;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CADDI4SPN\n");cp.code()+="etiss_coverage_count(1, 42);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2327);\n";if(imm) { cp.code()+="etiss_coverage_count(1, 2328);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV32IMACFD*)cpu)->X[2ULL] + "+std::to_string(imm)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 2339, 2333, 2332, 2330, 2331, 2338, 2336, 2335, 2337);\n";} else { { cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2342, 2340);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CADDI4SPN\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_3(5, 5);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_2(6, 6);imm+=R_imm_2.read(ba)<< 2;static BitArrayRange R_imm_6(10, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_4(12, 11);imm+=R_imm_4.read(ba)<< 4;std::stringstream ss;ss<< "caddi4spn"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition candi_imm_rs1(ISA16_RV32IMACFD, "candi",(uint16_t) 0x8801,(uint16_t) 0xec03, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CANDI\n");cp.code()+="etiss_coverage_count(1, 54);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2552);\n";cp.code()+="{ // block\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] & "+std::to_string(((etiss_int8)(((etiss_int8) imm)<<(2)) >>(2)))+"LL;\n";cp.code()+="etiss_coverage_count(12, 2551, 2541, 2540, 2538, 2539, 2550, 2546, 2545, 2543, 2544, 2549, 2547);\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "candi"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition clw_rd_uimm_rs1(ISA16_RV32IMACFD, "clw",(uint16_t) 0x4000,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLW\n");cp.code()+="etiss_coverage_count(1, 43);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2363);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 2351, 2350, 2348, 2347, 2345, 2346, 2349);\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()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = (etiss_int32)(mem_val_0);\n";cp.code()+="etiss_coverage_count(8, 2362, 2356, 2355, 2353, 2354, 2361, 2359, 2358);\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("//CLW\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "clw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | uimm="+std::to_string(uimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition caddi16sp_nzimm(ISA16_RV32IMACFD, "caddi16sp",(uint16_t) 0x6101,(uint16_t) 0xef83, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 nzimm=0;static BitArrayRange R_nzimm_5(2, 2);nzimm+=R_nzimm_5.read(ba)<< 5;static BitArrayRange R_nzimm_7(4, 3);nzimm+=R_nzimm_7.read(ba)<< 7;static BitArrayRange R_nzimm_6(5, 5);nzimm+=R_nzimm_6.read(ba)<< 6;static BitArrayRange R_nzimm_4(6, 6);nzimm+=R_nzimm_4.read(ba)<< 4;static BitArrayRange R_nzimm_9(12, 12);nzimm+=R_nzimm_9.read(ba)<< 9;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CADDI16SP\n");cp.code()+="etiss_coverage_count(1, 50);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2464);\n";if(nzimm) { cp.code()+="etiss_coverage_count(1, 2465);\n";cp.code()+="*((RV32IMACFD*)cpu)->X[2ULL] = *((RV32IMACFD*)cpu)->X[2ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) nzimm)<<(6)) >>(6)))+"LL;\n";cp.code()+="etiss_coverage_count(8, 2476, 2468, 2467, 2475, 2471, 2470, 2474, 2472);\n";} else { { cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2479, 2477);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CADDI16SP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 nzimm=0;static BitArrayRange R_nzimm_5(2, 2);nzimm+=R_nzimm_5.read(ba)<< 5;static BitArrayRange R_nzimm_7(4, 3);nzimm+=R_nzimm_7.read(ba)<< 7;static BitArrayRange R_nzimm_6(5, 5);nzimm+=R_nzimm_6.read(ba)<< 6;static BitArrayRange R_nzimm_4(6, 6);nzimm+=R_nzimm_4.read(ba)<< 4;static BitArrayRange R_nzimm_9(12, 12);nzimm+=R_nzimm_9.read(ba)<< 9;std::stringstream ss;ss<< "caddi16sp"<< " # "<< ba<<(" [nzimm="+std::to_string(nzimm)+"]");return ss.str();})
static InstructionDefinition __reserved_clui_rd(ISA16_RV32IMACFD, "__reserved_clui",(uint16_t) 0x6001,(uint16_t) 0xf07f, [](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;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//__reserved_clui\n");cp.code()+="etiss_coverage_count(1, 51);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2482, 2480);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//__reserved_clui\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;std::stringstream ss;ss<< "__reserved_clui"<< " # "<< ba<<(" [rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cebreak_(ISA16_RV32IMACFD, "cebreak",(uint16_t) 0x9002,(uint16_t) 0xffff, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { { CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CEBREAK\n");cp.code()+="etiss_coverage_count(1, 69);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 3LL);\n";cp.code()+="etiss_coverage_count(2, 2787, 2785);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CEBREAK\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { std::stringstream ss;ss<< "cebreak"<< " # "<< ba<<(" []");return ss.str();})
static InstructionDefinition clui_imm_rd(ISA16_RV32IMACFD, "clui",(uint16_t) 0x6001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint32 imm=0;static BitArrayRange R_imm_12(6, 2);imm+=R_imm_12.read(ba)<< 12;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_imm_17(12, 12);imm+=R_imm_17.read(ba)<< 17;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLUI\n");cp.code()+="etiss_coverage_count(1, 49);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2463);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2440);\n";if(imm==0LL) { cp.code()+="etiss_coverage_count(3, 2443, 2441, 2442);\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2446, 2444);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} } cp.code()+="etiss_coverage_count(1, 2447);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2453, 2450, 2448, 2451, 2452);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = "+std::to_string(((etiss_int32)(((etiss_int32) imm)<<(14)) >>(14)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2462, 2458, 2457, 2455, 2461, 2459);\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("//CLUI\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint32 imm=0;static BitArrayRange R_imm_12(6, 2);imm+=R_imm_12.read(ba)<< 12;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_imm_17(12, 12);imm+=R_imm_17.read(ba)<< 17;std::stringstream ss;ss<< "clui"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition clwsp_uimm_rd(ISA16_RV32IMACFD, "clwsp",(uint16_t) 0x4002,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(3, 2);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 4);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_uimm_5(12, 12);uimm+=R_uimm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLWSP\n");cp.code()+="etiss_coverage_count(1, 63);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2703);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2677);\n";if(rd % 32ULL) { cp.code()+="etiss_coverage_count(2, 2680, 2678);\n";{ cp.code()+="etiss_coverage_count(1, 2699);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, *((RV32IMACFD*)cpu)->X[2ULL] + "+std::to_string(uimm)+"ULL, (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 = mem_val_0;\n";cp.code()+="etiss_coverage_count(6, 2689, 2688, 2687, 2685, 2684, 2686);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int32)(res);\n";cp.code()+="etiss_coverage_count(6, 2698, 2694, 2693, 2691, 2697, 2695);\n";cp.code()+="} // block\n";} } else { { cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";cp.code()+="etiss_coverage_count(3, 2702, 2700, 2701);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CLWSP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(3, 2);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 4);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_uimm_5(12, 12);uimm+=R_uimm_5.read(ba)<< 5;std::stringstream ss;ss<< "clwsp"<< " # "<< ba<<(" [uimm="+std::to_string(uimm)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cj_imm(ISA16_RV32IMACFD, "cj",(uint16_t) 0xa001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(5, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_7(6, 6);imm+=R_imm_7.read(ba)<< 7;static BitArrayRange R_imm_6(7, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_10(8, 8);imm+=R_imm_10.read(ba)<< 10;static BitArrayRange R_imm_8(10, 9);imm+=R_imm_8.read(ba)<< 8;static BitArrayRange R_imm_4(11, 11);imm+=R_imm_4.read(ba)<< 4;static BitArrayRange R_imm_11(12, 12);imm+=R_imm_11.read(ba)<< 11;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CJ\n");cp.code()+="etiss_coverage_count(1, 59);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2631, 2625, 2630, 2626, 2629, 2627);\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("//CJ\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(5, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_7(6, 6);imm+=R_imm_7.read(ba)<< 7;static BitArrayRange R_imm_6(7, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_10(8, 8);imm+=R_imm_10.read(ba)<< 10;static BitArrayRange R_imm_8(10, 9);imm+=R_imm_8.read(ba)<< 8;static BitArrayRange R_imm_4(11, 11);imm+=R_imm_4.read(ba)<< 4;static BitArrayRange R_imm_11(12, 12);imm+=R_imm_11.read(ba)<< 11;std::stringstream ss;ss<< "cj"<< " # "<< ba<<(" [imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition csrli_shamt_rs1(ISA16_RV32IMACFD, "csrli",(uint16_t) 0x8001,(uint16_t) 0xfc03, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(6, 2);shamt+=R_shamt_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRLI\n");cp.code()+="etiss_coverage_count(1, 52);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2496);\n";cp.code()+="{ // block\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(11, 2495, 2487, 2486, 2484, 2485, 2494, 2492, 2491, 2489, 2490, 2493);\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(6, 2);shamt+=R_shamt_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "csrli"<< " # "<< ba<<(" [shamt="+std::to_string(shamt)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cmv_rs2_rd(ISA16_RV32IMACFD, "cmv",(uint16_t) 0x8002,(uint16_t) 0xf003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CMV\n");cp.code()+="etiss_coverage_count(1, 64);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2704);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2710, 2707, 2705, 2708, 2709);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(7, 2721, 2715, 2714, 2712, 2720, 2719, 2717);\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 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cmv"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cxor_rs2_rd(ISA16_RV32IMACFD, "cxor",(uint16_t) 0x8c21,(uint16_t) 0xfc63, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CXOR\n");cp.code()+="etiss_coverage_count(1, 56);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2588);\n";cp.code()+="{ // block\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] ^ *((RV32IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(14, 2587, 2575, 2574, 2572, 2573, 2586, 2580, 2579, 2577, 2578, 2585, 2584, 2582, 2583);\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cxor"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition __reserved_cmv_(ISA16_RV32IMACFD, "__reserved_cmv",(uint16_t) 0x8002,(uint16_t) 0xffff, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { { CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//__reserved_cmv\n");cp.code()+="etiss_coverage_count(1, 66);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";cp.code()+="etiss_coverage_count(3, 2739, 2737, 2738);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//__reserved_cmv\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { std::stringstream ss;ss<< "__reserved_cmv"<< " # "<< ba<<(" []");return ss.str();})
static InstructionDefinition cslli_nzuimm_rs1(ISA16_RV32IMACFD, "cslli",(uint16_t) 0x02,(uint16_t) 0xf003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 nzuimm=0;static BitArrayRange R_nzuimm_0(6, 2);nzuimm+=R_nzuimm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSLLI\n");cp.code()+="etiss_coverage_count(1, 62);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2662);\n";if(nzuimm) { cp.code()+="etiss_coverage_count(1, 2663);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] << "+std::to_string(nzuimm)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 2676, 2668, 2667, 2665, 2675, 2673, 2672, 2670, 2674);\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 nzuimm=0;static BitArrayRange R_nzuimm_0(6, 2);nzuimm+=R_nzuimm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "cslli"<< " # "<< ba<<(" [nzuimm="+std::to_string(nzuimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cjalr_rs1(ISA16_RV32IMACFD, "cjalr",(uint16_t) 0x9002,(uint16_t) 0xf07f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CJALR\n");cp.code()+="etiss_coverage_count(1, 68);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2784);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 new_pc = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 2770, 2769, 2768, 2766);\n";cp.code()+="*((RV32IMACFD*)cpu)->X[1ULL] = "+std::to_string(ic.current_address_+2ULL)+"ULL;\n";cp.code()+="etiss_coverage_count(6, 2777, 2773, 2772, 2776, 2774, 2775);\n";cp.code()+="cpu->nextPc = new_pc & -2LL;\n";cp.code()+="etiss_coverage_count(4, 2783, 2778, 2782, 2779);\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("//CJALR\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "cjalr"<< " # "<< ba<<(" [rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cjal_imm(ISA16_RV32IMACFD, "cjal",(uint16_t) 0x2001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(5, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_7(6, 6);imm+=R_imm_7.read(ba)<< 7;static BitArrayRange R_imm_6(7, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_10(8, 8);imm+=R_imm_10.read(ba)<< 10;static BitArrayRange R_imm_8(10, 9);imm+=R_imm_8.read(ba)<< 8;static BitArrayRange R_imm_4(11, 11);imm+=R_imm_4.read(ba)<< 4;static BitArrayRange R_imm_11(12, 12);imm+=R_imm_11.read(ba)<< 11;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CJAL\n");cp.code()+="etiss_coverage_count(1, 47);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2422);\n";cp.code()+="{ // block\n";cp.code()+="*((RV32IMACFD*)cpu)->X[1ULL] = "+std::to_string(ic.current_address_+2ULL)+"ULL;\n";cp.code()+="etiss_coverage_count(6, 2414, 2410, 2409, 2413, 2411, 2412);\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2421, 2415, 2420, 2416, 2419, 2417);\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("//CJAL\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(5, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_7(6, 6);imm+=R_imm_7.read(ba)<< 7;static BitArrayRange R_imm_6(7, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_10(8, 8);imm+=R_imm_10.read(ba)<< 10;static BitArrayRange R_imm_8(10, 9);imm+=R_imm_8.read(ba)<< 8;static BitArrayRange R_imm_4(11, 11);imm+=R_imm_4.read(ba)<< 4;static BitArrayRange R_imm_11(12, 12);imm+=R_imm_11.read(ba)<< 11;std::stringstream ss;ss<< "cjal"<< " # "<< ba<<(" [imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition cbeqz_imm_rs1(ISA16_RV32IMACFD, "cbeqz",(uint16_t) 0xc001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(4, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_6(6, 5);imm+=R_imm_6.read(ba)<< 6;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_3(11, 10);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_8(12, 12);imm+=R_imm_8.read(ba)<< 8;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CBEQZ\n");cp.code()+="etiss_coverage_count(1, 60);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2632);\n";cp.code()+="if (*((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] == 0LL) { // conditional\n";cp.code()+="etiss_coverage_count(6, 2639, 2637, 2636, 2634, 2635, 2638);\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(7)) >>(7)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2646, 2640, 2645, 2641, 2644, 2642);\n";cp.code()+="} // conditional\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("//CBEQZ\n");cp.code()+="if (cpu->nextPc != "+std::to_string(ic.current_address_+2)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(4, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_6(6, 5);imm+=R_imm_6.read(ba)<< 6;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_3(11, 10);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_8(12, 12);imm+=R_imm_8.read(ba)<< 8;std::stringstream ss;ss<< "cbeqz"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition caddi_imm_rs1(ISA16_RV32IMACFD, "caddi",(uint16_t) 0x01,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CADDI\n");cp.code()+="etiss_coverage_count(1, 45);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2385);\n";if((rs1 % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2391, 2388, 2386, 2389, 2390);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int8)(((etiss_int8) imm)<<(2)) >>(2)))+"LL;\n";cp.code()+="etiss_coverage_count(10, 2406, 2396, 2395, 2393, 2405, 2401, 2400, 2398, 2404, 2402);\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 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "caddi"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cand_rs2_rd(ISA16_RV32IMACFD, "cand",(uint16_t) 0x8c61,(uint16_t) 0xfc63, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CAND\n");cp.code()+="etiss_coverage_count(1, 58);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2624);\n";cp.code()+="{ // block\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] & *((RV32IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(14, 2623, 2611, 2610, 2608, 2609, 2622, 2616, 2615, 2613, 2614, 2621, 2620, 2618, 2619);\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cand"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cjr_rs1(ISA16_RV32IMACFD, "cjr",(uint16_t) 0x8002,(uint16_t) 0xf07f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CJR\n");cp.code()+="etiss_coverage_count(1, 65);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2722);\n";if(rs1) { cp.code()+="etiss_coverage_count(1, 2723);\n";cp.code()+="cpu->nextPc = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] & -2LL;\n";cp.code()+="etiss_coverage_count(6, 2733, 2724, 2732, 2729, 2728, 2726);\n";} else { { cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";cp.code()+="etiss_coverage_count(3, 2736, 2734, 2735);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CJR\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "cjr"<< " # "<< ba<<(" [rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cadd_rs2_rd(ISA16_RV32IMACFD, "cadd",(uint16_t) 0x9002,(uint16_t) 0xf003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CADD\n");cp.code()+="etiss_coverage_count(1, 67);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2740);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2746, 2743, 2741, 2744, 2745);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] + *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(11, 2763, 2751, 2750, 2748, 2762, 2756, 2755, 2753, 2761, 2760, 2758);\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 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cadd"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition csrai_shamt_rs1(ISA16_RV32IMACFD, "csrai",(uint16_t) 0x8401,(uint16_t) 0xfc03, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(6, 2);shamt+=R_shamt_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRAI\n");cp.code()+="etiss_coverage_count(1, 53);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2536);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2497);\n";if(shamt) { cp.code()+="etiss_coverage_count(1, 2498);\n";{ cp.code()+="etiss_coverage_count(1, 2518);\n";cp.code()+="{ // block\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] = ((etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL])) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(13, 2517, 2506, 2505, 2503, 2504, 2516, 2513, 2511, 2510, 2508, 2509, 2514, 2515);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(6, 2);shamt+=R_shamt_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "csrai"<< " # "<< ba<<(" [shamt="+std::to_string(shamt)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition csw_rs2_uimm_rs1(ISA16_RV32IMACFD, "csw",(uint16_t) 0xc000,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSW\n");cp.code()+="etiss_coverage_count(1, 44);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2384);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 load_address = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 2372, 2371, 2369, 2368, 2366, 2367, 2370);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(8, 2383, 2375, 2374, 2382, 2380, 2379, 2377, 2378);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(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()+="} // 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("//CSW\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "csw"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | uimm="+std::to_string(uimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cor_rs2_rd(ISA16_RV32IMACFD, "cor",(uint16_t) 0x8c41,(uint16_t) 0xfc63, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//COR\n");cp.code()+="etiss_coverage_count(1, 57);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2606);\n";cp.code()+="{ // block\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV32IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] | *((RV32IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(14, 2605, 2593, 2592, 2590, 2591, 2604, 2598, 2597, 2595, 2596, 2603, 2602, 2600, 2601);\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cor"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static __inline__ uint16_t
Contains a small code snipped.
@ APPENDEDRETURNINGREQUIRED
RegisterSet & getAffectedRegisters()
void append(const CodePart &part, CodePart::TYPE type)
void add(const RegisterPart &rp)
add a registerPart to the set or just its relevant bits if a register with the same name is already p...
Reading through it will only return bits within the range.
I read(const BitArray &ba)
reads bits from the range to the return value starting at the lsb.
this class contains parameters that persist in between instruction lookpus/translation within a trans...
uint64_t current_address_
start address of current instruction
holds information and translation callbacks for an instruction.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.