Skip to content
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
4 changes: 2 additions & 2 deletions src/iss/arch/riscv_hart_m_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ template <typename BASE, features_e FEAT> void riscv_hart_m_p<BASE, FEAT>::check
bool mstatus_mie = this->state.mstatus.MIE;
auto m_enabled = this->reg.PRIV < PRIV_M || mstatus_mie;
auto enabled_interrupts = m_enabled ? ena_irq : 0;

if(enabled_interrupts != 0) {
this->reg.pending_trap = 0;
if(enabled_interrupts) {
int res = 0;
while((enabled_interrupts & 1) == 0) {
enabled_interrupts >>= 1;
Expand Down
8 changes: 7 additions & 1 deletion src/sysc/core2sc_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ template <typename PLAT> class core2sc_adapter : public PLAT, public sc2core_if
this->csr[iss::arch::mip] &= ~mask;
this->check_interrupt();
if(value)
SCCTRACE(owner->hier_name()) << "Triggering interrupt " << id << " Pending trap: " << this->reg.pending_trap;
SCCTRACE(owner->hier_name()) << "Triggering interrupt " << id
#ifndef NDEBUG
<< " (Pending trap: " << std::hex << "0x"
<< ((this->reg.pending_trap >> 16) & 0xff) // 0x80 << 24 | (cause << 16) | trap_id
<< ")"
#endif
;
}

void _local_irq_mt(short id, bool value) {
Expand Down
Loading