updates disass
This commit is contained in:
parent
9c51d6eade
commit
62d21e1156
|
@ -2364,7 +2364,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "ecall";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -2401,7 +2401,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "ebreak";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -2438,7 +2438,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "mret";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -2475,7 +2475,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "wfi";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3388,7 +3388,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__addi4spn"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.addi4spn"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3436,7 +3436,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c__lw"),
|
||||
"{mnemonic:10} {rd}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c.lw"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("uimm", uimm), fmt::arg("rs1", name(8+rs1)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3482,7 +3482,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c__sw"),
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c.sw"),
|
||||
fmt::arg("rs2", name(8+rs2)), fmt::arg("uimm", uimm), fmt::arg("rs1", name(8+rs1)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3525,7 +3525,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__addi"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.addi"),
|
||||
fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3572,8 +3572,8 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
std::string mnemonic = "c__nop";
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "c.nop";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
jh.disass_collection.push_back(mnemonic_ptr);
|
||||
|
@ -3609,7 +3609,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c__jal"),
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c.jal"),
|
||||
fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3653,7 +3653,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__li"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.li"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3700,7 +3700,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__lui"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.lui"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3744,7 +3744,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {nzimm:#05x}", fmt::arg("mnemonic", "c__addi16sp"),
|
||||
"{mnemonic:10} {nzimm:#05x}", fmt::arg("mnemonic", "c.addi16sp"),
|
||||
fmt::arg("nzimm", nzimm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3789,8 +3789,8 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
std::string mnemonic = "__reserved_clui";
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = ".reserved_clui";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
jh.disass_collection.push_back(mnemonic_ptr);
|
||||
|
@ -3828,7 +3828,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c__srli"),
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c.srli"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("shamt", shamt));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3869,7 +3869,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c__srai"),
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c.srai"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("shamt", shamt));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3923,7 +3923,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__andi"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.andi"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -3965,7 +3965,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__sub"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.sub"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4007,7 +4007,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__xor"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.xor"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4048,7 +4048,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__or"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.or"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4089,7 +4089,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__and"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.and"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4129,7 +4129,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c__j"),
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c.j"),
|
||||
fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4171,7 +4171,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__beqz"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.beqz"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4220,7 +4220,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__bnez"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.bnez"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4269,7 +4269,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {nzuimm}", fmt::arg("mnemonic", "c__slli"),
|
||||
"{mnemonic:10} {rs1}, {nzuimm}", fmt::arg("mnemonic", "c.slli"),
|
||||
fmt::arg("rs1", name(rs1)), fmt::arg("nzuimm", nzuimm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4317,7 +4317,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, sp, {uimm:#05x}", fmt::arg("mnemonic", "c__lwsp"),
|
||||
"{mnemonic:10} {rd}, sp, {uimm:#05x}", fmt::arg("mnemonic", "c.lwsp"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("uimm", uimm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4367,7 +4367,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__mv"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.mv"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("rs2", name(rs2)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4413,7 +4413,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c__jr"),
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c.jr"),
|
||||
fmt::arg("rs1", name(rs1)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4459,8 +4459,8 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
std::string mnemonic = "__reserved_cmv";
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = ".reserved_cmv";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
jh.disass_collection.push_back(mnemonic_ptr);
|
||||
|
@ -4498,7 +4498,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__add"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.add"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("rs2", name(rs2)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4546,7 +4546,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c__jalr"),
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c.jalr"),
|
||||
fmt::arg("rs1", name(rs1)));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4595,8 +4595,8 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
std::string mnemonic = "c__ebreak";
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "c.ebreak";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
jh.disass_collection.push_back(mnemonic_ptr);
|
||||
|
@ -4634,7 +4634,7 @@ private:
|
|||
/* generate disass */
|
||||
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}(sp)", fmt::arg("mnemonic", "c__swsp"),
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}(sp)", fmt::arg("mnemonic", "c.swsp"),
|
||||
fmt::arg("rs2", name(rs2)), fmt::arg("uimm", uimm));
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4679,7 +4679,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate disass */
|
||||
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "dii";
|
||||
InvokeNode* call_print_disass;
|
||||
char* mnemonic_ptr = strdup(mnemonic.c_str());
|
||||
|
@ -4900,4 +4900,4 @@ volatile std::array<bool, 2> dummy = {
|
|||
};
|
||||
}
|
||||
}
|
||||
// clang-format on
|
||||
// clang-format on
|
|
@ -343,7 +343,7 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
uint32_t inst_index = instr_decoder.decode_instr(instr);
|
||||
opcode_e inst_id = arch::traits<ARCH>::opcode_e::MAX_OPCODE;;
|
||||
if(inst_index <instr_descr.size())
|
||||
inst_id = instr_descr.at(instr_decoder.decode_instr(instr)).op;
|
||||
inst_id = instr_descr[inst_index].op;
|
||||
|
||||
// pre execution stuff
|
||||
this->core.reg.last_branch = 0;
|
||||
|
@ -1458,7 +1458,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
case arch::traits<ARCH>::opcode_e::ECALL: {
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, "ecall");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "ecall";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 4;
|
||||
|
@ -1471,7 +1473,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
case arch::traits<ARCH>::opcode_e::EBREAK: {
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, "ebreak");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "ebreak";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 4;
|
||||
|
@ -1484,7 +1488,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
case arch::traits<ARCH>::opcode_e::MRET: {
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, "mret");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "mret";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 4;
|
||||
|
@ -1497,7 +1503,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
case arch::traits<ARCH>::opcode_e::WFI: {
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, "wfi");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "wfi";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 4;
|
||||
|
@ -1721,7 +1729,7 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {rd}, {imm}", fmt::arg("mnemonic", "fence.i"),
|
||||
"{mnemonic:10} {rs1}, {rd}, {imm}", fmt::arg("mnemonic", "fence_i"),
|
||||
fmt::arg("rs1", name(rs1)), fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2095,7 +2103,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
uint8_t nzimm = ((bit_sub<2,5>(instr)) | (bit_sub<12,1>(instr) << 5));
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, "c.nop");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "c.nop";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 2;
|
||||
|
@ -2201,7 +2211,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
uint8_t rd = ((bit_sub<7,5>(instr)));
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, ".reserved_clui");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = ".reserved_clui";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 2;
|
||||
|
@ -2520,7 +2532,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
case arch::traits<ARCH>::opcode_e::__reserved_cmv: {
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, ".reserved_cmv");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = ".reserved_cmv";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 2;
|
||||
|
@ -2586,7 +2600,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
case arch::traits<ARCH>::opcode_e::C__EBREAK: {
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, "c.ebreak");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "c.ebreak";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 2;
|
||||
|
@ -2625,7 +2641,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
|
|||
case arch::traits<ARCH>::opcode_e::DII: {
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
this->core.disass_output(pc.val, "dii");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "dii";
|
||||
this->core.disass_output(pc.val, mnemonic);
|
||||
}
|
||||
// used registers// calculate next pc value
|
||||
*NEXT_PC = *PC + 2;
|
||||
|
|
|
@ -2415,7 +2415,7 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "ecall";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -2450,7 +2450,7 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "ebreak";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -2485,7 +2485,7 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "mret";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -2520,7 +2520,7 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "wfi";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3502,7 +3502,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__addi4spn"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.addi4spn"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3552,7 +3552,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c__lw"),
|
||||
"{mnemonic:10} {rd}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c.lw"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("uimm", uimm), fmt::arg("rs1", name(8+rs1)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3602,7 +3602,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c__sw"),
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c.sw"),
|
||||
fmt::arg("rs2", name(8+rs2)), fmt::arg("uimm", uimm), fmt::arg("rs1", name(8+rs1)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3649,7 +3649,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__addi"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.addi"),
|
||||
fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3698,8 +3698,8 @@ private:
|
|||
uint8_t nzimm = ((bit_sub<2,5>(instr)) | (bit_sub<12,1>(instr) << 5));
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
std::string mnemonic = "c__nop";
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "c.nop";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
this->gen_const(64, pc.val),
|
||||
|
@ -3733,7 +3733,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c__jal"),
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c.jal"),
|
||||
fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3776,7 +3776,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__li"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.li"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3822,7 +3822,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__lui"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.lui"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3865,7 +3865,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {nzimm:#05x}", fmt::arg("mnemonic", "c__addi16sp"),
|
||||
"{mnemonic:10} {nzimm:#05x}", fmt::arg("mnemonic", "c.addi16sp"),
|
||||
fmt::arg("nzimm", nzimm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3912,8 +3912,8 @@ private:
|
|||
uint8_t rd = ((bit_sub<7,5>(instr)));
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
std::string mnemonic = "__reserved_clui";
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = ".reserved_clui";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
this->gen_const(64, pc.val),
|
||||
|
@ -3949,7 +3949,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c__srli"),
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c.srli"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("shamt", shamt));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -3991,7 +3991,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c__srai"),
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c.srai"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("shamt", shamt));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4051,7 +4051,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__andi"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.andi"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4095,7 +4095,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__sub"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.sub"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4139,7 +4139,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__xor"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.xor"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4181,7 +4181,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__or"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.or"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4223,7 +4223,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__and"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.and"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4264,7 +4264,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c__j"),
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c.j"),
|
||||
fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4304,7 +4304,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__beqz"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.beqz"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4355,7 +4355,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__bnez"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.bnez"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4406,7 +4406,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {nzuimm}", fmt::arg("mnemonic", "c__slli"),
|
||||
"{mnemonic:10} {rs1}, {nzuimm}", fmt::arg("mnemonic", "c.slli"),
|
||||
fmt::arg("rs1", name(rs1)), fmt::arg("nzuimm", nzuimm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4455,7 +4455,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, sp, {uimm:#05x}", fmt::arg("mnemonic", "c__lwsp"),
|
||||
"{mnemonic:10} {rd}, sp, {uimm:#05x}", fmt::arg("mnemonic", "c.lwsp"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("uimm", uimm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4509,7 +4509,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__mv"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.mv"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("rs2", name(rs2)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4554,7 +4554,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c__jr"),
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c.jr"),
|
||||
fmt::arg("rs1", name(rs1)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4599,8 +4599,8 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
std::string mnemonic = "__reserved_cmv";
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = ".reserved_cmv";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
this->gen_const(64, pc.val),
|
||||
|
@ -4636,7 +4636,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__add"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.add"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("rs2", name(rs2)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4686,7 +4686,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c__jalr"),
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c.jalr"),
|
||||
fmt::arg("rs1", name(rs1)));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4736,8 +4736,8 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
std::string mnemonic = "c__ebreak";
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "c.ebreak";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
this->gen_const(64, pc.val),
|
||||
|
@ -4773,7 +4773,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}(sp)", fmt::arg("mnemonic", "c__swsp"),
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}(sp)", fmt::arg("mnemonic", "c.swsp"),
|
||||
fmt::arg("rs2", name(rs2)), fmt::arg("uimm", uimm));
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
@ -4822,7 +4822,7 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
//This disass is not yet implemented
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "dii";
|
||||
std::vector<Value*> args {
|
||||
this->core_ptr,
|
||||
|
|
|
@ -133,6 +133,7 @@ protected:
|
|||
return (from & mask) | ((from & sign_mask) ? ~mask : 0);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
/****************************************************************************
|
||||
* start opcode definitions
|
||||
|
@ -1881,7 +1882,9 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "ecall");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "ecall";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 4;
|
||||
|
@ -1905,7 +1908,9 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "ebreak");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "ebreak";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 4;
|
||||
|
@ -1929,7 +1934,9 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "mret");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "mret";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 4;
|
||||
|
@ -1953,7 +1960,9 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "wfi");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "wfi";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 4;
|
||||
|
@ -2646,7 +2655,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__addi4spn"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.addi4spn"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2683,7 +2692,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c__lw"),
|
||||
"{mnemonic:10} {rd}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c.lw"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("uimm", uimm), fmt::arg("rs1", name(8+rs1)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2716,7 +2725,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c__sw"),
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "c.sw"),
|
||||
fmt::arg("rs2", name(8+rs2)), fmt::arg("uimm", uimm), fmt::arg("rs1", name(8+rs1)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2747,7 +2756,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__addi"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.addi"),
|
||||
fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2783,7 +2792,9 @@ private:
|
|||
uint8_t nzimm = ((bit_sub<2,5>(instr)) | (bit_sub<12,1>(instr) << 5));
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "c__nop");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "c.nop";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 2;
|
||||
|
@ -2807,7 +2818,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c__jal"),
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c.jal"),
|
||||
fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2840,7 +2851,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__li"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.li"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2876,7 +2887,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c__lui"),
|
||||
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "c.lui"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2909,7 +2920,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {nzimm:#05x}", fmt::arg("mnemonic", "c__addi16sp"),
|
||||
"{mnemonic:10} {nzimm:#05x}", fmt::arg("mnemonic", "c.addi16sp"),
|
||||
fmt::arg("nzimm", nzimm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -2943,7 +2954,9 @@ private:
|
|||
uint8_t rd = ((bit_sub<7,5>(instr)));
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "__reserved_clui");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = ".reserved_clui";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 2;
|
||||
|
@ -2969,7 +2982,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c__srli"),
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c.srli"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("shamt", shamt));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3000,7 +3013,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c__srai"),
|
||||
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "c.srai"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("shamt", shamt));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3039,7 +3052,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__andi"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.andi"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3070,7 +3083,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__sub"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.sub"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3101,7 +3114,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__xor"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.xor"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3132,7 +3145,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__or"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.or"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3163,7 +3176,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__and"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.and"),
|
||||
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3193,7 +3206,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c__j"),
|
||||
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "c.j"),
|
||||
fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3224,7 +3237,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__beqz"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.beqz"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3259,7 +3272,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c__bnez"),
|
||||
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "c.bnez"),
|
||||
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3294,7 +3307,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}, {nzuimm}", fmt::arg("mnemonic", "c__slli"),
|
||||
"{mnemonic:10} {rs1}, {nzuimm}", fmt::arg("mnemonic", "c.slli"),
|
||||
fmt::arg("rs1", name(rs1)), fmt::arg("nzuimm", nzuimm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3332,7 +3345,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, sp, {uimm:#05x}", fmt::arg("mnemonic", "c__lwsp"),
|
||||
"{mnemonic:10} {rd}, sp, {uimm:#05x}", fmt::arg("mnemonic", "c.lwsp"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("uimm", uimm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3369,7 +3382,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__mv"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.mv"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("rs2", name(rs2)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3404,7 +3417,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c__jr"),
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c.jr"),
|
||||
fmt::arg("rs1", name(rs1)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3439,7 +3452,9 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "__reserved_cmv");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = ".reserved_cmv";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 2;
|
||||
|
@ -3465,7 +3480,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c__add"),
|
||||
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "c.add"),
|
||||
fmt::arg("rd", name(rd)), fmt::arg("rs2", name(rs2)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3502,7 +3517,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c__jalr"),
|
||||
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "c.jalr"),
|
||||
fmt::arg("rs1", name(rs1)));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3541,7 +3556,9 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "c__ebreak");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "c.ebreak";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 2;
|
||||
|
@ -3567,7 +3584,7 @@ private:
|
|||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
auto mnemonic = fmt::format(
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}(sp)", fmt::arg("mnemonic", "c__swsp"),
|
||||
"{mnemonic:10} {rs2}, {uimm:#05x}(sp)", fmt::arg("mnemonic", "c.swsp"),
|
||||
fmt::arg("rs2", name(rs2)), fmt::arg("uimm", uimm));
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
|
@ -3600,7 +3617,9 @@ private:
|
|||
uint64_t PC = pc.val;
|
||||
if(this->disass_enabled){
|
||||
/* generate console output when executing the command */
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "dii");
|
||||
//No disass specified, using instruction name
|
||||
std::string mnemonic = "dii";
|
||||
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, mnemonic);
|
||||
}
|
||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||
pc=pc+ 2;
|
||||
|
|
Loading…
Reference in New Issue