TC1796
System Units (Vol. 1 of 2)
Peripheral Control Processor (PCP)
User’s Manual
11-14
V2.0, 2007-07
PCP, V2.0
11.3.2.2 Context Save Area
The Context Save Area (CSA) is a region in PRAM reserved for storing the contexts for
all channel programs (while any particular channel is not executing). Each channel’s
context is stored in a region of the CSA based on the channel number. The channel
number is equal to the priority number (SRPN) of the service request. The PCP uses this
number to calculate the start address of the context of the associated channel program.
The size of a context is determined by the Context Model that the PCP has been
initialized to use. As all channels use the same context size, the PRAM address (word
address) of the context for a particular channel is simply calculated by multiplying the
channel number by the number of registers in the context (8 for Full Context, 4 for Small
Context and 2 for Minimum Context).
shows the resulting PRAM layout, and
from this it can be seen that changing the Context Model also changes the base address
for all regions within the CSA. Thus, the chosen Context Model may only be set when
the PCP is initialized, and may not be changed during operation.
The CSA in the PRAM starts at address 00
H
and grows upward. It is partitioned into
equally sized regions, where the size of these regions is determined by the selected
Context Model. The priority number (SRPN) of a service request is used to access the
appropriate context region for the associated channel program. Since a request with an
SRPN of 00
H
is not considered as valid request in the TriCore Architecture, the bottom
region (context region 0) of the CSA is never used for an actual context.
The total size of the CSA depends on the Context Model and the number of service
request numbers used in a given system. Each priority number used in a service request
node which can activate interrupts to the PCP must be represented through a dedicated
context region in the PRAM. The highest address range in the PRAM used for a context
region is determined by the highest priority number presented to the PCP with a service
request.
The range of usable priority numbers is further determined by the size of the
implemented PRAM and by the space required for other variables and global data
located in the PRAM. See
for the implemented size of the PRAM in the
TC1796. As an example, a PRAM of 2 Kbytes, solely used for the CSA, can store up to
255 Minimum Contexts, allowing the highest SRPN used for a PCP service request to
be 255 (remember, an SRPN of 0 and an associated context region is never used; the
valid SRPNs and the context and channel numbers range from 1 to 255). With a Small
Context Model, 127 contexts can be stored, resulting in 127 being the highest usable
SRPN in this configuration. Finally, a Full Context Model allows 63 context areas, with
63 being the highest usable SRPN. Interrupt requests to the PCP with priority numbers
that would cause loading of a context from outside the available PRAM area must not be
generated. Invalid PCP operation will result should this situation be allowed to occur. The
PCP can be optionally configured such that if an interrupt request is received that would
cause loading of a context from outside the available PRAM area then an error exit is
forced, and an error interrupt to the CPU is activated (see