5-34
SC140 DSP Core Reference Manual
Program Control
5.5.4 Internal Exceptions
This section describes exceptions associated with normal flow interrupts generated by conditions internal
to the core. The internal exceptions (except the TRAP instruction) are
imprecise.
These exceptions occur
asynchronously after detecting the exception condition. Thus, they are unable to identify the precise
location of the offending instruction. They are used mostly for diagnostics during program debugging.
5.5.4.1 EMR Exception Bits
To enable users to debug applications and avoid illegal conditions and errors, the SC140 core provides
exception bits in the EMR, which are set when an exception is detected. The EMR is described in detail in
Section 3.1.2, “Exception and Mode Register (EMR).”
Until the relevant bit is cleared, any additional
event of the same type is ignored. The address of the execution set that caused the last exception is written
to the PC_EXCP register of the EOnCE. Refer to
Section 4.5.8, “PC of the Exception Execution Set
(PC_EXCP),”
for a detailed description of the PC_EXCP register. If two or more exceptions are pending
on the same clock cycle, the one with the higher priority (as defined in Table 5-14 on page 5-32) is taken.
5.5.4.1.1 Illegal Instruction
An illegal instruction exception is generated when one or more of the instruction opcodes coming from the
program memory do not belong to the SC140 instruction set. To prevent the system from entering a
deadlock state whenever there is an illegal instruction, an internal exception request is generated, and the
ILIN bit in the EMR is set. The execution flow continues until the exception is serviced. Execution of the
original program is undefined.
5.5.4.1.2 Illegal Execution Set
An illegal execution set exception is generated whenever one of the following execution set grouping rules
is violated:
A maximum of four DALU instructions per set can occupy different modulo four positions within
the set.
A maximum of two AGU instructions per set can occupy different modulo two positions within the
set.
A maximum of two extension words per set can occupy different modulo two positions within the
set.
A maximum of one accelerator instruction is allowed per set.
Whenever an illegal set occurs, an exception request is generated. The ILST bit in the EMR is set, and
instruction execution continues until the exception is serviced. Execution of the original program code is
undefined after this exception occurs.
5.5.4.1.3 DALU Overflow
The DALU overflow exception is generated whenever an overflow occurs as a result of a DALU
operation. Whenever there is an overflow, an exception is generated and the DOVF bit in the EMR is set, if
the exception enable bit OVE in the SR is set. Depending on the algorithm, the overflow exception routine
may take corrective action.