Skip to content

Commit 7812eab

Browse files
authored
Merge pull request #1862 from NewPaulWalker/fix-hvip
Fix WMASK of LCOFI bit(bit 13) in hvip
2 parents eb0a3e2 + 275c668 commit 7812eab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

riscv/csrs.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,8 @@ reg_t hvip_csr_t::read() const noexcept {
18361836

18371837
bool hvip_csr_t::unlogged_write(const reg_t val) noexcept {
18381838
state->mip->write_with_mask(MIP_VSSIP, val); // hvip.VSSIP is an alias of mip.VSSIP
1839-
return basic_csr_t::unlogged_write(val & (MIP_VSEIP | MIP_VSTIP));
1839+
const reg_t lscof_int = proc->extension_enabled(EXT_SSCOFPMF) ? MIP_LCOFIP : 0;
1840+
return basic_csr_t::unlogged_write(val & (lscof_int | MIP_VSEIP | MIP_VSTIP));
18401841
}
18411842

18421843
ssp_csr_t::ssp_csr_t(processor_t* const proc, const reg_t addr, const reg_t mask, const reg_t init):

0 commit comments

Comments
 (0)