Nios II Gen2 プロセッサー・リファレンス・ガイド

ID 683836
日付 10/28/2016
Public
ドキュメント目次

3.7.10.2. Nios II/e の例外処理

Nios II/e の例外処理における例外の原因の特定

/* With an internal interrupt controller, check for interrupt exceptions. With an external interrupt controller, ipending is always 0, and this check can be omitted. */ if (estatus.PIE == 1 and ipending != 0) { handle interrupt /* Decode exception from instruction */ /* Note: Because the exception register is included with the MMU and */ /* MPU, you never need to determine MMU or MPU exceptions by decoding */ } else { decode instruction at $ea-4 if (instruction is trap) handle trap exception else if (instruction is load or store) handle misaligned data address exception else if (instruction is branch, bret, callr, eret, jmp, or ret) handle misaligned destination address exception else if (instruction is unimplemented) handle unimplemented instruction exception else if (instruction is illegal) handle illegal instruction exception else if (instruction is divide) { if (denominator == 0) handle division error exception else if (instruction is signed divide and numerator == 0x80000000 and denominator == 0xffffffff) handle division error exception } } /* Not any known exception */ } else { handle unknown exception (If internal interrupt controller is implemented, could be spurious interrupt) } }