19 (uint32_t) 0x1000202f,
20 (uint32_t) 0xf9f0707f,
31rd += R_rd_0.
read(ba) << 0;
34rs1 += R_rs1_0.
read(ba) << 0;
37rl += R_rl_0.
read(ba) << 0;
40aq += R_aq_0.
read(ba) << 0;
47 cp.
code() = std::string(
"//LRW\n");
50cp.
code() +=
"etiss_coverage_count(1, 181);\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";
59cp.
code() +=
"etiss_coverage_count(1, 6444);\n";
60cp.
code() +=
"{ // block\n";
61cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
62cp.
code() +=
"etiss_coverage_count(4, 6422, 6421, 6420, 6418);\n";
63cp.
code() +=
"etiss_uint32 mem_val_0;\n";
64cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
65cp.
code() +=
"if (cpu->exception) { // conditional\n";
67cp.
code() +=
"{ // procedure\n";
68cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
70cp.
code() +=
"} // procedure\n";
72cp.
code() +=
"} // conditional\n";
73cp.
code() +=
"etiss_int32 res = (etiss_int32)(mem_val_0);\n";
74cp.
code() +=
"etiss_coverage_count(4, 6429, 6428, 6426, 6425);\n";
75cp.
code() +=
"((RV64IMACFD*)cpu)->RES_ADDR = offs;\n";
76cp.
code() +=
"etiss_coverage_count(3, 6432, 6430, 6431);\n";
77cp.
code() +=
"etiss_coverage_count(1, 6433);\n";
79cp.
code() +=
"etiss_coverage_count(1, 6434);\n";
80cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
81cp.
code() +=
"etiss_coverage_count(6, 6443, 6439, 6438, 6436, 6442, 6440);\n";
83cp.
code() +=
"} // block\n";
86cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
93 cp.
code() = std::string(
"//LRW\n");
96cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
108rd += R_rd_0.read(ba) << 0;
111rs1 += R_rs1_0.read(ba) << 0;
114rl += R_rl_0.read(ba) << 0;
117aq += R_aq_0.read(ba) << 0;
121 std::stringstream ss;
123ss <<
"lrw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
133 (uint32_t) 0x1800202f,
134 (uint32_t) 0xf800707f,
145rd += R_rd_0.
read(ba) << 0;
148rs1 += R_rs1_0.
read(ba) << 0;
151rs2 += R_rs2_0.
read(ba) << 0;
154rl += R_rl_0.
read(ba) << 0;
157aq += R_aq_0.
read(ba) << 0;
164 cp.
code() = std::string(
"//SCW\n");
167cp.
code() +=
"etiss_coverage_count(1, 182);\n";
169cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
170cp.
code() +=
"{ // block\n";
172cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
173cp.
code() +=
"} // block\n";
176cp.
code() +=
"etiss_coverage_count(1, 6482);\n";
177cp.
code() +=
"{ // block\n";
178cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
179cp.
code() +=
"etiss_coverage_count(4, 6451, 6450, 6449, 6447);\n";
180cp.
code() +=
"etiss_coverage_count(1, 6452);\n";
181cp.
code() +=
"if (((RV64IMACFD*)cpu)->RES_ADDR == offs) { // conditional\n";
182cp.
code() +=
"etiss_coverage_count(3, 6455, 6453, 6454);\n";
183cp.
code() +=
"etiss_uint32 mem_val_0;\n";
184cp.
code() +=
"mem_val_0 = (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
185cp.
code() +=
"etiss_coverage_count(7, 6466, 6458, 6457, 6465, 6463, 6462, 6460);\n";
186cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
187cp.
code() +=
"if (cpu->exception) { // conditional\n";
189cp.
code() +=
"{ // procedure\n";
190cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
192cp.
code() +=
"} // procedure\n";
194cp.
code() +=
"} // conditional\n";
195cp.
code() +=
"} // conditional\n";
196cp.
code() +=
"etiss_coverage_count(1, 6467);\n";
198cp.
code() +=
"etiss_coverage_count(1, 6468);\n";
199cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = ((RV64IMACFD*)cpu)->RES_ADDR != offs;\n";
200cp.
code() +=
"etiss_coverage_count(7, 6477, 6473, 6472, 6470, 6476, 6474, 6475);\n";
202cp.
code() +=
"((RV64IMACFD*)cpu)->RES_ADDR = -1LL;\n";
203cp.
code() +=
"etiss_coverage_count(2, 6481, 6478);\n";
204cp.
code() +=
"} // block\n";
207cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
214 cp.
code() = std::string(
"//SCW\n");
217cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
229rd += R_rd_0.read(ba) << 0;
232rs1 += R_rs1_0.read(ba) << 0;
235rs2 += R_rs2_0.read(ba) << 0;
238rl += R_rl_0.read(ba) << 0;
241aq += R_aq_0.read(ba) << 0;
245 std::stringstream ss;
247ss <<
"scw" <<
" # " << 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 scw_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "scw",(uint32_t) 0x1800202f,(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("//SCW\n");cp.code()+="etiss_coverage_count(1, 182);\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, 6482);\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, 6451, 6450, 6449, 6447);\n";cp.code()+="etiss_coverage_count(1, 6452);\n";cp.code()+="if (((RV64IMACFD*)cpu)->RES_ADDR == offs) { // conditional\n";cp.code()+="etiss_coverage_count(3, 6455, 6453, 6454);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 6466, 6458, 6457, 6465, 6463, 6462, 6460);\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()+="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, 6467);\n";if(rd) { cp.code()+="etiss_coverage_count(1, 6468);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = ((RV64IMACFD*)cpu)->RES_ADDR != offs;\n";cp.code()+="etiss_coverage_count(7, 6477, 6473, 6472, 6470, 6476, 6474, 6475);\n";} cp.code()+="((RV64IMACFD*)cpu)->RES_ADDR = -1LL;\n";cp.code()+="etiss_coverage_count(2, 6481, 6478);\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("//SCW\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<< "scw"<< " # "<< 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 InstructionDefinition lrw_rd_rs1_rl_aq(ISA32_RV64IMACFD, "lrw",(uint32_t) 0x1000202f,(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("//LRW\n");cp.code()+="etiss_coverage_count(1, 181);\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, 6444);\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, 6422, 6421, 6420, 6418);\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_int32 res = (etiss_int32)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 6429, 6428, 6426, 6425);\n";cp.code()+="((RV64IMACFD*)cpu)->RES_ADDR = offs;\n";cp.code()+="etiss_coverage_count(3, 6432, 6430, 6431);\n";cp.code()+="etiss_coverage_count(1, 6433);\n";if(rd) { cp.code()+="etiss_coverage_count(1, 6434);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 6443, 6439, 6438, 6436, 6442, 6440);\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("//LRW\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<< "lrw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");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.