Skip to content

Commit 0178ba8

Browse files
committed
Fix read value of CSR mip.
The read value of mip should not depend on the value of hvip. hvip.VSSIP is an alias of mip.VSSIP, so when reading hvip, the VSSIP bit of mip needs to be OR-ed. Similarly, when writing to hvip, the VSSIP bit of mip also needs to be updated. However, there is no reason for the value of mip to depend on the value of hvip when being read.
1 parent 7812eab commit 0178ba8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

riscv/csrs.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ mip_csr_t::mip_csr_t(processor_t* const proc, const reg_t addr):
781781
}
782782

783783
reg_t mip_csr_t::read() const noexcept {
784-
return val | state->hvip->basic_csr_t::read();
784+
return val;
785785
}
786786

787787
void mip_csr_t::backdoor_write_with_mask(const reg_t mask, const reg_t val) noexcept {

0 commit comments

Comments
 (0)