Infineon Technologies C166S V2 User Manual page 41

16-bit microcontroller
Table of Contents

Advertisement

PSW
Processor Status Word
15
14
13
12
ILVL
rwh
Field
BANK
In case of an interrupt service, the bank switch is automatically executed by updating the
PSW. The Interrupt Controller (ITC) configuration decides which register bank will be
selected. By executing a RETI instruction, the BANK bit field of the PSW will
automatically be restored and the context will switched to the original register bank.
global
Bank
Execution
Task A
Interrupt of Task B
Figure 2-11 Context Switch by Changing the Physical Register Bank
After a switch to a local register bank, the new bank is immediately available. After
switching to the global register bank, the cached memory-mapped GPRs must be valid
before any further instructions can be executed. If the global register bank is not valid at
this time (in case if the context switch process has been interrupted), the cache
validation process is repeated automatically. For further explanation, please refer to
Section
2.4.3.2.
Note: The switch between the three physical register banks of the register file can also
be executed by writing to the BANK bitfield of the PSW. Because of pipeline
dependencies an explicit change of the PSW must cancel the pipeline.
User Manual
11
10
9
HLD
IEN
BANK
EN
rw
rw
rwh
Bits
Type Description
9-8
rwh
recognized
SFRb
8
7
6
MUL
USR1 USR0
IP
rwh
rwh
rwh
Reserved for register file bank selection
00
Global register bank
01
Reserved
10
Local register bank 1
11
Local register bank 2
local
Bank
Execution
Task B
2-41
User Manual
Central Processing Unit
Reset Value: 0000
5
4
3
2
E
Z
V
rwh
rwh
rwh
global
Bank
Execution
Task A
Execution of
RETI
V 1.7, 2001-01
C166S V2
H
1
0
C
N
rwh
rwh

Advertisement

Table of Contents
loading

Table of Contents