Exception Processing
SC140 DSP Core Reference Manual
5-29
If the stop processing state is exited during the assertion of an external interrupt request, the core enters the
exception state and services the highest priority pending interrupt. If no interrupt is pending, the core enters
the normal state and executes the instruction following the STOP instruction that caused the entry into the
stop state.
If the stop processing state is exited by a high level on the EE0 signal or a debug request from the JTAG,
and the IME bit in the EOnCE EMCR register is not set, the core enters the debug state immediately. If the
IME bit is set, the core enters the exception state and services the debug exception instead of entering the
debug state.
5.5 Exception Processing
The exception processing state is associated with interrupts that can be generated by conditions either
inside the core or from external sources. In general, the prioritizing and arbitrating between all the
exception sources is performed in the programmable interrupt controller (PIC), which is not part of the
SC140 core. This section describes the exception handling after the PIC has determined which interrupt
request is issued to the core.
A distinction is made between the terms “exception” and “interrupt” in this section. “Exception” is used as
a general term for all the cases that interfere with normal program execution, whether generated by
hardware or software, internal or external. “Interrupt” is used only for external (off-core) hardware
interrupt sources.
There are three categories of exceptions as listed below:
Internal Exceptions
— These have the highest priority, ranging from 0 to 3, with 0 the highest. Each
of these three, TRAP, ILLEGAL, and DEBUG, has a separate priority and a separate offset address
vector. The offset address vector forms part of the address to which the program jumps to perform a
particular routine in response to the exception.
Non-Maskable External Interrupts
— These have the next highest priority level, four. A
non-maskable external interrupt is driven from the external interrupt controller. Its offset address
vector is either the AUTO-VEC (0x180) or the value on the 6-bit Interrupt Offset bus.
Maskable External Interrupts
— These have the lowest priority level, five (in comparison to the
above exceptions). Each occurrence of a maskable external interrupt has an interrupt priority level
(IPL) associated with it, driven on the IPL bus. This IPL value is compared to the internal masking
threshold defined in the SR. If the IPL exceeds the threshold, it can be serviced. The offset address
value is either the AUTO-VEC (0x1c0) or the value on the 6-bit Interrupt Offset bus.
Note that two types of priority terms are in use here. One is the priority among the three major types above,
including the four levels in type 1. The second is the interrupt priority level, from 0 to 7, which only
applies within the maskable external interrupts. The first priority type, with values from 0 to 5, determines
which exception is to be taken if two or more exceptions are pending on the same clock cycle. The second
priority type, the interrupt priority level, determines whether a maskable external interrupt is taken or not.