Exception Processing
SC140 DSP Core Reference Manual
5-31
3.
The PSEQ services an exception request when ready, typically in five cycles. It may
postpone an exception while a change-of-flow is executing (up to 16 cycles latency). Refer
to
Section 6.3.3, “Interrupt Timing,”
on page 6-12, for further details. After fetching an
exception service routine base address, the core enters the exception processing state. The
next PC value (namely, the address of the execution set where execution should be resumed
upon the return from the exception) is pushed onto the exception stack together with the SR.
The instruction set at the exception vector address associated with the selected exception is
fetched. This address is formed as follows:
— Bits 31:12 from the Vector Base Address Register (VBA)
— Bits 11:6 from either the exception and interrupt address offset table (Table 5-14) or the external
Interrupt Offset Bus as enabled by the AUTO_VEC signal and an external interrupt. External
interrupts with a default vector address (indicated by the AUTO_VEC
signal) refer to the
AUTO-NMI and AUTO-IR vectors in Table 5-14.
— Bits 5:0 of an exception vector base address are always zero, allowing 64 bytes at each vector.
The first three execution sets from the fetched exception vector enter execution. Only then can
a new exception request be serviced.
To obtain minimum penalty on return from an exception, the SC140 instruction set provides a delayed
return from the exception instruction. This takes five or six cycles to execute, but allows the usage of some
of these cycles to execute instructions. Refer to
Appendix A, “SC140 DSP Core Instruction Set,“
for
details on return-from-exception usage in the RTE and RTED instructions.
5.5.1 Exceptions Programming Model
The exception handling programmer’s model includes:
Enabling and disabling bits for some of the exception sources
Master interrupts enable or disable bits
Seven priority levels of interrupts
Programmable address for the exception vectors table (VBA register)
EMR, SR registers
5.5.1.1 Controlling Individual Interrupt Sources
Controlling a specific maskable interrupt request source is determined by an external device and prioritized
accordingly.
5.5.1.2 Controlling All Interrupt Sources
All maskable interrupts can be disabled with the DI instruction, which sets the DI bit in the SR. No
interrupts are serviced after the DI instruction is executed. As a result, the code following the DI
instruction does not need to take into account any possible pipeline effects caused by interrupts.
Non-maskable exceptions are not blocked by the DI instruction. The EI instruction enables unmasked
interrupts and clears the DI bit in the SR.