fixes m/uintstatus read

This commit is contained in:
Eyck Jentzsch 2023-03-17 10:51:39 +01:00
parent febbc4fff0
commit 7efa924510
2 changed files with 3 additions and 3 deletions

View File

@ -967,7 +967,7 @@ template <typename BASE, features_e FEAT> iss::status riscv_hart_m_p<BASE, FEAT>
template<typename BASE, features_e FEAT>
iss::status riscv_hart_m_p<BASE, FEAT>::read_intstatus(unsigned addr, reg_t& val) {
val = (clic_mprev_lvl&0xff) <<24;
val = (clic_mact_lvl&0xff) <<24;
return iss::Ok;
}

View File

@ -1161,9 +1161,9 @@ template <typename BASE, features_e FEAT> iss::status riscv_hart_mu_p<BASE, FEAT
template<typename BASE, features_e FEAT>
iss::status riscv_hart_mu_p<BASE, FEAT>::read_intstatus(unsigned addr, reg_t& val) {
auto mode = (addr >> 8) & 0x3;
val = clic_uprev_lvl&0xff;
val = clic_uact_lvl&0xff;
if(mode==0x3)
val += (clic_mprev_lvl&0xff) <<24;
val += (clic_mact_lvl&0xff) <<24;
return iss::Ok;
}