TC1796
System Units (Vol. 1 of 2)
Peripheral Control Processor (PCP)
User’s Manual
11-17
V2.0, 2007-07
PCP, V2.0
the Full Context, and only some would require more context to be saved. In this case, a
smaller Context Model can be used, and the channels which would require more register
to be saved/restored would do this via explicit load and store instructions. This is
especially advantageous if the channel program can be designed such that the initial
real-time response operations can be executed using only the registers which have been
automatically restored. Then, as the timing requirements of the service are relaxed,
further register contents can be restored from PRAM through regular load instructions.
Of course, the contents of these registers needs to be explicitly saved, through regular
store instructions, before the exit of the channel program.
Note: Special care must be exercised when using Minimum or Small Context Models in
conjunction with nested interrupts (see
The criteria for choosing the Context Model are listed in the following:
•
Size of PRAM implemented in a given derivative
•
Amount of channels (= SRPNs) that need to be used in a system
•
Amount of PRAM used for general variables and globals
•
Amount of context (register content) which need to be saved and restored quickly by
most of the most important channels
While registers R0 through R5 are always restored in a normal manner (according to the
context size), registers R6 and R7 merit discussion regarding context restore operations.
The memory location CR7 in a context region is used to hold two different pieces of
information: The lower part of register R7, and the PC value of the channel. Similarly, the
memory location CR6 in a context region can also be used to hold two different pieces
of information: The value to be restored to register R6, and the Operating Priority (CPPN)
value of the channel. This leads to the Restore/Save operations described in the
following two sections.
11.3.2.3 Context Restore Operation for CR6 and CR7
The operation of R6 and R7 context restore varies according to whether the channel
program that is starting is a “new” channel program (i.e. a channel program that is
starting in response to the receipt of a new service request), or is a “suspended” channel
program (i.e. a channel program that is re-starting after being suspended in favour of a
higher-priority channel program). In addition, when a “new” channel program is starting,
the context restore operation depends on the channel start mode that has been selected
(see