adds support for compressed instructions

This commit is contained in:
Eyck-Alexander Jentzsch 2022-05-20 15:17:58 +02:00
parent df16378605
commit 1720bd4aaa
1 changed files with 4 additions and 3 deletions

View File

@ -157,8 +157,9 @@ void cov::callback(instr_info_t iinfo, const exec_info& einfo) {
size_t id = iinfo.instr_id;
auto entry = delays[id];
auto instr = instr_if->get_instr_word();
auto call = (id==2 || id==3) && bit_sub<7,5>(instr)!=0;
auto call = id==65 || id ==86 || ((id==2 || id==3) && bit_sub<7,5>(instr)!=0) ;//not taking care of tail calls (jalr with loading x6)
bool taken = einfo.branch_taken;
bool compressed = (instr&0x3)!=0x3;
if (einfo.branch_taken) {
delay = entry.taken;
if(entry.taken > 1)
@ -169,10 +170,10 @@ void cov::callback(instr_info_t iinfo, const exec_info& einfo) {
instr_if->set_curr_instr_cycles(entry.not_taken);
}
#ifndef WITH_LZ4
output<<std::hex <<"0x" << instr_if->get_pc() <<"," << delay <<"," << call<< "\n";
output<<std::hex <<"0x" << instr_if->get_pc() <<"," << delay <<"," << call<<","<<(compressed?2:4) <<"\n";
#else
auto rdbuf=ostr.rdbuf();
ostr<<std::hex <<"0x" << instr_if->get_pc() <<"," << delay <<"," << call<< "\n";
ostr<<std::hex <<"0x" << instr_if->get_pc() <<"," << delay <<"," << call<<","<<(compressed?2:4) <<"\n";
#endif
}
}