11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 rs1 += R_rs1_0.
read(ba) << 0;
37 rl += R_rl_0.
read(ba) << 0;
40 aq += R_aq_0.
read(ba) << 0;
47 cp.
code() = std::string(
"//LRD\n");
50 cp.
code() +=
"etiss_coverage_count(1, 235);\n";
52 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
53 cp.
code() +=
"{ // block\n";
55 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
56 cp.
code() +=
"} // block\n";
59 cp.
code() +=
"etiss_coverage_count(1, 8387);\n";
60 cp.
code() +=
"{ // block\n";
61 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
62 cp.
code() +=
"etiss_coverage_count(4, 8365, 8364, 8363, 8361);\n";
63 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
64 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
65 cp.
code() +=
"if (cpu->exception) { // conditional\n";
67 cp.
code() +=
"{ // procedure\n";
68 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
70 cp.
code() +=
"} // procedure\n";
72 cp.
code() +=
"} // conditional\n";
73 cp.
code() +=
"etiss_int64 res = (etiss_int64)(mem_val_0);\n";
74 cp.
code() +=
"etiss_coverage_count(4, 8372, 8371, 8369, 8368);\n";
75 cp.
code() +=
"((RV64IMACFD*)cpu)->RES_ADDR = offs;\n";
76 cp.
code() +=
"etiss_coverage_count(3, 8375, 8373, 8374);\n";
77 cp.
code() +=
"etiss_coverage_count(1, 8376);\n";
79 cp.
code() +=
"etiss_coverage_count(1, 8377);\n";
80 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
81 cp.
code() +=
"etiss_coverage_count(6, 8386, 8382, 8381, 8379, 8385, 8383);\n";
83 cp.
code() +=
"} // block\n";
86 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
93 cp.
code() = std::string(
"//LRD\n");
96 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
108 rd += R_rd_0.read(ba) << 0;
111 rs1 += R_rs1_0.read(ba) << 0;
114 rl += R_rl_0.read(ba) << 0;
117 aq += R_aq_0.read(ba) << 0;
121 std::stringstream ss;
123 ss <<
"lrd" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
145 rd += R_rd_0.
read(ba) << 0;
148 rs1 += R_rs1_0.
read(ba) << 0;
151 rs2 += R_rs2_0.
read(ba) << 0;
154 rl += R_rl_0.
read(ba) << 0;
157 aq += R_aq_0.
read(ba) << 0;
164 cp.
code() = std::string(
"//SCD\n");
167 cp.
code() +=
"etiss_coverage_count(1, 236);\n";
169 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
170 cp.
code() +=
"{ // block\n";
172 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
173 cp.
code() +=
"} // block\n";
176 cp.
code() +=
"etiss_coverage_count(1, 8425);\n";
177 cp.
code() +=
"{ // block\n";
178 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
179 cp.
code() +=
"etiss_coverage_count(4, 8394, 8393, 8392, 8390);\n";
180 cp.
code() +=
"etiss_coverage_count(1, 8395);\n";
181 cp.
code() +=
"if (((RV64IMACFD*)cpu)->RES_ADDR == offs) { // conditional\n";
182 cp.
code() +=
"etiss_coverage_count(3, 8398, 8396, 8397);\n";
183 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
184 cp.
code() +=
"mem_val_0 = (etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
185 cp.
code() +=
"etiss_coverage_count(7, 8409, 8401, 8400, 8408, 8406, 8405, 8403);\n";
186 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
187 cp.
code() +=
"if (cpu->exception) { // conditional\n";
189 cp.
code() +=
"{ // procedure\n";
190 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
192 cp.
code() +=
"} // procedure\n";
194 cp.
code() +=
"} // conditional\n";
195 cp.
code() +=
"} // conditional\n";
196 cp.
code() +=
"etiss_coverage_count(1, 8410);\n";
198 cp.
code() +=
"etiss_coverage_count(1, 8411);\n";
199 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = ((RV64IMACFD*)cpu)->RES_ADDR != offs;\n";
200 cp.
code() +=
"etiss_coverage_count(7, 8420, 8416, 8415, 8413, 8419, 8417, 8418);\n";
202 cp.
code() +=
"((RV64IMACFD*)cpu)->RES_ADDR = -1LL;\n";
203 cp.
code() +=
"etiss_coverage_count(2, 8424, 8421);\n";
204 cp.
code() +=
"} // block\n";
207 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
214 cp.
code() = std::string(
"//SCD\n");
217 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
229 rd += R_rd_0.read(ba) << 0;
232 rs1 += R_rs1_0.read(ba) << 0;
235 rs2 += R_rs2_0.read(ba) << 0;
238 rl += R_rl_0.read(ba) << 0;
241 aq += R_aq_0.read(ba) << 0;
245 std::stringstream ss;
247 ss <<
"scd" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
etiss::instr::InstructionGroup ISA32_RV64IMACFD("ISA32_RV64IMACFD", 32)
static InstructionDefinition lrd_rd_rs1_rl_aq(ISA32_RV64IMACFD, "lrd",(uint32_t) 0x1000302f,(uint32_t) 0xf9f0707f, [](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 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LRD\n");cp.code()+="etiss_coverage_count(1, 235);\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, 8387);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8365, 8364, 8363, 8361);\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, 8372, 8371, 8369, 8368);\n";cp.code()+="((RV64IMACFD*)cpu)->RES_ADDR = offs;\n";cp.code()+="etiss_coverage_count(3, 8375, 8373, 8374);\n";cp.code()+="etiss_coverage_count(1, 8376);\n";if(rd) { cp.code()+="etiss_coverage_count(1, 8377);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 8386, 8382, 8381, 8379, 8385, 8383);\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("//LRD\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_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "lrd"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition scd_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "scd",(uint32_t) 0x1800302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SCD\n");cp.code()+="etiss_coverage_count(1, 236);\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, 8425);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8394, 8393, 8392, 8390);\n";cp.code()+="etiss_coverage_count(1, 8395);\n";cp.code()+="if (((RV64IMACFD*)cpu)->RES_ADDR == offs) { // conditional\n";cp.code()+="etiss_coverage_count(3, 8398, 8396, 8397);\n";cp.code()+="etiss_uint64 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 8409, 8401, 8400, 8408, 8406, 8405, 8403);\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()+="} // conditional\n";cp.code()+="etiss_coverage_count(1, 8410);\n";if(rd) { cp.code()+="etiss_coverage_count(1, 8411);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = ((RV64IMACFD*)cpu)->RES_ADDR != offs;\n";cp.code()+="etiss_coverage_count(7, 8420, 8416, 8415, 8413, 8419, 8417, 8418);\n";} cp.code()+="((RV64IMACFD*)cpu)->RES_ADDR = -1LL;\n";cp.code()+="etiss_coverage_count(2, 8424, 8421);\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("//SCD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "scd"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");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.