Implemented C_EBREAK instruction

This commit is contained in:
mariusmonton 2021-01-18 09:14:54 +01:00
parent 286dbf07a6
commit cb63c65d7f
3 changed files with 20 additions and 2 deletions

View File

@ -415,6 +415,7 @@ public:
bool Exec_C_LW(); bool Exec_C_LW();
bool Exec_C_SW(); bool Exec_C_SW();
bool Exec_C_JAL(int m_rd); bool Exec_C_JAL(int m_rd);
bool Exec_C_EBREAK();
bool process_instruction(Instruction *inst); bool process_instruction(Instruction *inst);
}; };

View File

@ -933,7 +933,7 @@ bool BASE_ISA::Exec_EBREAK() {
perf->dump(); perf->dump();
RaiseException(EXCEPTION_CAUSE_BREAKPOINT, m_instr); RaiseException(EXCEPTION_CAUSE_BREAKPOINT, m_instr);
NOP();
return true; return true;
} }

View File

@ -138,11 +138,11 @@ op_C_Codes C_extension::decode() const {
break; break;
[[unlikely]] default: [[unlikely]] default:
return OP_C_ERROR; return OP_C_ERROR;
break; break;
} }
return OP_C_ERROR; return OP_C_ERROR;
} }
@ -663,6 +663,20 @@ bool C_extension::Exec_C_JAL(int m_rd) {
return true; return true;
} }
bool C_extension::Exec_C_EBREAK() {
log->SC_log(Log::INFO) << "C.EBREAK" << "\n";
std::cout << "\n" << "C.EBRAK Instruction called, dumping information"
<< "\n";
regs->dump();
std::cout << "Simulation time " << sc_core::sc_time_stamp() << "\n";
perf->dump();
RaiseException(EXCEPTION_CAUSE_BREAKPOINT, m_instr);
NOP();
return true;
}
bool C_extension::process_instruction(Instruction *inst) { bool C_extension::process_instruction(Instruction *inst) {
bool PC_not_affected = true; bool PC_not_affected = true;
@ -747,6 +761,9 @@ bool C_extension::process_instruction(Instruction *inst) {
case OP_C_AND: case OP_C_AND:
Exec_C_AND(); Exec_C_AND();
break; break;
case OP_C_EBREAK:
Exec_C_EBREAK();
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();