|
|
|
@ -380,7 +380,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "lui"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -412,7 +412,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm:#08x}", fmt::arg("mnemonic", "auipc"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -444,7 +444,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm:#0x}", fmt::arg("mnemonic", "jal"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -462,7 +462,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int32_t)sext<21>(imm),32)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(BRANCH);
|
|
|
|
@ -484,7 +484,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {imm:#0x}", fmt::arg("mnemonic", "jalr"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -503,7 +503,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(new_pc,tu.constant(~ 0x1,8)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(BRANCH);
|
|
|
|
@ -525,7 +525,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {rs2}, {imm:#0x}", fmt::arg("mnemonic", "beq"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -541,7 +541,7 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<13>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -564,7 +564,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {rs2}, {imm:#0x}", fmt::arg("mnemonic", "bne"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -580,7 +580,7 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<13>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -603,7 +603,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {rs2}, {imm:#0x}", fmt::arg("mnemonic", "blt"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -619,7 +619,7 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<13>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -642,7 +642,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {rs2}, {imm:#0x}", fmt::arg("mnemonic", "bge"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -658,7 +658,7 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<13>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -681,7 +681,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {rs2}, {imm:#0x}", fmt::arg("mnemonic", "bltu"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -697,7 +697,7 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<13>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -720,7 +720,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {rs2}, {imm:#0x}", fmt::arg("mnemonic", "bgeu"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -736,7 +736,7 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<13>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -759,7 +759,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm}({rs1})", fmt::arg("mnemonic", "lb"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -794,7 +794,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm}({rs1})", fmt::arg("mnemonic", "lh"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -829,7 +829,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm}({rs1})", fmt::arg("mnemonic", "lw"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -864,7 +864,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm}({rs1})", fmt::arg("mnemonic", "lbu"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -899,7 +899,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm}({rs1})", fmt::arg("mnemonic", "lhu"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -934,7 +934,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs2}, {imm}({rs1})", fmt::arg("mnemonic", "sb"),
|
|
|
|
|
fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -966,7 +966,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs2}, {imm}({rs1})", fmt::arg("mnemonic", "sh"),
|
|
|
|
|
fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -998,7 +998,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs2}, {imm}({rs1})", fmt::arg("mnemonic", "sw"),
|
|
|
|
|
fmt::arg("rs2", name(rs2)), fmt::arg("imm", imm), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1030,7 +1030,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {imm}", fmt::arg("mnemonic", "addi"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1063,7 +1063,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {imm}", fmt::arg("mnemonic", "slti"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1096,7 +1096,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {imm}", fmt::arg("mnemonic", "sltiu"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1129,7 +1129,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {imm}", fmt::arg("mnemonic", "xori"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1162,7 +1162,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {imm}", fmt::arg("mnemonic", "ori"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1195,7 +1195,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {imm}", fmt::arg("mnemonic", "andi"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1228,7 +1228,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {shamt}", fmt::arg("mnemonic", "slli"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("shamt", shamt));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1261,7 +1261,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {shamt}", fmt::arg("mnemonic", "srli"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("shamt", shamt));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1294,7 +1294,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {shamt}", fmt::arg("mnemonic", "srai"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("shamt", shamt));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1327,7 +1327,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "add"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1360,7 +1360,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "sub"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1393,7 +1393,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "sll"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1426,7 +1426,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "slt"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1459,7 +1459,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "sltu"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1492,7 +1492,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "xor"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1525,7 +1525,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "srl"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1558,7 +1558,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "sra"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1591,7 +1591,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "or"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1624,7 +1624,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "and"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1659,7 +1659,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {pred}, {succ} ({fm} , {rs1}, {rd})", fmt::arg("mnemonic", "fence"),
|
|
|
|
|
fmt::arg("pred", pred), fmt::arg("succ", succ), fmt::arg("fm", fm), fmt::arg("rs1", name(rs1)), fmt::arg("rd", name(rd)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1679,7 +1679,7 @@ private:
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, PRE_SYNC,38);
|
|
|
|
|
if(this->disass_enabled){
|
|
|
|
|
/* generate console output when executing the command */
|
|
|
|
|
this->core.disass_output(pc.val, "ecall");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "ecall");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+ 4;
|
|
|
|
@ -1699,7 +1699,7 @@ private:
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, PRE_SYNC,39);
|
|
|
|
|
if(this->disass_enabled){
|
|
|
|
|
/* generate console output when executing the command */
|
|
|
|
|
this->core.disass_output(pc.val, "ebreak");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "ebreak");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+ 4;
|
|
|
|
@ -1719,7 +1719,7 @@ private:
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, PRE_SYNC,40);
|
|
|
|
|
if(this->disass_enabled){
|
|
|
|
|
/* generate console output when executing the command */
|
|
|
|
|
this->core.disass_output(pc.val, "mret");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "mret");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+ 4;
|
|
|
|
@ -1739,7 +1739,7 @@ private:
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, PRE_SYNC,41);
|
|
|
|
|
if(this->disass_enabled){
|
|
|
|
|
/* generate console output when executing the command */
|
|
|
|
|
this->core.disass_output(pc.val, "wfi");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "wfi");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+ 4;
|
|
|
|
@ -1765,7 +1765,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {csr}, {rs1}", fmt::arg("mnemonic", "csrrw"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("csr", csr), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1776,7 +1776,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto xrs1 = tu.assignment(tu.load(rs1+ traits::X0, 0),32);
|
|
|
|
|
if(rd!= 0){ auto xrd = tu.assignment(tu.read_mem(traits::MEM, csr, 32),32);
|
|
|
|
|
if(rd!= 0){ auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
tu.write_mem(traits::MEM, csr, xrs1);
|
|
|
|
|
tu.store(rd + traits::X0,xrd);
|
|
|
|
|
}
|
|
|
|
@ -1803,7 +1803,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {csr}, {rs1}", fmt::arg("mnemonic", "csrrs"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("csr", csr), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1813,7 +1813,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::MEM, csr, 32),32);
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
auto xrs1 = tu.assignment(tu.load(rs1+ traits::X0, 0),32);
|
|
|
|
|
if(rs1!= 0) {
|
|
|
|
|
tu.write_mem(traits::MEM, csr, tu.bitwise_or(xrd,xrs1));
|
|
|
|
@ -1841,7 +1841,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {csr}, {rs1}", fmt::arg("mnemonic", "csrrc"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("csr", csr), fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1851,7 +1851,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::MEM, csr, 32),32);
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
auto xrs1 = tu.assignment(tu.load(rs1+ traits::X0, 0),32);
|
|
|
|
|
if(rs1!= 0) {
|
|
|
|
|
tu.write_mem(traits::MEM, csr, tu.bitwise_and(xrd,tu.logical_neg(xrs1)));
|
|
|
|
@ -1879,7 +1879,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {csr}, {zimm:#0x}", fmt::arg("mnemonic", "csrrwi"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("csr", csr), fmt::arg("zimm", zimm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1889,7 +1889,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::MEM, csr, 32),32);
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
tu.write_mem(traits::MEM, csr, tu.constant((uint32_t)zimm,32));
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,xrd);
|
|
|
|
@ -1914,7 +1914,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {csr}, {zimm:#0x}", fmt::arg("mnemonic", "csrrsi"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("csr", csr), fmt::arg("zimm", zimm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1924,7 +1924,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::MEM, csr, 32),32);
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
if(zimm!= 0) {
|
|
|
|
|
tu.write_mem(traits::MEM, csr, tu.bitwise_or(xrd,tu.constant((uint32_t)zimm,32)));
|
|
|
|
|
}
|
|
|
|
@ -1951,7 +1951,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {csr}, {zimm:#0x}", fmt::arg("mnemonic", "csrrci"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("csr", csr), fmt::arg("zimm", zimm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -1961,7 +1961,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::MEM, csr, 32),32);
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
if(zimm!= 0) {
|
|
|
|
|
tu.write_mem(traits::MEM, csr, tu.bitwise_and(xrd,tu.constant(~ ((uint32_t)zimm),32)));
|
|
|
|
|
}
|
|
|
|
@ -1988,7 +1988,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{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);
|
|
|
|
|
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;
|
|
|
|
@ -2014,7 +2014,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "mul"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -2048,7 +2048,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "mulh"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -2082,7 +2082,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "mulhsu"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -2116,7 +2116,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "mulhu"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -2150,7 +2150,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "div"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -2193,7 +2193,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "divu"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -2232,7 +2232,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "rem"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -2278,7 +2278,7 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs1}, {rs2}", fmt::arg("mnemonic", "remu"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs1", name(rs1)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
@ -2316,10 +2316,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "caddi4spn"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(imm) {
|
|
|
|
@ -2347,10 +2347,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "clw"),
|
|
|
|
|
fmt::arg("rd", name(8+rd)), fmt::arg("uimm", uimm), fmt::arg("rs1", name(8+rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
auto load_address = tu.assignment(tu.add(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(uimm,8)),32);
|
|
|
|
@ -2374,10 +2374,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs2}, {uimm:#05x}({rs1})", fmt::arg("mnemonic", "csw"),
|
|
|
|
|
fmt::arg("rs2", name(8+rs2)), fmt::arg("uimm", uimm), fmt::arg("rs1", name(8+rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
auto load_address = tu.assignment(tu.add(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(uimm,8)),32);
|
|
|
|
@ -2400,10 +2400,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "caddi"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rs1>=static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
@ -2428,10 +2428,10 @@ 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->core.disass_output(pc.val, "cnop");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "cnop");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+4;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2451,16 +2451,16 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "cjal"),
|
|
|
|
|
fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(1 + traits::X0,tu.add(tu.ext(cur_pc_val,32,false),tu.constant( 2,32)));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<12>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
auto returnValue = std::make_tuple(BRANCH);
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, POST_SYNC,62);
|
|
|
|
@ -2479,10 +2479,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "cli"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rd>=static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
@ -2511,10 +2511,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {imm:#05x}", fmt::arg("mnemonic", "clui"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(imm== 0||rd>=static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
@ -2540,10 +2540,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {nzimm:#05x}", fmt::arg("mnemonic", "caddi16sp"),
|
|
|
|
|
fmt::arg("nzimm", nzimm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(nzimm) {
|
|
|
|
@ -2566,10 +2566,10 @@ private:
|
|
|
|
|
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");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "__reserved_clui");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+4;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
@ -2591,10 +2591,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "csrli"),
|
|
|
|
|
fmt::arg("rs1", name(8+rs1)), fmt::arg("shamt", shamt));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(rs1+ 8 + traits::X0,tu.lshr(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(shamt,8)));
|
|
|
|
@ -2616,10 +2616,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {shamt}", fmt::arg("mnemonic", "csrai"),
|
|
|
|
|
fmt::arg("rs1", name(8+rs1)), fmt::arg("shamt", shamt));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(shamt){ tu.store(rs1+ 8 + traits::X0,tu.lshr((tu.ext(tu.load(rs1+ 8+ traits::X0, 0),32,false)),tu.constant(shamt,8)));
|
|
|
|
@ -2646,10 +2646,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "candi"),
|
|
|
|
|
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(rs1+ 8 + traits::X0,tu.bitwise_and(tu.load(rs1+ 8+ traits::X0, 0),tu.constant((int8_t)sext<6>(imm),8)));
|
|
|
|
@ -2671,10 +2671,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "csub"),
|
|
|
|
|
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(rd+ 8 + traits::X0,tu.sub(tu.load(rd+ 8+ traits::X0, 0),tu.load(rs2+ 8+ traits::X0, 0)));
|
|
|
|
@ -2696,10 +2696,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "cxor"),
|
|
|
|
|
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(rd+ 8 + traits::X0,tu.bitwise_xor(tu.load(rd+ 8+ traits::X0, 0),tu.load(rs2+ 8+ traits::X0, 0)));
|
|
|
|
@ -2721,10 +2721,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "cor"),
|
|
|
|
|
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(rd+ 8 + traits::X0,tu.bitwise_or(tu.load(rd+ 8+ traits::X0, 0),tu.load(rs2+ 8+ traits::X0, 0)));
|
|
|
|
@ -2746,10 +2746,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "cand"),
|
|
|
|
|
fmt::arg("rd", name(8+rd)), fmt::arg("rs2", name(8+rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(rd+ 8 + traits::X0,tu.bitwise_and(tu.load(rd+ 8+ traits::X0, 0),tu.load(rs2+ 8+ traits::X0, 0)));
|
|
|
|
@ -2770,15 +2770,15 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {imm:#05x}", fmt::arg("mnemonic", "cj"),
|
|
|
|
|
fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<12>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
auto returnValue = std::make_tuple(BRANCH);
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, POST_SYNC,74);
|
|
|
|
@ -2797,16 +2797,16 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "cbeqz"),
|
|
|
|
|
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_EQ,tu.load(rs1+ 8+ traits::X0, 0),tu.constant( 0,32)));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<9>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
auto returnValue = std::make_tuple(BRANCH);
|
|
|
|
|
tu.close_scope();
|
|
|
|
@ -2826,16 +2826,16 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {imm:#05x}", fmt::arg("mnemonic", "cbnez"),
|
|
|
|
|
fmt::arg("rs1", name(8+rs1)), fmt::arg("imm", imm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,tu.load(rs1+ 8+ traits::X0, 0),tu.constant( 0,32)));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.add(tu.ext(cur_pc_val,32,false),tu.constant((int16_t)sext<9>(imm),16)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
auto returnValue = std::make_tuple(BRANCH);
|
|
|
|
|
tu.close_scope();
|
|
|
|
@ -2855,10 +2855,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}, {nzuimm}", fmt::arg("mnemonic", "cslli"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)), fmt::arg("nzuimm", nzuimm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rs1>=static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
@ -2887,10 +2887,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, sp, {uimm:#05x}", fmt::arg("mnemonic", "clwsp"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("uimm", uimm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rd>=static_cast<uint32_t>(traits:: RFS)||rd== 0) {
|
|
|
|
@ -2918,10 +2918,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "cmv"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rd>=static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
@ -2949,16 +2949,16 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "cjr"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rs1&&rs1<static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(tu.load(rs1%static_cast<uint32_t>(traits:: RFS)+ traits::X0, 0),tu.constant(~ 0x1,8)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
@ -2976,10 +2976,10 @@ private:
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, PRE_SYNC,81);
|
|
|
|
|
if(this->disass_enabled){
|
|
|
|
|
/* generate console output when executing the command */
|
|
|
|
|
this->core.disass_output(pc.val, "__reserved_cmv");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "__reserved_cmv");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+4;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
@ -3001,10 +3001,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rd}, {rs2}", fmt::arg("mnemonic", "cadd"),
|
|
|
|
|
fmt::arg("rd", name(rd)), fmt::arg("rs2", name(rs2)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rd>=static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
@ -3032,10 +3032,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs1}", fmt::arg("mnemonic", "cjalr"),
|
|
|
|
|
fmt::arg("rs1", name(rs1)));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rs1>=static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
@ -3046,7 +3046,7 @@ private:
|
|
|
|
|
tu.store(1 + traits::X0,tu.add(tu.ext(cur_pc_val,32,false),tu.constant( 2,32)));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(new_pc,tu.constant(~ 0x1,8)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(1U, 1));
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(BRANCH);
|
|
|
|
|
tu.close_scope();
|
|
|
|
@ -3061,10 +3061,10 @@ private:
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, PRE_SYNC,84);
|
|
|
|
|
if(this->disass_enabled){
|
|
|
|
|
/* generate console output when executing the command */
|
|
|
|
|
this->core.disass_output(pc.val, "cebreak");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "cebreak");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+4;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
this->gen_raise_trap(tu, 0, 3);
|
|
|
|
@ -3086,10 +3086,10 @@ private:
|
|
|
|
|
auto mnemonic = fmt::format(
|
|
|
|
|
"{mnemonic:10} {rs2}, {uimm:#05x}(sp)", fmt::arg("mnemonic", "cswsp"),
|
|
|
|
|
fmt::arg("rs2", name(rs2)), fmt::arg("uimm", uimm));
|
|
|
|
|
this->core.disass_output(pc.val, mnemonic);
|
|
|
|
|
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;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rs2>=static_cast<uint32_t>(traits:: RFS)) {
|
|
|
|
@ -3112,10 +3112,10 @@ private:
|
|
|
|
|
vm_base<ARCH>::gen_sync(tu, PRE_SYNC,86);
|
|
|
|
|
if(this->disass_enabled){
|
|
|
|
|
/* generate console output when executing the command */
|
|
|
|
|
this->core.disass_output(pc.val, "dii");
|
|
|
|
|
tu("print_disass(core_ptr, {:#x}, \"{}\");", pc.val, "dii");
|
|
|
|
|
}
|
|
|
|
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
|
|
|
|
pc=pc+4;
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|