User Manual
C166S V2
Table of Contents
Page
User Manual
5
V 1.7, 2001-01
1
1.1
1.2
1.2.1
1.2.2
1.2.3
1.2.4
1.2.5
1.2.6
1.2.7
1.2.8
1.2.9
1.2.10
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Technical Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
System Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
On-Chip Memory Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Data Management Unit (DMU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Program Memory Unit (PMU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Interrupt and PEC Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
OCDS and JTAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
External Bus Controller (EBC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
System Control Unit (SCU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Clock Generation Unit (CGU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
On-Chip Bootstrap Loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2
2.1
2.2
2.3
2.3.1
2.3.2
2.3.3
2.3.3.1
2.3.3.2
2.3.4
2.3.5
2.3.6
2.3.6.1
2.3.6.2
2.4
2.4.1
2.4.2
2.4.3
2.4.3.1
2.4.3.2
2.5
2.5.1
2.5.2
2.5.2.1
2.5.2.2
2.5.2.3
2.5.2.4
2.5.3
2.5.4
Central Processing Unit
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Register Description Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
CPU Special Function Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Instruction Fetch and Program Flow Control . . . . . . . . . . . . . . . . . . . . . . . 19
Branch Target Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Branch Detection and Branch Prediction . . . . . . . . . . . . . . . . . . . . . . . . 22
Sequential and Mispredicted Instruction Flow . . . . . . . . . . . . . . . . . . . . 24
Correctly Predicted Instruction Flow . . . . . . . . . . . . . . . . . . . . . . . . . 24
Incorrectly Predicted Instruction Flow . . . . . . . . . . . . . . . . . . . . . . . . 26
Atomic and Extend Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Code Addressing via Code Segment and Instruction Pointer . . . . . . . . 28
IFU Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
The CPU Configuration Register CPUCON1 . . . . . . . . . . . . . . . . . . . 30
The CPU Configuration Register CPUCON2 . . . . . . . . . . . . . . . . . . . 31
Use of General Purpose Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Memory Mapped GPR Banks and the Global Register Bank . . . . . . . . 36
Local Register Bank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Context Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Changing the selected Physical Register Bank . . . . . . . . . . . . . . . . . 40
Context Switching of the Global Register Bank . . . . . . . . . . . . . . . . . 42
Data Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Short Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Long and Indirect Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Addressing via Data Page Pointer DPP . . . . . . . . . . . . . . . . . . . . . . 49
DPP Override Mechanism in the C166S V2 CPU . . . . . . . . . . . . . . . 51
Long Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Indirect Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
DSP Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
The CoREG Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63