Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(intr): Modify Spike so that when it acts as REF, it can only chec… #72

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions difftest/difftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,10 @@ void DifftestRef::raise_intr(uint64_t no) {
bool external_set = (is_timer_interrupt || is_external_interrupt) && from_outside;
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
6 changes: 6 additions & 0 deletions riscv/execute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,13 @@ void processor_t::step(size_t n)

try
{
#if defined(DIFFTEST)
if (check_interrupt) {
take_pending_interrupt();
}
#else
take_pending_interrupt();
#endif

check_if_lpad_required();

Expand Down
3 changes: 3 additions & 0 deletions riscv/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ class processor_t : public abstract_device_t

vectorUnit_t VU;
triggers::module_t TM;
#if defined(DIFFTEST)
bool check_interrupt = false;
#endif
};

#endif
Loading