TC1796
System Units (Vol. 1 of 2)
Peripheral Control Processor (PCP)
User’s Manual
11-29
V2.0, 2007-07
PCP, V2.0
After the channel program starts, the value of R6 may be changed without altering
the value of the effective CPPN, because updates to the value of R6.CPPN have no
effect until the next invocation of the channel program.
•
If the R7.CEN bit is clear (0), then an error has occurred because a disabled channel
program has been invoked, the PCP_ES.DCR bit is set to flag the error, and the
channel program performs an error exit (see
•
If the R7.CEN bit is set (1), then code execution begins at the value of the restored
PC or at the address of the interrupt routine in the Channel Entry Table, depending
on the value of PCP_CS.RCB.
Special care needs to be taken regarding the number of clock cycles required to switch
context when the last state of the PCP before channel exit was execution of channel “N”
(SRPN = “N”), and the current service request is also SRPN = “N”. In this case, the PCP
Processor Core should not load the context (as the PCP GPRs already contain the
correct content), but continue operation from the current point and state (noting that the
PC value should be set to the appropriate channel entry point if PCP_CS.RCB = 1).
11.4.3
Channel Exit and Context Save Operation
The context of a channel program must be saved when it terminates. Three events can
cause the termination of a channel program:
•
Execution of the EXIT instruction (normal termination)
•
Occurrence of an error
•
Execution of the DEBUG instruction (channel termination is optional). The DEBUG
instruction must be only used in DEBUG mode; otherwise an “Illegal Operation” (IOP)
error will be generated.
These channel termination possibilities are described in the next sections.
11.4.3.1 Normal Exit
Under normal circumstances, a channel program finishes by executing an EXIT
instruction. This instruction has several setting fields that allow the user to specify a
number of optional actions to be performed during the channel exit sequence (see
). These optional actions are:
•
Decrement counter CNT1
•
Set the start PC for the next channel invocation to the next instruction address
(Channel Resume) or to the channel entry address (Channel Restart)
•
Disable further invocations of this channel
•
Generate an interrupt request to the CPU or to the PCP itself
When the EXIT instruction is executed, the following sequence occurs:
•
If EC = 1 is specified Counter R6.CNT1 is decremented and the CN1Z flag is
updated.