11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 rs1 += R_rs1_0.
read(ba) << 0;
37 imm += R_imm_0.
read(ba) << 0;
44 cp.
code() = std::string(
"//LWU\n");
47 cp.
code() +=
"etiss_coverage_count(1, 184);\n";
49 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
50 cp.
code() +=
"{ // block\n";
52 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
53 cp.
code() +=
"} // block\n";
56 cp.
code() +=
"etiss_coverage_count(1, 6976);\n";
57 cp.
code() +=
"{ // block\n";
58 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
59 cp.
code() +=
"etiss_coverage_count(7, 6952, 6951, 6947, 6946, 6944, 6950, 6948);\n";
60 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
61 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
62 cp.
code() +=
"if (cpu->exception) { // conditional\n";
64 cp.
code() +=
"{ // procedure\n";
65 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
67 cp.
code() +=
"} // procedure\n";
69 cp.
code() +=
"} // conditional\n";
70 cp.
code() +=
"etiss_uint32 res = (etiss_uint32)(mem_val_0);\n";
71 cp.
code() +=
"etiss_coverage_count(4, 6959, 6958, 6956, 6955);\n";
72 cp.
code() +=
"etiss_coverage_count(1, 6960);\n";
73 if ((rd % 32ULL) != 0LL) {
74 cp.
code() +=
"etiss_coverage_count(5, 6966, 6963, 6961, 6964, 6965);\n";
75 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)(res);\n";
76 cp.
code() +=
"etiss_coverage_count(6, 6975, 6971, 6970, 6968, 6974, 6972);\n";
78 cp.
code() +=
"} // block\n";
81 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
88 cp.
code() = std::string(
"//LWU\n");
91 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
103 rd += R_rd_0.read(ba) << 0;
106 rs1 += R_rs1_0.read(ba) << 0;
109 imm += R_imm_0.read(ba) << 0;
113 std::stringstream ss;
115 ss <<
"lwu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
137 rd += R_rd_0.
read(ba) << 0;
140 rs1 += R_rs1_0.
read(ba) << 0;
143 imm += R_imm_0.
read(ba) << 0;
150 cp.
code() = std::string(
"//LD\n");
153 cp.
code() +=
"etiss_coverage_count(1, 185);\n";
155 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
156 cp.
code() +=
"{ // block\n";
158 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
159 cp.
code() +=
"} // block\n";
162 cp.
code() +=
"etiss_coverage_count(1, 7010);\n";
163 cp.
code() +=
"{ // block\n";
164 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
165 cp.
code() +=
"etiss_coverage_count(7, 6986, 6985, 6982, 6981, 6979, 6984, 6983);\n";
166 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
167 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
168 cp.
code() +=
"if (cpu->exception) { // conditional\n";
170 cp.
code() +=
"{ // procedure\n";
171 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
173 cp.
code() +=
"} // procedure\n";
175 cp.
code() +=
"} // conditional\n";
176 cp.
code() +=
"etiss_int64 res = (etiss_int64)(mem_val_0);\n";
177 cp.
code() +=
"etiss_coverage_count(4, 6993, 6992, 6990, 6989);\n";
178 cp.
code() +=
"etiss_coverage_count(1, 6994);\n";
179 if ((rd % 32ULL) != 0LL) {
180 cp.
code() +=
"etiss_coverage_count(5, 7000, 6997, 6995, 6998, 6999);\n";
181 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)(res);\n";
182 cp.
code() +=
"etiss_coverage_count(6, 7009, 7005, 7004, 7002, 7008, 7006);\n";
184 cp.
code() +=
"} // block\n";
187 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
194 cp.
code() = std::string(
"//LD\n");
197 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
209 rd += R_rd_0.read(ba) << 0;
212 rs1 += R_rs1_0.read(ba) << 0;
215 imm += R_imm_0.read(ba) << 0;
219 std::stringstream ss;
221 ss <<
"ld" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
243 imm += R_imm_0.
read(ba) << 0;
246 rs1 += R_rs1_0.
read(ba) << 0;
249 rs2 += R_rs2_0.
read(ba) << 0;
251 imm += R_imm_5.
read(ba) << 5;
258 cp.
code() = std::string(
"//SD\n");
261 cp.
code() +=
"etiss_coverage_count(1, 186);\n";
263 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
264 cp.
code() +=
"{ // block\n";
266 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
267 cp.
code() +=
"} // block\n";
270 cp.
code() +=
"etiss_coverage_count(1, 7032);\n";
271 cp.
code() +=
"{ // block\n";
272 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
273 cp.
code() +=
"etiss_coverage_count(7, 7020, 7019, 7016, 7015, 7013, 7018, 7017);\n";
274 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
275 cp.
code() +=
"mem_val_0 = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
276 cp.
code() +=
"etiss_coverage_count(7, 7031, 7023, 7022, 7030, 7028, 7027, 7025);\n";
277 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
278 cp.
code() +=
"if (cpu->exception) { // conditional\n";
280 cp.
code() +=
"{ // procedure\n";
281 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
283 cp.
code() +=
"} // procedure\n";
285 cp.
code() +=
"} // conditional\n";
286 cp.
code() +=
"} // block\n";
289 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
296 cp.
code() = std::string(
"//SD\n");
299 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
311 imm += R_imm_0.read(ba) << 0;
314 rs1 += R_rs1_0.read(ba) << 0;
317 rs2 += R_rs2_0.read(ba) << 0;
319 imm += R_imm_5.read(ba) << 5;
323 std::stringstream ss;
325 ss <<
"sd" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
347 rd += R_rd_0.
read(ba) << 0;
350 rs1 += R_rs1_0.
read(ba) << 0;
353 shamt += R_shamt_0.
read(ba) << 0;
360 cp.
code() = std::string(
"//SLLI\n");
363 cp.
code() +=
"etiss_coverage_count(1, 187);\n";
365 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
366 cp.
code() +=
"{ // block\n";
368 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
369 cp.
code() +=
"} // block\n";
371 cp.
code() +=
"etiss_coverage_count(1, 7033);\n";
372 if ((rd % 32ULL) != 0LL) {
373 cp.
code() +=
"etiss_coverage_count(5, 7039, 7036, 7034, 7037, 7038);\n";
374 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] << " + std::to_string(shamt) +
"ULL;\n";
375 cp.
code() +=
"etiss_coverage_count(9, 7052, 7044, 7043, 7041, 7051, 7049, 7048, 7046, 7050);\n";
378 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
391 rd += R_rd_0.read(ba) << 0;
394 rs1 += R_rs1_0.read(ba) << 0;
397 shamt += R_shamt_0.read(ba) << 0;
401 std::stringstream ss;
403 ss <<
"slli" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
425 rd += R_rd_0.
read(ba) << 0;
428 rs1 += R_rs1_0.
read(ba) << 0;
431 shamt += R_shamt_0.
read(ba) << 0;
438 cp.
code() = std::string(
"//SRLI\n");
441 cp.
code() +=
"etiss_coverage_count(1, 188);\n";
443 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
444 cp.
code() +=
"{ // block\n";
446 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
447 cp.
code() +=
"} // block\n";
449 cp.
code() +=
"etiss_coverage_count(1, 7053);\n";
450 if ((rd % 32ULL) != 0LL) {
451 cp.
code() +=
"etiss_coverage_count(5, 7059, 7056, 7054, 7057, 7058);\n";
452 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] >> " + std::to_string(shamt) +
"ULL;\n";
453 cp.
code() +=
"etiss_coverage_count(9, 7072, 7064, 7063, 7061, 7071, 7069, 7068, 7066, 7070);\n";
456 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
469 rd += R_rd_0.read(ba) << 0;
472 rs1 += R_rs1_0.read(ba) << 0;
475 shamt += R_shamt_0.read(ba) << 0;
479 std::stringstream ss;
481 ss <<
"srli" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
503 rd += R_rd_0.
read(ba) << 0;
506 rs1 += R_rs1_0.
read(ba) << 0;
509 shamt += R_shamt_0.
read(ba) << 0;
516 cp.
code() = std::string(
"//SRAI\n");
519 cp.
code() +=
"etiss_coverage_count(1, 189);\n";
521 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
522 cp.
code() +=
"{ // block\n";
524 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
525 cp.
code() +=
"} // block\n";
527 cp.
code() +=
"etiss_coverage_count(1, 7073);\n";
528 if ((rd % 32ULL) != 0LL) {
529 cp.
code() +=
"etiss_coverage_count(5, 7079, 7076, 7074, 7077, 7078);\n";
530 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = ((etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> " + std::to_string(shamt) +
"ULL;\n";
531 cp.
code() +=
"etiss_coverage_count(11, 7094, 7084, 7083, 7081, 7093, 7090, 7089, 7088, 7086, 7091, 7092);\n";
534 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
547 rd += R_rd_0.read(ba) << 0;
550 rs1 += R_rs1_0.read(ba) << 0;
553 shamt += R_shamt_0.read(ba) << 0;
557 std::stringstream ss;
559 ss <<
"srai" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
581 rd += R_rd_0.
read(ba) << 0;
584 rs1 += R_rs1_0.
read(ba) << 0;
587 imm += R_imm_0.
read(ba) << 0;
594 cp.
code() = std::string(
"//ADDIW\n");
597 cp.
code() +=
"etiss_coverage_count(1, 190);\n";
599 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
600 cp.
code() +=
"{ // block\n";
602 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
603 cp.
code() +=
"} // block\n";
606 cp.
code() +=
"etiss_coverage_count(1, 7122);\n";
607 cp.
code() +=
"{ // block\n";
608 cp.
code() +=
"etiss_coverage_count(1, 7095);\n";
609 if ((rd % 32ULL) != 0LL) {
610 cp.
code() +=
"etiss_coverage_count(5, 7101, 7098, 7096, 7099, 7100);\n";
612 cp.
code() +=
"etiss_coverage_count(1, 7121);\n";
613 cp.
code() +=
"{ // block\n";
614 cp.
code() +=
"etiss_int32 res = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
615 cp.
code() +=
"etiss_coverage_count(7, 7111, 7110, 7107, 7106, 7104, 7109, 7108);\n";
616 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
617 cp.
code() +=
"etiss_coverage_count(6, 7120, 7116, 7115, 7113, 7119, 7117);\n";
618 cp.
code() +=
"} // block\n";
621 cp.
code() +=
"} // block\n";
624 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
637 rd += R_rd_0.read(ba) << 0;
640 rs1 += R_rs1_0.read(ba) << 0;
643 imm += R_imm_0.read(ba) << 0;
647 std::stringstream ss;
649 ss <<
"addiw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
671 rd += R_rd_0.
read(ba) << 0;
674 rs1 += R_rs1_0.
read(ba) << 0;
677 shamt += R_shamt_0.
read(ba) << 0;
684 cp.
code() = std::string(
"//SLLIW\n");
687 cp.
code() +=
"etiss_coverage_count(1, 191);\n";
689 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
690 cp.
code() +=
"{ // block\n";
692 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
693 cp.
code() +=
"} // block\n";
696 cp.
code() +=
"etiss_coverage_count(1, 7153);\n";
697 cp.
code() +=
"{ // block\n";
698 cp.
code() +=
"etiss_coverage_count(1, 7123);\n";
699 if ((rd % 32ULL) != 0LL) {
700 cp.
code() +=
"etiss_coverage_count(5, 7129, 7126, 7124, 7127, 7128);\n";
702 cp.
code() +=
"etiss_coverage_count(1, 7152);\n";
703 cp.
code() +=
"{ // block\n";
704 cp.
code() +=
"etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) << " + std::to_string(shamt) +
"ULL;\n";
705 cp.
code() +=
"etiss_coverage_count(8, 7141, 7140, 7137, 7135, 7134, 7132, 7138, 7139);\n";
706 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";
707 cp.
code() +=
"etiss_coverage_count(7, 7151, 7146, 7145, 7143, 7150, 7148, 7147);\n";
708 cp.
code() +=
"} // block\n";
711 cp.
code() +=
"} // block\n";
714 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
727 rd += R_rd_0.read(ba) << 0;
730 rs1 += R_rs1_0.read(ba) << 0;
733 shamt += R_shamt_0.read(ba) << 0;
737 std::stringstream ss;
739 ss <<
"slliw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
761 rd += R_rd_0.
read(ba) << 0;
764 rs1 += R_rs1_0.
read(ba) << 0;
767 shamt += R_shamt_0.
read(ba) << 0;
774 cp.
code() = std::string(
"//SRLIW\n");
777 cp.
code() +=
"etiss_coverage_count(1, 192);\n";
779 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
780 cp.
code() +=
"{ // block\n";
782 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
783 cp.
code() +=
"} // block\n";
786 cp.
code() +=
"etiss_coverage_count(1, 7184);\n";
787 cp.
code() +=
"{ // block\n";
788 cp.
code() +=
"etiss_coverage_count(1, 7154);\n";
789 if ((rd % 32ULL) != 0LL) {
790 cp.
code() +=
"etiss_coverage_count(5, 7160, 7157, 7155, 7158, 7159);\n";
792 cp.
code() +=
"etiss_coverage_count(1, 7183);\n";
793 cp.
code() +=
"{ // block\n";
794 cp.
code() +=
"etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> " + std::to_string(shamt) +
"ULL;\n";
795 cp.
code() +=
"etiss_coverage_count(8, 7172, 7171, 7168, 7166, 7165, 7163, 7169, 7170);\n";
796 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";
797 cp.
code() +=
"etiss_coverage_count(7, 7182, 7177, 7176, 7174, 7181, 7179, 7178);\n";
798 cp.
code() +=
"} // block\n";
801 cp.
code() +=
"} // block\n";
804 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
817 rd += R_rd_0.read(ba) << 0;
820 rs1 += R_rs1_0.read(ba) << 0;
823 shamt += R_shamt_0.read(ba) << 0;
827 std::stringstream ss;
829 ss <<
"srliw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
851 rd += R_rd_0.
read(ba) << 0;
854 rs1 += R_rs1_0.
read(ba) << 0;
857 shamt += R_shamt_0.
read(ba) << 0;
864 cp.
code() = std::string(
"//SRAIW\n");
867 cp.
code() +=
"etiss_coverage_count(1, 193);\n";
869 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
870 cp.
code() +=
"{ // block\n";
872 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
873 cp.
code() +=
"} // block\n";
876 cp.
code() +=
"etiss_coverage_count(1, 7214);\n";
877 cp.
code() +=
"{ // block\n";
878 cp.
code() +=
"etiss_coverage_count(1, 7185);\n";
879 if ((rd % 32ULL) != 0LL) {
880 cp.
code() +=
"etiss_coverage_count(5, 7191, 7188, 7186, 7189, 7190);\n";
882 cp.
code() +=
"etiss_coverage_count(1, 7213);\n";
883 cp.
code() +=
"{ // block\n";
884 cp.
code() +=
"etiss_int32 sh_val = ((etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> " + std::to_string(shamt) +
"ULL;\n";
885 cp.
code() +=
"etiss_coverage_count(8, 7203, 7202, 7199, 7197, 7196, 7194, 7200, 7201);\n";
886 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)(sh_val);\n";
887 cp.
code() +=
"etiss_coverage_count(6, 7212, 7208, 7207, 7205, 7211, 7209);\n";
888 cp.
code() +=
"} // block\n";
891 cp.
code() +=
"} // block\n";
894 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
907 rd += R_rd_0.read(ba) << 0;
910 rs1 += R_rs1_0.read(ba) << 0;
913 shamt += R_shamt_0.read(ba) << 0;
917 std::stringstream ss;
919 ss <<
"sraiw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
941 rd += R_rd_0.
read(ba) << 0;
944 rs1 += R_rs1_0.
read(ba) << 0;
947 rs2 += R_rs2_0.
read(ba) << 0;
954 cp.
code() = std::string(
"//ADDW\n");
957 cp.
code() +=
"etiss_coverage_count(1, 194);\n";
959 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
960 cp.
code() +=
"{ // block\n";
962 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
963 cp.
code() +=
"} // block\n";
966 cp.
code() +=
"etiss_coverage_count(1, 7249);\n";
967 cp.
code() +=
"{ // block\n";
968 cp.
code() +=
"etiss_coverage_count(1, 7215);\n";
969 if ((rd % 32ULL) != 0LL) {
970 cp.
code() +=
"etiss_coverage_count(5, 7221, 7218, 7216, 7219, 7220);\n";
972 cp.
code() +=
"etiss_coverage_count(1, 7248);\n";
973 cp.
code() +=
"{ // block\n";
974 cp.
code() +=
"etiss_int32 res = (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) + (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
975 cp.
code() +=
"etiss_coverage_count(10, 7238, 7237, 7229, 7227, 7226, 7224, 7236, 7234, 7233, 7231);\n";
976 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
977 cp.
code() +=
"etiss_coverage_count(6, 7247, 7243, 7242, 7240, 7246, 7244);\n";
978 cp.
code() +=
"} // block\n";
981 cp.
code() +=
"} // block\n";
984 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
997 rd += R_rd_0.read(ba) << 0;
1000 rs1 += R_rs1_0.read(ba) << 0;
1003 rs2 += R_rs2_0.read(ba) << 0;
1007 std::stringstream ss;
1009 ss <<
"addw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1031 rd += R_rd_0.
read(ba) << 0;
1034 rs1 += R_rs1_0.
read(ba) << 0;
1037 rs2 += R_rs2_0.
read(ba) << 0;
1044 cp.
code() = std::string(
"//SUBW\n");
1047 cp.
code() +=
"etiss_coverage_count(1, 195);\n";
1049 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1050 cp.
code() +=
"{ // block\n";
1052 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1053 cp.
code() +=
"} // block\n";
1056 cp.
code() +=
"etiss_coverage_count(1, 7284);\n";
1057 cp.
code() +=
"{ // block\n";
1058 cp.
code() +=
"etiss_coverage_count(1, 7250);\n";
1059 if ((rd % 32ULL) != 0LL) {
1060 cp.
code() +=
"etiss_coverage_count(5, 7256, 7253, 7251, 7254, 7255);\n";
1062 cp.
code() +=
"etiss_coverage_count(1, 7283);\n";
1063 cp.
code() +=
"{ // block\n";
1064 cp.
code() +=
"etiss_int32 res = (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) - (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
1065 cp.
code() +=
"etiss_coverage_count(10, 7273, 7272, 7264, 7262, 7261, 7259, 7271, 7269, 7268, 7266);\n";
1066 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
1067 cp.
code() +=
"etiss_coverage_count(6, 7282, 7278, 7277, 7275, 7281, 7279);\n";
1068 cp.
code() +=
"} // block\n";
1071 cp.
code() +=
"} // block\n";
1074 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1087 rd += R_rd_0.read(ba) << 0;
1090 rs1 += R_rs1_0.read(ba) << 0;
1093 rs2 += R_rs2_0.read(ba) << 0;
1097 std::stringstream ss;
1099 ss <<
"subw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1121 rd += R_rd_0.
read(ba) << 0;
1124 rs1 += R_rs1_0.
read(ba) << 0;
1127 rs2 += R_rs2_0.
read(ba) << 0;
1134 cp.
code() = std::string(
"//SLLW\n");
1137 cp.
code() +=
"etiss_coverage_count(1, 196);\n";
1139 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1140 cp.
code() +=
"{ // block\n";
1142 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1143 cp.
code() +=
"} // block\n";
1146 cp.
code() +=
"etiss_coverage_count(1, 7325);\n";
1147 cp.
code() +=
"{ // block\n";
1148 cp.
code() +=
"etiss_coverage_count(1, 7285);\n";
1149 if ((rd % 32ULL) != 0LL) {
1150 cp.
code() +=
"etiss_coverage_count(5, 7291, 7288, 7286, 7289, 7290);\n";
1152 cp.
code() +=
"etiss_coverage_count(1, 7324);\n";
1153 cp.
code() +=
"{ // block\n";
1154 cp.
code() +=
"etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) & 31ULL;\n";
1155 cp.
code() +=
"etiss_coverage_count(7, 7301, 7300, 7298, 7297, 7296, 7294, 7299);\n";
1156 cp.
code() +=
"etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) << count;\n";
1157 cp.
code() +=
"etiss_coverage_count(8, 7313, 7312, 7309, 7307, 7306, 7304, 7310, 7311);\n";
1158 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";
1159 cp.
code() +=
"etiss_coverage_count(7, 7323, 7318, 7317, 7315, 7322, 7320, 7319);\n";
1160 cp.
code() +=
"} // block\n";
1163 cp.
code() +=
"} // block\n";
1166 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1179 rd += R_rd_0.read(ba) << 0;
1182 rs1 += R_rs1_0.read(ba) << 0;
1185 rs2 += R_rs2_0.read(ba) << 0;
1189 std::stringstream ss;
1191 ss <<
"sllw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1213 rd += R_rd_0.
read(ba) << 0;
1216 rs1 += R_rs1_0.
read(ba) << 0;
1219 rs2 += R_rs2_0.
read(ba) << 0;
1226 cp.
code() = std::string(
"//SRLW\n");
1229 cp.
code() +=
"etiss_coverage_count(1, 197);\n";
1231 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1232 cp.
code() +=
"{ // block\n";
1234 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1235 cp.
code() +=
"} // block\n";
1238 cp.
code() +=
"etiss_coverage_count(1, 7366);\n";
1239 cp.
code() +=
"{ // block\n";
1240 cp.
code() +=
"etiss_coverage_count(1, 7326);\n";
1241 if ((rd % 32ULL) != 0LL) {
1242 cp.
code() +=
"etiss_coverage_count(5, 7332, 7329, 7327, 7330, 7331);\n";
1244 cp.
code() +=
"etiss_coverage_count(1, 7365);\n";
1245 cp.
code() +=
"{ // block\n";
1246 cp.
code() +=
"etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) & 31ULL;\n";
1247 cp.
code() +=
"etiss_coverage_count(7, 7342, 7341, 7339, 7338, 7337, 7335, 7340);\n";
1248 cp.
code() +=
"etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> count;\n";
1249 cp.
code() +=
"etiss_coverage_count(8, 7354, 7353, 7350, 7348, 7347, 7345, 7351, 7352);\n";
1250 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";
1251 cp.
code() +=
"etiss_coverage_count(7, 7364, 7359, 7358, 7356, 7363, 7361, 7360);\n";
1252 cp.
code() +=
"} // block\n";
1255 cp.
code() +=
"} // block\n";
1258 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1271 rd += R_rd_0.read(ba) << 0;
1274 rs1 += R_rs1_0.read(ba) << 0;
1277 rs2 += R_rs2_0.read(ba) << 0;
1281 std::stringstream ss;
1283 ss <<
"srlw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1305 rd += R_rd_0.
read(ba) << 0;
1308 rs1 += R_rs1_0.
read(ba) << 0;
1311 rs2 += R_rs2_0.
read(ba) << 0;
1318 cp.
code() = std::string(
"//SRAW\n");
1321 cp.
code() +=
"etiss_coverage_count(1, 198);\n";
1323 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1324 cp.
code() +=
"{ // block\n";
1326 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1327 cp.
code() +=
"} // block\n";
1330 cp.
code() +=
"etiss_coverage_count(1, 7406);\n";
1331 cp.
code() +=
"{ // block\n";
1332 cp.
code() +=
"etiss_coverage_count(1, 7367);\n";
1333 if ((rd % 32ULL) != 0LL) {
1334 cp.
code() +=
"etiss_coverage_count(5, 7373, 7370, 7368, 7371, 7372);\n";
1336 cp.
code() +=
"etiss_coverage_count(1, 7405);\n";
1337 cp.
code() +=
"{ // block\n";
1338 cp.
code() +=
"etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) & 31ULL;\n";
1339 cp.
code() +=
"etiss_coverage_count(7, 7383, 7382, 7380, 7379, 7378, 7376, 7381);\n";
1340 cp.
code() +=
"etiss_int32 sh_val = ((etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> count;\n";
1341 cp.
code() +=
"etiss_coverage_count(8, 7395, 7394, 7391, 7389, 7388, 7386, 7392, 7393);\n";
1342 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(sh_val);\n";
1343 cp.
code() +=
"etiss_coverage_count(6, 7404, 7400, 7399, 7397, 7403, 7401);\n";
1344 cp.
code() +=
"} // block\n";
1347 cp.
code() +=
"} // block\n";
1350 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1363 rd += R_rd_0.read(ba) << 0;
1366 rs1 += R_rs1_0.read(ba) << 0;
1369 rs2 += R_rs2_0.read(ba) << 0;
1373 std::stringstream ss;
1375 ss <<
"sraw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
etiss::instr::InstructionGroup ISA32_RV64IMACFD("ISA32_RV64IMACFD", 32)
static InstructionDefinition addiw_rd_rs1_imm(ISA32_RV64IMACFD, "addiw",(uint32_t) 0x00001b,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//ADDIW\n");cp.code()+="etiss_coverage_count(1, 190);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7122);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7095);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7101, 7098, 7096, 7099, 7100);\n";{ cp.code()+="etiss_coverage_count(1, 7121);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int32 res = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 7111, 7110, 7107, 7106, 7104, 7109, 7108);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 7120, 7116, 7115, 7113, 7119, 7117);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "addiw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition addw_rd_rs1_rs2(ISA32_RV64IMACFD, "addw",(uint32_t) 0x00003b,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//ADDW\n");cp.code()+="etiss_coverage_count(1, 194);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7249);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7215);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7221, 7218, 7216, 7219, 7220);\n";{ cp.code()+="etiss_coverage_count(1, 7248);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int32 res = (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) + (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(10, 7238, 7237, 7229, 7227, 7226, 7224, 7236, 7234, 7233, 7231);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 7247, 7243, 7242, 7240, 7246, 7244);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "addw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition lwu_rd_rs1_imm(ISA32_RV64IMACFD, "lwu",(uint32_t) 0x006003,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LWU\n");cp.code()+="etiss_coverage_count(1, 184);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 6976);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 6952, 6951, 6947, 6946, 6944, 6950, 6948);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_uint32 res = (etiss_uint32)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 6959, 6958, 6956, 6955);\n";cp.code()+="etiss_coverage_count(1, 6960);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6966, 6963, 6961, 6964, 6965);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)(res);\n";cp.code()+="etiss_coverage_count(6, 6975, 6971, 6970, 6968, 6974, 6972);\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("//LWU\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "lwu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition sd_imm_rs1_rs2(ISA32_RV64IMACFD, "sd",(uint32_t) 0x003023,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SD\n");cp.code()+="etiss_coverage_count(1, 186);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7032);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 7020, 7019, 7016, 7015, 7013, 7018, 7017);\n";cp.code()+="etiss_uint64 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 7031, 7023, 7022, 7030, 7028, 7027, 7025);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_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("//SD\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "sd"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition ld_rd_rs1_imm(ISA32_RV64IMACFD, "ld",(uint32_t) 0x003003,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LD\n");cp.code()+="etiss_coverage_count(1, 185);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7010);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 6986, 6985, 6982, 6981, 6979, 6984, 6983);\n";cp.code()+="etiss_uint64 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_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_int64 res = (etiss_int64)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 6993, 6992, 6990, 6989);\n";cp.code()+="etiss_coverage_count(1, 6994);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7000, 6997, 6995, 6998, 6999);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)(res);\n";cp.code()+="etiss_coverage_count(6, 7009, 7005, 7004, 7002, 7008, 7006);\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("//LD\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "ld"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition srai_rd_rs1_shamt(ISA32_RV64IMACFD, "srai",(uint32_t) 0x40005013,(uint32_t) 0xfc00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRAI\n");cp.code()+="etiss_coverage_count(1, 189);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 7073);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7079, 7076, 7074, 7077, 7078);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = ((etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(11, 7094, 7084, 7083, 7081, 7093, 7090, 7089, 7088, 7086, 7091, 7092);\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "srai"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition subw_rd_rs1_rs2(ISA32_RV64IMACFD, "subw",(uint32_t) 0x4000003b,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SUBW\n");cp.code()+="etiss_coverage_count(1, 195);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7284);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7250);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7256, 7253, 7251, 7254, 7255);\n";{ cp.code()+="etiss_coverage_count(1, 7283);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int32 res = (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) - (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(10, 7273, 7272, 7264, 7262, 7261, 7259, 7271, 7269, 7268, 7266);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 7282, 7278, 7277, 7275, 7281, 7279);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "subw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition sllw_rd_rs1_rs2(ISA32_RV64IMACFD, "sllw",(uint32_t) 0x00103b,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLLW\n");cp.code()+="etiss_coverage_count(1, 196);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7325);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7285);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7291, 7288, 7286, 7289, 7290);\n";{ cp.code()+="etiss_coverage_count(1, 7324);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) & 31ULL;\n";cp.code()+="etiss_coverage_count(7, 7301, 7300, 7298, 7297, 7296, 7294, 7299);\n";cp.code()+="etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) << count;\n";cp.code()+="etiss_coverage_count(8, 7313, 7312, 7309, 7307, 7306, 7304, 7310, 7311);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";cp.code()+="etiss_coverage_count(7, 7323, 7318, 7317, 7315, 7322, 7320, 7319);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "sllw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition sraw_rd_rs1_rs2(ISA32_RV64IMACFD, "sraw",(uint32_t) 0x4000503b,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRAW\n");cp.code()+="etiss_coverage_count(1, 198);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7406);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7367);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7373, 7370, 7368, 7371, 7372);\n";{ cp.code()+="etiss_coverage_count(1, 7405);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) & 31ULL;\n";cp.code()+="etiss_coverage_count(7, 7383, 7382, 7380, 7379, 7378, 7376, 7381);\n";cp.code()+="etiss_int32 sh_val = ((etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> count;\n";cp.code()+="etiss_coverage_count(8, 7395, 7394, 7391, 7389, 7388, 7386, 7392, 7393);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(sh_val);\n";cp.code()+="etiss_coverage_count(6, 7404, 7400, 7399, 7397, 7403, 7401);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "sraw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition srliw_rd_rs1_shamt(ISA32_RV64IMACFD, "srliw",(uint32_t) 0x00501b,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRLIW\n");cp.code()+="etiss_coverage_count(1, 192);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7184);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7154);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7160, 7157, 7155, 7158, 7159);\n";{ cp.code()+="etiss_coverage_count(1, 7183);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(8, 7172, 7171, 7168, 7166, 7165, 7163, 7169, 7170);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";cp.code()+="etiss_coverage_count(7, 7182, 7177, 7176, 7174, 7181, 7179, 7178);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "srliw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition slliw_rd_rs1_shamt(ISA32_RV64IMACFD, "slliw",(uint32_t) 0x00101b,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLLIW\n");cp.code()+="etiss_coverage_count(1, 191);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7153);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7123);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7129, 7126, 7124, 7127, 7128);\n";{ cp.code()+="etiss_coverage_count(1, 7152);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) << "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(8, 7141, 7140, 7137, 7135, 7134, 7132, 7138, 7139);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";cp.code()+="etiss_coverage_count(7, 7151, 7146, 7145, 7143, 7150, 7148, 7147);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "slliw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition slli_rd_rs1_shamt(ISA32_RV64IMACFD, "slli",(uint32_t) 0x001013,(uint32_t) 0xfc00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLLI\n");cp.code()+="etiss_coverage_count(1, 187);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 7033);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7039, 7036, 7034, 7037, 7038);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] << "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 7052, 7044, 7043, 7041, 7051, 7049, 7048, 7046, 7050);\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "slli"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition srli_rd_rs1_shamt(ISA32_RV64IMACFD, "srli",(uint32_t) 0x005013,(uint32_t) 0xfc00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRLI\n");cp.code()+="etiss_coverage_count(1, 188);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 7053);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7059, 7056, 7054, 7057, 7058);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 7072, 7064, 7063, 7061, 7071, 7069, 7068, 7066, 7070);\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "srli"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition sraiw_rd_rs1_shamt(ISA32_RV64IMACFD, "sraiw",(uint32_t) 0x4000501b,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRAIW\n");cp.code()+="etiss_coverage_count(1, 193);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7214);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7185);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7191, 7188, 7186, 7189, 7190);\n";{ cp.code()+="etiss_coverage_count(1, 7213);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int32 sh_val = ((etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(8, 7203, 7202, 7199, 7197, 7196, 7194, 7200, 7201);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)(sh_val);\n";cp.code()+="etiss_coverage_count(6, 7212, 7208, 7207, 7205, 7211, 7209);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "sraiw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition srlw_rd_rs1_rs2(ISA32_RV64IMACFD, "srlw",(uint32_t) 0x00503b,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRLW\n");cp.code()+="etiss_coverage_count(1, 197);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7366);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7326);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7332, 7329, 7327, 7330, 7331);\n";{ cp.code()+="etiss_coverage_count(1, 7365);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) & 31ULL;\n";cp.code()+="etiss_coverage_count(7, 7342, 7341, 7339, 7338, 7337, 7335, 7340);\n";cp.code()+="etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> count;\n";cp.code()+="etiss_coverage_count(8, 7354, 7353, 7350, 7348, 7347, 7345, 7351, 7352);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";cp.code()+="etiss_coverage_count(7, 7364, 7359, 7358, 7356, 7363, 7361, 7360);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "srlw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static __inline__ uint32_t
Contains a small code snipped.
@ APPENDEDRETURNINGREQUIRED
RegisterSet & getAffectedRegisters()
void append(const CodePart &part, CodePart::TYPE type)
void add(const RegisterPart &rp)
add a registerPart to the set or just its relevant bits if a register with the same name is already p...
Reading through it will only return bits within the range.
I read(const BitArray &ba)
reads bits from the range to the return value starting at the lsb.
this class contains parameters that persist in between instruction lookpus/translation within a trans...
uint64_t current_address_
start address of current instruction
holds information and translation callbacks for an instruction.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.