diff --git a/src/sysc/core_complex.cpp b/src/sysc/core_complex.cpp index 3d29ee8..f7b95c7 100644 --- a/src/sysc/core_complex.cpp +++ b/src/sysc/core_complex.cpp @@ -175,9 +175,9 @@ public: void wait_until(uint64_t flags) override { SCCDEBUG(owner->name()) << "Sleeping until interrupt"; - do { + while(this->reg.pending_trap == 0 && (this->csr[arch::mip] & this->csr[arch::mie]) == 0) { sc_core::wait(wfi_evt); - } while (this->reg.pending_trap == 0); + } PLAT::wait_until(flags); }