beautypg.com

8 exception processing, Exception processing -46, Section 5.8 – Freescale Semiconductor StarCore SC140 User Manual

Page 226: Exception processing, E, refer to, Section 5.8, “exception, Processing, Section 5.8, “exception processing, For a

background image

5-46

SC140 DSP Core Reference Manual

Exception Processing

5.8 Exception Processing

Exceptions are events that interfere with the normal operation of the core and the system in which it works.
The Exception working mode was designed to deal with situations such as these. 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.