TC1796
System Units (Vol. 1 of 2)
Peripheral Control Processor (PCP)
User’s Manual
11-50
V2.0, 2007-07
PCP, V2.0
11.9
Debugging the PCP
For debugging the PCP, a special instruction, DEBUG, is provided. This instruction can
only be used when the PCP is in Debug Mode. It can be placed at important locations
inside the code to track and trace program execution. The execution of the instruction
depends on a condition code specified with the instruction. The actions programmed for
this instruction will only take place if the specified condition is true.
The following actions are performed when the DEBUG instruction is executed and the
condition code is true:
•
Store the current PC, i.e. the address of the DEBUG instruction, in register
PCP_ES.EPC
•
Store the current channel number in register PCP_ES.EPN
In addition, the following operations can be programmed through fields in the DEBUG
instruction:
•
Optionally stop the channel program execution (instruction field SDB)
•
Optionally generate an external debug event at pin BRKOUT (instruction field EDA)
•
Optionally prevent the PCP from executing any further channel programs (instruction
field DAC)
•
Optionally cause the PCP to decrement the PC prior to saving the channel context
(instruction field RTA)
If the DEBUG instruction is programmed to stop the channel program execution, the
action taken by the PCP depends on the value of the RTA instruction field:
•
If RTA = 0, the PCP disables further invocations of the current channel through
clearing bit R7.CEN, and then performs a context save. The execution of this channel
is stopped at the point of the DEBUG instruction. If the DAC instruction field = 0, the
PCP will continue to operate, accepting service requests for other channels as they
arise. Since the stopped channel was disabled before saving its context, service
requests for this channel will result in an error exit (see
). When re-
enabling the channel, its enable bit CEN in the saved context location CR7 must be
set.
•
If RTA = 1, the PCP does not modify bit R7.CEN (i.e. the channel remains enabled),
decrements the PC (so that it again points to the DEBUG instruction), and then
performs a context save. The execution of this channel is stopped at the point of the
DEBUG instruction. If the DAC instruction field = 0, the PCP will continue to operate,
accepting service requests for channels as they arise. Since the stopped channel
was not disabled before saving its context, service requests for this channel will not
result in an error exit, but will simply cause re-execution of the DEBUG instruction
and hence a repeat of the channel exit.
Note: When a channel is stopped by DEBUG, the context of the stopped channel will be
saved to the appropriate region of the CSA before the channel terminates. Where
a Small or Minimum Context model is being used, the values of the GPRs not