Skip to content

Commit

Permalink
fix(raise_intr): fix raise_intr to allow clearing values in mip. (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewPaulWalker authored Jan 3, 2025
1 parent 08a76d3 commit 124f1fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions difftest/difftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,14 @@ void DifftestRef::raise_intr(uint64_t no) {
// 0x1e00: 9 (Supervisor), 10 (Virtual supervisor), 11 (Machine), 12 (Supervisor guest)
bool from_outside = !(mip_bit & state->mip->read());
bool external_set = (is_timer_interrupt || is_external_interrupt) && from_outside;
p->check_interrupt = true;
if (external_set) {
state->mip->backdoor_write_with_mask(mip_bit, mip_bit);
step(1);
state->mip->backdoor_write_with_mask(mip_bit, ~mip_bit);
} else {
step(1);
}
p->check_interrupt = true;
step(1);
p->check_interrupt = false;
}
}
Expand Down

0 comments on commit 124f1fd

Please sign in to comment.