changed pointer by reference
This commit is contained in:
parent
5caf1b77c8
commit
f7c9f47c3f
|
@ -89,7 +89,7 @@ public:
|
||||||
bool Exec_A_AMOMINU() const;
|
bool Exec_A_AMOMINU() const;
|
||||||
bool Exec_A_AMOMAXU() const;
|
bool Exec_A_AMOMAXU() const;
|
||||||
|
|
||||||
bool process_instruction(Instruction *inst);
|
bool process_instruction(Instruction &inst);
|
||||||
|
|
||||||
void TLB_reserve(std::uint32_t address);
|
void TLB_reserve(std::uint32_t address);
|
||||||
bool TLB_reserved(std::uint32_t address);
|
bool TLB_reserved(std::uint32_t address);
|
||||||
|
|
|
@ -336,7 +336,7 @@ public:
|
||||||
* @param inst instruction to execute
|
* @param inst instruction to execute
|
||||||
* @return true if PC is affected by instruction
|
* @return true if PC is affected by instruction
|
||||||
*/
|
*/
|
||||||
bool process_instruction(Instruction *inst, bool *breakpoint = nullptr);
|
bool process_instruction(Instruction &inst, bool *breakpoint = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Decodes opcode of instruction
|
* @brief Decodes opcode of instruction
|
||||||
|
|
|
@ -405,7 +405,7 @@ public:
|
||||||
bool Exec_C_JAL(int m_rd);
|
bool Exec_C_JAL(int m_rd);
|
||||||
bool Exec_C_EBREAK();
|
bool Exec_C_EBREAK();
|
||||||
|
|
||||||
bool process_instruction(Instruction *inst, bool *breakpoint = nullptr);
|
bool process_instruction(Instruction &inst, bool *breakpoint = nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -69,7 +69,7 @@ public:
|
||||||
bool Exec_M_REM() const;
|
bool Exec_M_REM() const;
|
||||||
bool Exec_M_REMU() const;
|
bool Exec_M_REMU() const;
|
||||||
|
|
||||||
bool process_instruction(Instruction *inst);
|
bool process_instruction(Instruction &inst);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -385,10 +385,10 @@ bool A_extension::TLB_reserved(std::uint32_t address) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool A_extension::process_instruction(Instruction *inst) {
|
bool A_extension::process_instruction(Instruction &inst) {
|
||||||
bool PC_not_affected = true;
|
bool PC_not_affected = true;
|
||||||
|
|
||||||
setInstr(inst->getInstr());
|
setInstr(inst.getInstr());
|
||||||
|
|
||||||
switch (decode()) {
|
switch (decode()) {
|
||||||
case OP_A_LR:
|
case OP_A_LR:
|
||||||
|
@ -426,7 +426,7 @@ bool A_extension::process_instruction(Instruction *inst) {
|
||||||
break;
|
break;
|
||||||
[[unlikely]] default:
|
[[unlikely]] default:
|
||||||
std::cout << "A instruction not implemented yet" << std::endl;
|
std::cout << "A instruction not implemented yet" << std::endl;
|
||||||
inst->dump();
|
inst.dump();
|
||||||
NOP();
|
NOP();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1172,11 +1172,11 @@ bool BASE_ISA::Exec_SFENCE() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BASE_ISA::process_instruction(Instruction *inst, bool *breakpoint) {
|
bool BASE_ISA::process_instruction(Instruction &inst, bool *breakpoint) {
|
||||||
bool PC_not_affected = true;
|
bool PC_not_affected = true;
|
||||||
|
|
||||||
*breakpoint = false;
|
*breakpoint = false;
|
||||||
setInstr(inst->getInstr());
|
setInstr(inst.getInstr());
|
||||||
|
|
||||||
switch (decode()) {
|
switch (decode()) {
|
||||||
case OP_LUI:
|
case OP_LUI:
|
||||||
|
@ -1344,7 +1344,7 @@ bool BASE_ISA::process_instruction(Instruction *inst, bool *breakpoint) {
|
||||||
break;
|
break;
|
||||||
[[unlikely]] default:
|
[[unlikely]] default:
|
||||||
std::cout << "Wrong instruction" << "\n";
|
std::cout << "Wrong instruction" << "\n";
|
||||||
inst->dump();
|
inst.dump();
|
||||||
NOP();
|
NOP();
|
||||||
//sc_stop();
|
//sc_stop();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -680,12 +680,12 @@ bool C_extension::Exec_C_EBREAK() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool C_extension::process_instruction(Instruction *inst, bool *breakpoint) {
|
bool C_extension::process_instruction(Instruction &inst, bool *breakpoint) {
|
||||||
bool PC_not_affected = true;
|
bool PC_not_affected = true;
|
||||||
|
|
||||||
*breakpoint = false;
|
*breakpoint = false;
|
||||||
|
|
||||||
setInstr(inst->getInstr());
|
setInstr(inst.getInstr());
|
||||||
|
|
||||||
switch (decode()) {
|
switch (decode()) {
|
||||||
case OP_C_ADDI4SPN:
|
case OP_C_ADDI4SPN:
|
||||||
|
@ -773,7 +773,7 @@ bool C_extension::process_instruction(Instruction *inst, bool *breakpoint) {
|
||||||
break;
|
break;
|
||||||
[[unlikely]] default:
|
[[unlikely]] default:
|
||||||
std::cout << "C instruction not implemented yet" << "\n";
|
std::cout << "C instruction not implemented yet" << "\n";
|
||||||
inst->dump();
|
inst.dump();
|
||||||
NOP();
|
NOP();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,10 +245,10 @@ bool M_extension::Exec_M_REMU() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool M_extension::process_instruction(Instruction *inst) {
|
bool M_extension::process_instruction(Instruction &inst) {
|
||||||
bool PC_not_affected = true;
|
bool PC_not_affected = true;
|
||||||
|
|
||||||
setInstr(inst->getInstr());
|
setInstr(inst.getInstr());
|
||||||
|
|
||||||
switch (decode()) {
|
switch (decode()) {
|
||||||
case OP_M_MUL:
|
case OP_M_MUL:
|
||||||
|
@ -277,7 +277,7 @@ bool M_extension::process_instruction(Instruction *inst) {
|
||||||
break;
|
break;
|
||||||
[[unlikely]] default:
|
[[unlikely]] default:
|
||||||
std::cout << "M instruction not implemented yet" << "\n";
|
std::cout << "M instruction not implemented yet" << "\n";
|
||||||
inst->dump();
|
inst.dump();
|
||||||
//NOP(inst);
|
//NOP(inst);
|
||||||
sc_core::sc_stop();
|
sc_core::sc_stop();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue