TC1796
System Units (Vol. 1 of 2)
Peripheral Control Processor (PCP)
User’s Manual
11-38
V2.0, 2007-07
PCP, V2.0
11.6
PCP Error Handling
The PCP contains a number of fail-safe mechanisms to ensure that error conditions are
handled gracefully and predictably. In addition to providing an extra level of system
robustness suitable for high integrity and safety-critical systems, these mechanisms can
often ease the task of finding programming errors during the development process.
Whenever an error is detected, the channel program that was executing exits and the
PCP_ES register is updated with information to allow determination of the error that
occurred, the instruction address, and the channel program that was executing when the
error occurred (see
).
11.6.1
Enforced PRAM Partitioning
As previously discussed, the PRAM can be considered as being split into two distinct
areas. The lower of these two areas is the CSA (see
) used for storing
context information for each active channel while the channel program is not actually
executing. The remainder of PRAM is available for general use and is typically used to
hold variables and global data.
The default configuration of the PCP allows the PCP to use PRAM as a single area.
While this default configuration allows complete flexibility regarding the use of PRAM,
this flexibility also introduces the possibility of invalid PCP operation as a result of the
following issues:
•
Any channel program is allowed to write to any PRAM location (including any location
in the CSA). This means that a channel program may be inadvertently programmed
to corrupt the context save region belonging to another channel, causing invalid
operation of the corrupted channel when it next executes.
•
Generation of an interrupt request to the PCP with a priority number that would cause
loading of a context from outside the CSA will cause the spurious execution of a
channel program with an invalid context loaded from outside the CSA.
To avoid spurious PCP operation as a result of either of these programming errors, the
PCP can be optionally configured via the global PCP control and status register
(PCP_CS) to enforce strict partitioning of PRAM. PRAM partitioning is selected by
programming PCP_CS.PPE = 1 and the size of the CSA in use is selected via the
PCP_CS.PPS bit field (see
). When PRAM partitioning has been enabled, a
PCP error will be generated on either of the following events:
•
A channel program executes a PRAM write instruction with a target area within the
CSA. This prevents a channel from corrupting the context save region of any other
channel.
•
An incoming interrupt request causes the PCP to attempt to load a context from
outside the CSA. This prevents the PCP from running an invalid channel program as
a result of an invalid interrupt request.