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