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_SW();
bool Exec_C_JAL(int m_rd);
bool Exec_C_EBREAK();
bool process_instruction(Instruction *inst);
};

View File

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

View File

@ -138,11 +138,11 @@ op_C_Codes C_extension::decode() const {
break;
[[unlikely]] default:
return OP_C_ERROR;
break;
}
return OP_C_ERROR;
}
@ -663,6 +663,20 @@ bool C_extension::Exec_C_JAL(int m_rd) {
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 PC_not_affected = true;
@ -747,6 +761,9 @@ bool C_extension::process_instruction(Instruction *inst) {
case OP_C_AND:
Exec_C_AND();
break;
case OP_C_EBREAK:
Exec_C_EBREAK();
break;
[[unlikely]] default:
std::cout << "C instruction not implemented yet" << "\n";
inst->dump();