TC1796
System Units (Vol. 1 of 2)
Peripheral Control Processor (PCP)
User’s Manual 11-28 V2.0, 2007-07
PCP, V2.0
11.4 PCP Operation
This section describes how to initialize the PCP, how to invoke a channel program, and
the general operation of the PCP.
11.4.1 PCP Initialization
The PCP is placed in a quiescent state when the TC1796 is first powered-on or reset.
Before a channel program can be enabled, the PCP as a whole must be initialized by
some other FPI Bus master, typically the CPU. Initialization steps include:
• Configure global PCP registers
– Initialize PCP Control and Status Register (with PCP_CS.EN = 0)
– Configure interrupt system via PCP_ICR
• Load channel programs into the CMEM.
• Load initial context (if/as required) of channel programs in PRAM (R0-R7 for
Maximum Context, R4-R7 for Small Context, R6-R7 for Minimum Context). Only
those registers in each channel whose initial content is required on first invocation of
the channel need to be loaded. This may need to include the initial PC, depending on
the value of PCP_CS.RCB.
• Clear R7 in the context for unused channels
• Enable PCP operation PCP_CS.EN = 1.
Now, the PCP is able to begin accepting interrupts and executing channel programs.
11.4.2 Channel Invocation and Context Restore Operation
A channel program is started when one or other of the following conditions occurs:
• The current round of PCP interrupt arbitration results in a winning interrupt number
(SRPN) and the PCP is currently quiescent (has exited the previous channel and
stored the context for that channel).
• The current round of PCP interrupt arbitration results in a winning interrupt number
(SRPN) that has to be greater than the current channel priority (SRPN > CPPN), if
suitable Service Request Node space is available in the PSRN to store a suspended
interrupt request and the current channel allows interrupts (R7.IEN = 1). See also
Page 11-33).
When this happens the winning SRPN becomes the current interrupt, and a context
restore operation occurs before the new channel program can begin operation, as
follows:
• The context of the channel (= winning SRPN) is restored from PRAM into the GPRs
from the appropriate address within the CSA. Depending on the value of
PCP_CS.CS, a Full, Small, or Minimum Context restore is performed.
• The new priority level of the PCP is taken from R6.CPPN field and is written to
PCP_ICR.CPPN. This value can be useful during debugging, as the CPPN of the
currently executing or last-executed channel program can be read from PCP_ICR.