IPR-NIOS Altera, IPR-NIOS Datasheet - Page 94

no-image

IPR-NIOS

Manufacturer Part Number
IPR-NIOS
Description
IP NIOS II MEGACORE RENEW
Manufacturer
Altera
Type
MegaCorer
Datasheet

Specifications of IPR-NIOS

License
Renewal License
Lead Free Status / RoHS Status
Not applicable / Not applicable
3–48
Nios II Processor Reference Handbook
Handling Nested Exceptions
Without Extra Exception Information
When you have not included the extra exception information in your Nios II system,
your exception handler must determine the cause of exception itself. For this reason,
Altera recommends always enabling the extra exception information.
When the extra exception information is not available, use the sequence in
Example 3–3 on page 3–48
Example 3–3. Determining Exception Cause Without Extra Exception Information
/* With an internal interrupt controller, check for interrupt
if (estatus.PIE == 1 and ipending != 0) {
/* 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 {
}
The Nios II processor supports several types of nested exceptions, depending on
which optional features are implemented. Nested exceptions can occur under the
following circumstances:
An exception handler enables maskable interrupts
An EIC is present, and an NMI occurs
An EIC is present, and the processor is configured to leave maskable interrupts
enabled when taking an interrupt
An exception handler triggers an instruction-related exception
exceptions. With an external interrupt controller, ipending is
always 0, and this check can be omitted. */
handle interrupt
decode instruction at $ea-4
if (instruction is trap)
else if (instruction is load or store)
else if (instruction is branch, bret, callr, eret, jmp, or ret)
else if (instruction is unimplemented)
else if (instruction is illegal)
else if (instruction is divide) {
}
/* Not any known exception */
} else {
}
handle trap exception
handle misaligned data address exception
handle misaligned destination address exception
handle unimplemented instruction exception
handle illegal instruction exception
if (denominator == 0)
else if (instruction is signed divide and numerator == 0x80000000
}
handle unknown exception (If internal interrupt controller
handle division error exception
handle division error exception
is implemented, could be spurious interrupt)
to determine the cause of an exception.
and denominator == 0xffffffff)
December 2010 Altera Corporation
Chapter 3: Programming Model
Exception Processing

Related parts for IPR-NIOS