找回密码
 注册
搜索
查看: 757|回复: 5

[综合资料] TI TMS320C54x DSP参考手册集

[复制链接]
发表于 2006-3-18 16:28:00 | 显示全部楼层 |阅读模式
TMS320C54x
Optimizing C Compiler
User’s Guide
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Provides an overview of the TMS320C54x software development tools, specifically the
compiler.
1.1 Software Development Tools Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.2 Tools Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.3 C Compiler Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.3.1 ANSI Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.3.2 Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.3.3 Compiler Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
1.3.4 Compiler Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
1.3.5 Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
2 C Compiler Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Describes how to operate the C compiler and the shell program. Contains instructions for
invoking the shell program, which compiles, assembles, and links a C source file. Discusses
the interlist utility, compiler options, and compiler errors.
2.1 About the Shell Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.2 Invoking the C Compiler Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2.3 Changing the Compiler’s Behavior With Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2.3.1 Frequently Used Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
2.3.2 Specifying Filenames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
2.3.3 Changing How the Shell Program Interprets Filenames (–fa, –fc, and
–fo Options) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
2.3.4 Changing How the Shell Program Interprets and Names Extensions (–ea and
–eo Options) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
2.3.5 Specifying Directories (–fr, –fs, and –ft Options) . . . . . . . . . . . . . . . . . . . . . . . . 2-17
2.3.6 Options That Overlook ANSI C Type-Checking . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
2.3.7 Options That Control the Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19
2.4 Using Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
2.4.1 Specifying Directories with the C_DIR Environment Variable . . . . . . . . . . . . . 2-20
2.4.2 Setting Options With the C_OPTION Environment Variable . . . . . . . . . . . . . . 2-21
2.4.3 Setting a Temporary-File Directory With the TMP Environment Variable . . . . 2-22
2.5 Controlling the Preprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
2.5.1 Predefined Macro Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
2.5.2 The Search Path for #include Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
2.5.3 Generating a Preprocessed Listing File (–pl Option) . . . . . . . . . . . . . . . . . . . . . 2-26
2.5.4 Creating Custom Error Messages With the #warn and #error Directives . . . 2-27
2.5.5 Enabling Trigraph Expansion (–pg Option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
2.5.6 Creating a Function Prototype Listing File (–pf Option) . . . . . . . . . . . . . . . . . . 2-27
2.6 Using Inline Function Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28
2.6.1 Inlining Intrinsic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28
2.6.2 Controlling Inline Function Expansion (–x Option) . . . . . . . . . . . . . . . . . . . . . . . 2-29
2.6.3 Definition-Controlled Inline Function Expansion . . . . . . . . . . . . . . . . . . . . . . . . . 2-29
2.6.4 The _INLINE Preprocessor Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
2.7 Using the Interlist Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33
2.8 Understanding and Handling Compiler Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35
2.8.1 Generating an Error Message (–pr Option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36
2.8.2 Treating Code-E Errors as Warnings (–pe Option) . . . . . . . . . . . . . . . . . . . . . . 2-36
2.8.3 Altering the Level of Warning Messages (–pw Option) . . . . . . . . . . . . . . . . . . . 2-36
2.8.4 An Example of How You Can Use Error/Warning Options . . . . . . . . . . . . . . . . 2-37
3 Optimizing Your Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Describes how to optimize your C code, including such features as inlining and loop unrolling.
Also describes the types of optimizations that are performed when you use the optimizer.
3.1 Using the Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.2 Using the –o3 Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
3.2.1 Controlling File-Level Optimizations (–ol n Option) . . . . . . . . . . . . . . . . . . . . . . . 3-4
3.2.2 Creating an Optimization Information File (–on Option) . . . . . . . . . . . . . . . . . . . 3-5
3.3 Performing Program-Level Optimization (–pm and –o3 Options) . . . . . . . . . . . . . . . . . . 3-6
3.3.1 Controlling Program-Level Optimization (–op Option) . . . . . . . . . . . . . . . . . . . . . 3-6
3.3.2 Optimization Considerations When Mixing C and Assembly . . . . . . . . . . . . . . . 3-8
3.3.3 Naming the Program Compilation Output File (–px Option) . . . . . . . . . . . . . . . . 3-9
3.4 Special Considerations When Using the Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
3.4.1 Use Caution With asm Statements in Optimized Code . . . . . . . . . . . . . . . . . . . 3-10
3.4.2 Use Caution When Accessing Aliased Variables in Optimized Code . . . . . . . 3-10
3.5 Automatic Inline Expansion (–oisize Option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
3.6 Using the Interlist Utility With the Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
3.7 Debugging Optimized Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
Contents
Contents xi
3.8 What Kind of Optimization Is Being Performed? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
3.8.1 Cost-Based Register Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
3.8.2 Alias Disambiguation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
3.8.3 Branch Optimizations and Control-Flow Simplification . . . . . . . . . . . . . . . . . . . 3-16
3.8.4 Data Flow Optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
3.8.5 Expression Simplification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
3.8.6 Inline Expansion of Runtime-Support Library Functions . . . . . . . . . . . . . . . . . . 3-21
3.8.7 Induction Variables and Strength Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
3.8.8 Loop-Invariant Code Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
3.8.9 Loop Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
3.8.10 Autoincrement Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23
3.8.11 Repeat Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24
3.8.12 Delays, Branches, Calls, and Returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24
3.8.13 Algebraic Reordering/Symbolic Simplification/Constant Folding . . . . . . . . . . . 3-26
4 Linking C Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Describes how to link as a stand-alone program or with the compiler shell and how to meet the
special requirements of linking C code.
4.1 Invoking the Linker as an Individual Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.2 Invoking the Linker With the Compiler Shell (–z Option) . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
4.3 Disabling the Linker (–c Shell Option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4.4 Linker Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
4.5 Controlling the Linking Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
4.5.1 Linking With Runtime-Support Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
4.5.2 Specifying the Type of Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4.5.3 Specifying Where to Allocate Sections in Memory . . . . . . . . . . . . . . . . . . . . . . 4-10
4.5.4 A Sample Linker Command File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
5 TMS320C54x C Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Discusses the specific characteristics of the C compiler as they relate to the ANSI C
specification.
5.1 Characteristics of TMS320C54x C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.1.1 Identifiers and Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.1.2 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.1.3 Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.1.4 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
5.1.5 Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
5.1.6 Preprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
5.2 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.3 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.3.1 The const Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.3.2 The interrupt Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.3.3 The volatile Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.4 Register Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
Contents
xii
5.5 Global Register Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
5.6 The asm Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
5.7 Pragma Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
5.7.1 The CODE_SECTION Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
5.7.2 The DATA_SECTION Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
5.7.3 The FUNC_CANNOT_INLINE Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
5.7.4 The FUNC_EXT_CALLED Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
5.7.5 The FUNC_IS_PURE Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15
5.7.6 The FUNC_IS_SYSTEM Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15
5.7.7 The FUNC_NEVER_RETURNS Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16
5.7.8 The FUNC_NO_GLOBAL_ASG Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16
5.7.9 The FUNC_NO_IND_ASG Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16
5.7.10 The IDENT Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17
5.7.11 The INTERRUPT Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17
5.7.12 The NO_INTERRUPT Pragma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17
5.8 Initializing Static and Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
5.8.1 Initializing Static and Global Variables With the Const Type Qualifier . . . . . . 5-19
5.8.2 Accessing I/O Port Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20
5.9 Compatibility With K&R C (–pk Option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21
5.10 Compiler Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23
6 Runtime Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Contains technical information on how the compiler uses the ’C54x architecture. Discusses
memory, register, and function calling conventions, object representation, system initialization,
and dual-state interworking. Provides the information needed for interfacing assembly
language to C programs.
6.1 Memory Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
6.1.1 Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
6.1.2 C System Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
6.1.3 Allocating .const to Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
6.1.4 Dynamic Memory Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6.1.5 RAM and ROM Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6.1.6 Allocating Memory for Static and Global Variables . . . . . . . . . . . . . . . . . . . . . . . 6-7
6.1.7 Field/Structure Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
6.2 Character String Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
6.3 Register Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
6.3.1 Status Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
6.3.2 Register Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
6.4 Function Structure and Calling Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
6.4.1 How a Function Makes a Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
6.4.2 How a Called Function Responds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
6.4.3 Accessing Arguments and Locals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
6.4.4 Allocating the Frame and Using the 32-bit Memory Read Instructions . . . . . 6-15
Contents
Contents xiii
6.5 Interfacing C With Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
6.5.1 Using Assembly Language Modules with C Code . . . . . . . . . . . . . . . . . . . . . . . 6-16
6.5.2 Accessing Assembly Language Variables From C . . . . . . . . . . . . . . . . . . . . . . 6-19
6.5.3 Using Inline Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
6.5.4 Modifying Compiler Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
6.5.5 Using Intrinsics to Access Assembly Language Statements . . . . . . . . . . . . . . 6-23
6.6 Interrupt Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27
6.6.1 General Points About Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27
6.6.2 Using C Interrupt Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
6.6.3 Saving Context on Interrupt Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
6.7 Runtime-Support Arithmetic and Conversion Routines . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29
6.8 Integer Expression Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
6.8.1 Arithmetic Overflow and Underflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
6.8.2 Operations Evaluated With RTS Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
6.8.3 C Code Access to the Upper 16 Bits of 16-Bit Multiply . . . . . . . . . . . . . . . . . . . 6-31
6.9 Floating-Point Expression Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
6.10 System Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
6.10.1 Runtime Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
6.10.2 Automatic Initialization of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
6.10.3 Initialization Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
6.10.4 Autoinitialization of Variables at Runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36
6.10.5 Autoinitialization of Variables at Load Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-37
7 Runtime-Support Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
Describes the libraries and header files included with the C compiler, as well as the macros,
functions, and types that they declare. Summarizes the runtime-support functions according
to category (header) and provides an alphabetical summary of the runtime-support functions.
7.1 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
7.1.1 Nonstandard Header Files in rts.src . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
7.1.2 Modifying a Library Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7.1.3 Building a Library With Different Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7.2 The C I/O Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
7.2.1 Overview Of Low-Level I/O Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
7.2.2 Adding a Device For C I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
Contents
xiv
7.3 Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
7.3.1 Diagnostic Messages (assert.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
7.3.2 Character-Typing and Conversion (ctype.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
7.3.3 Error Reporting (errno.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
7.3.4 Low-Level Input/Output Functions (file.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15
7.3.5 Limits (float.h and limits.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15
7.3.6 Floating-Point Math (math.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
7.3.7 Nonlocal Jumps (setjmp.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18
7.3.8 Variable Arguments (stdarg.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18
7.3.9 Standard Definitions (stddef.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19
7.3.10 Input/Output Functions (stdio.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
7.3.11 General Utilities (stdlib.h ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23
7.3.12 String Functions (string.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
7.3.13 Time Functions (time.h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
7.4 Description of Runtime-Support Functions and Macros . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
8 Library-Build Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
Describes the utility that custom-makes runtime-support libraries for the options used to
compile code. You can use this utility to install header files in a directory and to create custom
libraries from source archives.
8.1 Invoking the Library-Build Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.2 Library-Build Utility Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8.3 Options Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
A Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Defines terms and acronyms in this book.

【文件名】:06318@52RD_C54xC_Optimizing.pdf
【格 式】:pdf
【大 小】:1169K
【简 介】:
【目 录】:


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2006-3-18 16:32:00 | 显示全部楼层

TMS320C54x DSP Reference Set - CPU and Peripherals

TMS320C54x DSP
Reference Set
Volume 1: CPU and Peripherals
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Summarizes the features of the TMS320 family of products and presents typical applications.
Describes the TMS320C54x DSP and lists its key features.
1.1 TMS320 Family Overview 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 History, Development, and Advantages of TMS320 DSPs 1. . . . . . . . . . . . . . . . . 2
1.1.2 Typical Applications for the TMS320 Family 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 TMS320C54x Overview 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 TMS320C54x Key Features 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Architectural Overview 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Summarizes the TMS320C54x architecture. Provides general information about the CPU, bus
structures, internal memory organization, on-chip peripherals, and scanning logic.
2.1 Bus Structure 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Internal Memory Organization 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.1 On-Chip ROM 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.2 On-Chip Dual-Access RAM (DARAM) 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.3 On-Chip Single-Access RAM (SARAM) 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.4 On-Chip Memory Security 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.5 Memory-Mapped Registers 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Central Processing Unit (CPU) 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.1 Arithmetic Logic Unit (ALU) 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.2 Accumulators 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.3 Barrel Shifter 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.4 Multiplier/Adder Unit 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.5 Compare, Select, and Store Unit (CSSU) 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Data Addressing 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.5 Program Memory Addressing 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6 Pipeline Operation 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.7 On-Chip Peripherals 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.7.1 General-Purpose I/O Pins 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.7.2 Software-Programmable Wait-State Generator 2. . . . . . . . . . . . . . . . . . . . . . . . . 11
2.7.3 Programmable Bank-Switching Logic 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.7.4 Host Port Interface 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.7.5 Hardware Timer 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.7.6 Clock Generator 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Contents
xviii
2.8 Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
2.8.1 Synchronous Serial Ports 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.8.2 Buffered Serial Ports 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.8.3 Multichannel Buffered Serial Ports (McBSPs) 2. . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.8.4 TDM Serial Ports 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.9 External Bus Interface 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.10 IEEE Standard 1149.1 Scanning Logic 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3 Memory 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Describes the TMS320C54x memory configuration and operation. Includes memory maps and
descriptions of program memory, data memory, and I/O space. Also includes descriptions of
the CPU memory-mapped registers.
3.1 Memory Space 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3.2 Program Memory 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.1 Program Memory Configurability 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.2 On-Chip ROM Organization 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.3 Program Memory Address Map and On-Chip ROM Contents 3. . . . . . . . . . . . . 18
3.2.4 On-Chip ROM Code Contents and Mapping 3. . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.5 Extended Program Memory (Available on ’548/549/5402/5410/5420) 3. . . . . 20
3.3 Data Memory 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.1 Data Memory Configurability 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.2 On-Chip RAM Organization 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3.3 Memory-Mapped Registers 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3.4 CPU Memory-Mapped Registers 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4 I/O Memory 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.5 Program and Data Security 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4 Central Processing Unit 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Describes the TMS320C54x CPU operations. Includes information about the arithmetic logic
unit, the accumulators, the shifter, the multiplier/adder unit, the compare, select, store unit, and
the exponent encoder.
4.1 CPU Status and Control Registers 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4.1.1 Status Registers (ST0 and ST1) 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4.1.2 Processor Mode Status Register (PMST) 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 Arithmetic Logic Unit (ALU) 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2.1 ALU Input 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2.2 Overflow Handling 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2.3 The Carry Bit 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2.4 Dual 16-Bit Mode 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3 Accumulators A and B 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3.1 Storing Accumulator Contents 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3.2 Accumulator Shift and Rotate Operations 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.3.3 Saturation Upon Accumulator Store 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3.4 Application-Specific Instructions 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Contents
Contents xix
4.4 Barrel Shifter 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.5 Multiplier/Adder Unit 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.5.1 Multiplier Input Sources 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.5.2 Multiply/Accumulate (MAC) Instructions 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.5.3 MAC and MAS Saturation Upon Multiplication 4. . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.6 Compare, Select, and Store Unit (CSSU) 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.7 Exponent Encoder 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5 Data Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Describes the seven basic addressing modes of the TMS320C54x.
5.1 Immediate Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
5.2 Absolute Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5.2.1 dmad Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5.2.2 pmad Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5.2.3 PA Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5.2.4 *(lk) Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5.3 Accumulator Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.4 Direct Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.4.1 DP-Referenced Direct Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.4.2 SP-Referenced Direct Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.5 Indirect Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.1 Single-Operand Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.2 ARAU and Address-Generation Operation 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.5.3 Single-Operand Address Modifications 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.5.4 Dual-Operand Address Modifications 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.5.5 TMS320C2x/C20x/C24x/C5x Compatibility (ARP) Mode 5. . . . . . . . . . . . . . . . . 23
5.6 Memory-Mapped Register Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.7 Stack Addressing 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.8 Data Types 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6 Program Memory Addressing 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Describes the TMS320C54x program control mechanisms. Includes information about address
generation, the program counter, the hardware stack, reset, interrupts, and power-down
modes.
6.1 Program-Memory Address Generation 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
6.2 Program Counter (PC) 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
6.3 Branches 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6.3.1 Unconditional Branches 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6.3.2 Conditional Branches 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.3.3 Far Branches (Available on ’548/’549/’5402/’5410/’5420) 6. . . . . . . . . . . . . . . . . 8
6.4 Calls 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
6.4.1 Unconditional Calls 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
6.4.2 Conditional Calls 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.4.3 Far Calls (Available on ’548 /’549/’5402/’5410/’5420) 6. . . . . . . . . . . . . . . . . . . . 11
Contents
xx
6.5 Returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
6.5.1 Unconditional Returns 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.5.2 Conditional Returns 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.5.3 Far Returns (Available on ’548/’549/’5402/’5410/’5420) 6. . . . . . . . . . . . . . . . . . 14
6.6 Conditional Operations 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.6.1 Using Multiple Conditions 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.6.2 Conditional Execute (XC) Instruction 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.6.3 Conditional Store Instructions 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.7 Repeating a Single Instruction 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.8 Repeating a Block of Instructions 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.9 Reset Operation 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6.10 Interrupts 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.10.1 Interrupt Flag Register (IFR) 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.10.2 Interrupt Mask Register (IMR) 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.10.3 Phase 1: Receive Interrupt Request 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.10.4 Phase 2: Acknowledge Interrupt 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.10.5 Phase 3: Execute Interrupt Service Routine (ISR) 6. . . . . . . . . . . . . . . . . . . . . . . 33
6.10.6 Interrupt Context Save 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.10.7 Interrupt Latency 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.10.8 Interrupt Operation: A Quick Summary 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.10.9 Re-mapping Interrupt-Vector Addresses 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.10.10 Interrupt Tables 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.11 Power-Down Modes 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.11.1 IDLE1 Mode 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.11.2 IDLE2 Mode 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.11.3 IDLE3 Mode 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.11.4 Hold Mode 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.11.5 Other Power-Down Capabilities 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7 Pipeline 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Describes the TMS320C54x pipeline operation and lists the pipeline latency cycles for these
types of latencies.
7.1 Pipeline Operation 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
7.1.1 Branch Instructions in the Pipeline 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
7.1.2 Call Instructions in the Pipeline 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.1.3 Return Instructions in the Pipeline 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.1.4 Conditional Execute Instructions in the Pipeline 7. . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.5 Conditional-Call and Conditional-Branch Instructions in the Pipeline 7. . . . . . . 20
7.2 Interrupts and the Pipeline 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.3 Dual-Access Memory and the Pipeline 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.3.1 Resolved Conflict Between Instruction Fetch and Operand Read 7. . . . . . . . . 29
7.3.2 Resolved Conflict Between Operand Write and Dual-Operand Read 7. . . . . . 30
7.3.3 Resolved Conflict Among Operand Write, Operand Write, and
Dual-Operand Read 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Contents
Contents xxi
7.4 Single-Access Memory and the Pipeline 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.5 Pipeline Latencies 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.5.1 Recommended Instructions for Accessing Memory-Mapped Registers 7. . . . . 35
7.5.2 Updating ARx, BK, or SP—A Resolved Conflict 7. . . . . . . . . . . . . . . . . . . . . . . . . 38
7.5.3 Rules to Determine DAGEN Register Access Conflicts 7. . . . . . . . . . . . . . . . . . 44
7.5.4 Latencies for ARx and BK 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.5.5 Latencies for the Stack Pointer 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.5.6 Latencies for Temporary Register (T) 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.5.7 Latencies for Accessing Status Registers 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.5.8 Latencies in Repeat-Block Loops 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.5.9 Latencies for the PMST 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.5.10 Latencies for Memory-Mapped Accesses to Accumulators 7. . . . . . . . . . . . . . . 79
8 On-Chip Peripherals 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Describes the TMS320C54x peripherals and how to control them. Includes information about
the general-purpose I/O pins, timers, clock, and host port interface.
8.1 Available On-Chip Peripherals 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
8.2 Peripheral Memory-Mapped Registers 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
8.3 General-Purpose I/O 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.3.1 Branch Control Input Pin (BIO) 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.3.2 External Flag Output Pin (XF) 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.4 Timer 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8.4.1 Timer Registers 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8.4.2 Timer Operation 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.5 Clock Generator 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.5.1 Hardware-Configurable PLL 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.5.2 Software-Programmable PLL
(’541B/’545A/’546A/’548/’549/’5402/’5410/’5420) 8. . . . . . . . . . . . . . . . . . . . . . . 27
Programming Considerations When Using the
Software-Programmable PLL 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Using the PLLCOUNT Programmable Lock Timer 8. . . . . . . . . . . . . . . . . . . . . . 31
Switching Clock Mode From DIV Mode to PLL Mode 8. . . . . . . . . . . . . . . . . . . . 32
Switching Clock Mode From PLL Mode to DIV Mode 8. . . . . . . . . . . . . . . . . . . . 33
Changing the PLL Multiplier Ratio 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
PLL Operation Immediately Following Reset 8. . . . . . . . . . . . . . . . . . . . . . . . . . . 35
PLL Considerations When Using IDLE Instruction 8. . . . . . . . . . . . . . . . . . . . . . 35
PLL Considerations When Using the Bootloader 8. . . . . . . . . . . . . . . . . . . . . . . . 36
8.6 Host Port Interface 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
8.6.1 Basic Host Port Interface Functional Description 8. . . . . . . . . . . . . . . . . . . . . . . . 38
8.6.2 Details of Host Port Interface Operation 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
HPI Control Register Bits and Function 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
8.6.3 Host Read/Write Access to HPI 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Access Sequences 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
8.6.4 DSPINT and HINT Function Operation 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Host Device Using DSPINT to Interrupt the ’54x 8. . . . . . . . . . . . . . . . . . . . . . . . 51
Host Port Interface (’54x) Using HINT to Interrupt the Host Device 8. . . . . . . . 52
8.6.5 Considerations in Changing HPI Memory Access Mode (SAM/HOM)
and IDLE2/3 Use 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
8.6.6 Access of HPI Memory During Reset 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Contents
xxii
9 Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Describes the TMS320C54x serial ports. Includes information about the standard serial port
interface, buffered serial port interface, multichannel buffered serial port interface, and time-division
multiplexed serial port interface.
9.1 Introduction to the Serial Ports 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
9.2 Serial Port Interface 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
9.2.1 Serial Port Interface Registers 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
9.2.2 Serial Port Interface Operation 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
9.2.3 Configuring the Serial Port Interface 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Reserved Bit 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
DLB Bit 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
FO Bit 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
FSM Bit 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
MCM Bit 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
TXM Bit 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
XRST and RRST Bits 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
IN0 and IN1 Bits 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
RRDY and XRDY Bits 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
XSREMPTY Bit 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
RSRFULL Bit 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
SOFT and FREE Bits 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
9.2.4 Burst Mode Transmit and Receive Operations 9. . . . . . . . . . . . . . . . . . . . . . . . . . 18
9.2.5 Continuous Mode Transmit and Receive Operations 9. . . . . . . . . . . . . . . . . . . . 24
9.2.6 Serial Port Interface Exception Conditions 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Burst Mode 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Continuous Mode 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.2.7 Example of Serial Port Interface Operation 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.3 Buffered Serial Port (BSP) Interface 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.3.1 BSP Operation in Standard Mode 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.2 Autobuffering Unit (ABU) Operation 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
9.3.3 System Considerations for BSP Operation 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
9.3.4 Buffer Misalignment Interrupt (BMINT) – ’549 only 9. . . . . . . . . . . . . . . . . . . . . . 54
9.3.5 BSP Operation in Power-Down Mode 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
9.4 Time-Division Multiplexed (TDM) Serial Port Interface 9. . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.4.1 Basic Time-Division Multiplexed Operation 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.4.2 TDM Serial Port Interface Registers 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.4.3 TDM Serial Port Interface Operation 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
9.4.4 TDM Mode Transmit and Receive Operations 9. . . . . . . . . . . . . . . . . . . . . . . . . . 62
9.4.5 TDM Serial Port Interface Exception Conditions 9. . . . . . . . . . . . . . . . . . . . . . . . 64
9.4.6 Examples of TDM Serial Port Interface Operation 9. . . . . . . . . . . . . . . . . . . . . . . 64
Contents
Contents xxiii
10 External Bus Operation 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Discusses the external bus interface and the timing of events involved in memory and I/O accesses.
Describes the hold mode and the wake-up sequence from IDLE3 mode.
10.1 External Bus Interface 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
10.2 External Bus Priority 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
10.3 External Bus Control 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
10.3.1 Wait-State Generator 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
10.3.2 Bank-Switching Logic 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
10.4 External Bus Interface Timing 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
10.4.1 Memory Access Timing 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
10.4.2 I/O Access Timing 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
10.4.3 Memory and I/O Access Timing 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
10.5 Start-Up Access Sequences 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
10.5.1 Reset 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
10.5.2 IDLE3 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
10.6 Hold Mode 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
10.6.1 Interrupts During Hold 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
10.6.2 Hold and Reset 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
A Design Considerations for Using XDS510 Emulator A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Describes the JTAG emulator cable, how to construct a 14-pin connector on your target system,
and how to connect the target system to the emulator.
A.1 Designing Your Target System’s Emulator Connector (14-Pin Header) A. . . . . . . . . . . . . 2
A.2 Bus Protocol A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
A.3 Emulator Cable Pod A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
A.4 Emulator Cable Pod Signal Timing A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
A.5 Emulation Timing Calculations A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
A.6 Connections Between the Emulator and the Target System A. . . . . . . . . . . . . . . . . . . . . 10
A.6.1 Buffering Signals A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
A.6.2 Using a Target-System Clock A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
A.6.3 Configuring Multiple Processors A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
A.7 Physical Dimensions for the 14-Pin Emulator Connector A. . . . . . . . . . . . . . . . . . . . . . . . 14
A.8 Emulation Design Considerations A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
A.8.1 Using Scan Path Linkers A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
A.8.2 Emulation Timing Calculations for a Scan Path Linker (SPL) A. . . . . . . . . . . . . 18
A.8.3 Using Emulation Pins A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
A.8.4 Performing Diagnostic Applications A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Contents
xxiv
B Development Support and Part Order Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B1
Provides device part numbers and support tool ordering information for the TMS320C54x and
development support information available from TI and third-party vendors.
B.1 Development Support B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
B.1.1 Development Tools B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Code Generation Tools B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
System Integration and Debug Tools B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
B.1.2 Third-Party Support B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
B.1.3 Technical Training Organization (TTO) TMS320 Workshops B. . . . . . . . . . . . . . . 4
B.1.4 Assistance B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
B.2 Part Order Information B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
B.2.1 Device and Development Support Tool Nomenclature Prefixes B. . . . . . . . . . . . 5
B.2.2 Device Nomenclature B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
B.2.3 Development Support Tools B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
C Submitting ROM Codes to TI C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Provides information for submitting ROM codes to Texas Instruments.
D Summary of Updates in This Document D. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Provides a summary of the updates in this version of the document.
E Glossary E. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Defines terms and abbreviations used throughout this book.

【文件名】:06318@52RD_C54xCPU&Peripherals.pdf
【格 式】:pdf
【大 小】:2390K
【简 介】:
【目 录】:


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
点评回复

使用道具 举报

 楼主| 发表于 2006-3-18 16:35:00 | 显示全部楼层

TMS320C54x Source Debugger

TMS320C54x
C Source Debugger
User’s Guide
1 Overview of the Code Development and Debugging System . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Provides an overview of the C source debugger, describes the code development environment,
and provides a brief overview of the debugging process. Also tells you how to access online
help.
1.1 Key Features of the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.2 About the C Source Debugger Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Descriptions of the debugger windows and their contents . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.3 Developing Code for the TMS320C54x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
1.4 About the Parallel Debug Manager (Emulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
1.5 Overview of the Debugging Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10
1.6 Accessing Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11
Accessing a list of help topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11
Accessing context-sensitive help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11
Accessing help for debugger commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
2 Getting Started With the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Explains how to prepare your program for debugging and explains what you need to do before
invoking the debugger. Explains how to invoke the debugger, and summarizes the debugger
options. Describes the debugging modes and explains how to exit the debugger.
2.1 Preparing Your Program for Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Debugging optimized code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Profiling optimized code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.2 Identifying Alternate Directories for the Debugger to Search (D_DIR) . . . . . . . . . . . . . . 2-3
Setting up D_DIR for Windows operating systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Setting up D_DIR for SPARC and HP-UX operating systems . . . . . . . . . . . . . . . . . . . . . 2-3
2.3 Identifying Directories That Contain Program Source Files (D_SRC) . . . . . . . . . . . . . . . 2-4
Setting up D_SRC for Windows operating systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Setting up D_SRC for SPARC and HP-UX operating systems . . . . . . . . . . . . . . . . . . . . 2-4
2.4 Setting Up Default Debugger Options (D_OPTIONS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Setting up D_OPTIONS for Windows operating systems . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Setting up D_OPTIONS for SPARC and HP-UX operating systems . . . . . . . . . . . . . . . . 2-5
2.5 Resetting the Emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.6 Invoking the Debuggers and the PDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Invoking a stand-alone debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Invoking multiple debuggers (emulator only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Contents
x
2.7 Summary of Debugger Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Clearing the .bss section (–c option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Displaying the debugger on a different machine (–d option) . . . . . . . . . . . . . . . . . . . . . 2-11
Identifying a new configuration file (–f option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Identifying additional directories (–i option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Enabling pipeline conflict detection (–l option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Selecting the device version (–mv option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Identifying the processor to be debugged (–n option) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Identifying the I/O port address (–p option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Entering the profiling environment (–profile option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Loading the symbol table only (–s option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Identifying a new initialization file (–t option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Loading without the symbol table (–v option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Writing pipeline conflict warnings to a file (–w option) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Ignoring D_OPTIONS (–x option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
2.8 Debugging Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Auto mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Assembly mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Mixed mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19
Restrictions associated with debugging modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
2.9 Exiting the Debugger or the PDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
3 Entering and Using Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Tells you how to define your own command strings, enter operating-system commands, and
enter commands using a batch file.
3.1 Defining Your Own Command Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Defining an alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Defining an alias with parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Editing or redefining an alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Deleting an alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Considerations for using alias definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
3.2 Entering Operating-System Commands From Within the Debugger . . . . . . . . . . . . . . . 3-5
Entering a single command from the debugger command line . . . . . . . . . . . . . . . . . . . . 3-5
Entering several commands from a system shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
3.3 Creating and Executing a Batch File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Echoing strings in a batch file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Executing commands conditionally in a batch file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Looping command execution in a batch file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
Pausing the execution of a batch file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
Executing a batch file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
3.4 Using a Log File to Reexecute a Series of Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Contents
Contents xi
4 Defining a Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Contains instructions for setting up a memory map that enables the debugger to access target
memory correctly; includes hints about using a batch file to set up a memory map.
4.1 The Memory Map: What It Is and Why You Must Define It . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Potential memory map problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.2 Creating or Modifying the Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Adding a range of memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Creating a customized memory type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Deleting a range of memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Modifying a defined range of memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
4.3 Enabling Memory Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4.4 A Sample Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
4.5 Defining and Executing a Memory Map in a Batch File . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
Defining a memory map in a batch file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
Usage notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
Defining a memory map using cache capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Executing a memory map batch file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
4.6 Customizing the Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Mapping on-chip dual-access RAM to program memory . . . . . . . . . . . . . . . . . . . . . . . . 4-16
Simulating data memory (ROM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
Programming your memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
4.7 Returning to the Original Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
4.8 Using Multiple Memory Maps for Multiple Target Systems . . . . . . . . . . . . . . . . . . . . . . . 4-19
4.9 Simulating I/O Space (Simulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
Connecting an I/O port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
Disconnecting an I/O port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21
4.10 Simulating External Interrupts (Simulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22
Setting up your input file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22
Connecting your input file to the interrupt pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23
Disconnecting your input file from the interrupt pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Listing the interrupt pins and connecting input files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
4.11 Simulating Peripherals (Simulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
4.12 Simulating Standard Serial Ports (Simulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Setting up your transmit and receive operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Connecting input/output files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28
Programming the simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28
4.13 Simulating Buffered Serial Ports (Simulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30
Setting up your transmit and receive operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
Connecting input/output files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-32
Programming the simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33
4.14 Simulating TDM Serial Ports (Simulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34
Setting up your transmit and receive operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35
Connecting input/output files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36
Programming the simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36
Contents
xii
4.15 Simulating Host Port Interfaces (Simulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37
Setting up your input file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37
Connecting your input file to the interrupt pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39
Disconnecting your input file from the interrupt pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39
5 Using the Debugger With Extended Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Describes extended addressing and how to use it with the emulator version of the
TMS320C54x debugger.
5.1 Understanding the Use of Extended Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
About extended addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Sample extended memory system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
5.2 Setting Up Extended Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Describing your extended memory configuration to the debugger (emulator) . . . . . . . . 5-4
Describing your extended memory configuration to the debugger (simulator) . . . . . . . 5-5
Enabling extended addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Mapping the extended memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.3 Debugging With Extended Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
Registers associated with extended addressing: XPC and EPC . . . . . . . . . . . . . . . . . . . 5-7
New expression syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
How extended addressing affects symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
Using 16-bit expressions with 23-bit extended addressing . . . . . . . . . . . . . . . . . . . . . . . 5-10
6 Loading and Displaying Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Tells you how to use the debugger modes to view the source files and how to load source files
and object files.
6.1 Loading and Displaying Assembly Language Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Loading an object file and its symbol table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Loading an object file without its symbol table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Loading a symbol table only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Loading code while invoking the debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Displaying portions of disassembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
Displaying assembly source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
6.2 Displaying C Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
Displaying the contents of a text file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
Displaying a specific C function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
Displaying code beginning at a specific point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
7 Running Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
Describes the basic run commands and single-step commands, tells you how to halt program
execution, and discusses software breakpoints.
7.1 Defining the Starting Point for Program Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
7.2 Using the Basic Run Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Running an entire program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Running code up to a specific point in a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Contents
Contents xiii
Running the code in the current C function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
Running code while disconnected from the target system (emulator only) . . . . . . . . . . 7-6
Running code through breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
Resetting the simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
Resetting the emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
7.3 Single-Stepping Through Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
Single-stepping through assembly language or C code . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
Single-stepping through C code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
Continuously stepping through code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
Single-stepping through code and stepping over C functions . . . . . . . . . . . . . . . . . . . . 7-10
7.4 Running Code Conditionally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
7.5 Benchmarking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
7.6 Halting Program Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
What happens when you halt the emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
7.7 Using Software Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Setting a software breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15
Clearing a software breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
Clearing all software breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
Saving breakpoint settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18
Loading saved breakpoint settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19
7.8 Using Hardware Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
Setting a hardware breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21
Clearing a hardware breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23
Clearing all hardware breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23
Saving breakpoint settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24
Loading saved breakpoint settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
Error messages related to hardware breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
8 Managing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
Describes the data-display windows and tells you how to edit data (memory contents, register
contents, and individual variables).
8.1 Where Data Is Displayed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.2 Basic Commands for Managing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Determining the type of a variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Evaluating an expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8.3 Basic Methods for Changing Data Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Editing data displayed in a window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Editing data using expressions that have side effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8.4 Managing Data in Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Changing the memory range displayed in a Memory window . . . . . . . . . . . . . . . . . . . . . 8-7
Opening an additional Memory window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
Displaying program memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
Displaying memory contents while you are debugging C . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
Saving memory values to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11
Filling a block of memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
Contents
xiv
8.5 Managing Register Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-15
Displaying register contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-15
8.6 Managing Data in a Watch Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-17
Displaying data in a Watch window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-18
Displaying additional data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-19
Deleting watched values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20
8.7 Managing Data in a Variable Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
Accessing a Variable window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
Displaying data in a Variable window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
Modifying data in a Variable window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
How a Variable window differs from a Watch window . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
8.8 Managing Pipeline Information (Simulator Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
Monitoring the pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
Detecting pipeline conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
8.9 Displaying Data in Alternative Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-25
Changing the default format for specific data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-25
Changing the default format with data-management commands . . . . . . . . . . . . . . . . . 8-27
9 Profiling Code Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
Describes the profiling environment and tells you how to collect statistics about code execution.
9.1 Overview of the Profiling Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
9.2 Overview of the Profiling Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
A profiling strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
9.3 Entering the Profiling Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
9.4 Defining Areas for Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
Marking an area with a mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
Marking an area with a dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
Disabling an area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
Reenabling a disabled area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
Unmarking an area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
Restrictions on profiling areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
9.5 Defining a Stopping Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15
Setting a software breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15
Clearing a software breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16
9.6 Running a Profiling Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-17
Running a full or a quick profiling session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-17
Resuming a profiling session that has halted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-19
9.7 Viewing Profile Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20
Viewing different profile data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21
Sorting profile data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-23
Viewing different profile areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24
Interpreting session data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25
Viewing code associated with a profile area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25
9.8 Saving Profile Data to a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-27
Saving the contents of the Profile window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-27
Saving all data for currently displayed areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-28
Contents
Contents xv
10 Monitoring Hardware Functions with the Emulator Analysis Module . . . . . . . . . . . . . . . . 10-1
Describes the analysis environment for the emulator and tells you how to set hardware breakpoints.
10.1 Major Functions of the Analysis Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10.2 Overview of the Analysis Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4
10.3 Enabling the Analysis Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5
10.4 Defining the Conditions for Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
Counting events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
Enabling the external counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
Setting hardware breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11
Setting up the event comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-12
Setting up the EMU0/1 pins to set global breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15
10.5 Running Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
How to run the entire program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
How the Run Benchmark (RUNB) command affects analysis . . . . . . . . . . . . . . . . . . . 10-16
10.6 Viewing the Analysis Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
Interpreting the status field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
Interpreting the discontinuity stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
Interpreting the event counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-18
11 Using the Simulator Analysis Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1
Describes the analysis environment for the simulator and tells you how to simulate hardware
breakpoints.
11.1 Major Functions of the Analysis Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
11.2 Overview of the Analysis Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
11.3 Enabling the Analysis Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4
11.4 Defining the Conditions for Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Setting hardware breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6
Setting up the event comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8
Instruction pipelining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11
Executing breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11
Setting a data read breakpoint with program window disabled . . . . . . . . . . . . . . . . . . 11-13
Setting a data read breakpoint with program window enabled . . . . . . . . . . . . . . . . . . . 11-14
11.5 Running Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-16
11.6 Viewing the Analysis Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-17
12 Using the Parallel Debug Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
Describes the parallel debug manager (PDM) for the TMS320C54x system, tells you how to
invoke the PDM and individual debuggers, and describes execution-related commands. Also
includes information about describing your target system in a configuration file.
12.1 Identifying Processors and Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Assigning names to individual processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Organizing processors into groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
12.2 Sending Debugger Commands to One or More Debuggers . . . . . . . . . . . . . . . . . . . . . . 12-6
Contents
xvi
12.3 Running and Halting Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7
Halting processors at the same time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
Sending ESCAPE to all processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
Finding the execution status of a processor or a group of processors . . . . . . . . . . . . . 12-8
12.4 Entering PDM Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9
Executing PDM commands from a batch file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9
Recording information from the PDM display area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-10
Controlling PDM command execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-10
Echoing strings to the PDM display area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12
Pausing command execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13
Using the command history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13
12.5 Defining Your Own Command Strings with PDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-15
12.6 Entering Operating-System Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16
12.7 Understanding the PDM’s Expression Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-17
12.8 Using System Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-18
Creating your own system variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-18
Assigning a variable to the result of an expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19
Changing the PDM prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19
Checking the execution status of the processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-20
Listing system variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-20
Deleting system variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-20
12.9 Evaluating Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-21
13 Summary of Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
Provides functional and alphabetical summaries of the basic debugger commands and the profiling
commands.
13.1 Functional Summary of Debugger Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Managing multiple debuggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
Changing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4
Managing windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4
Customizing the screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4
Displaying files and loading programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4
Displaying and changing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5
Performing system tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-6
Managing breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7
Memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7
Running programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-8
Profiling commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-9
13.2 Alphabetical Summary of Debugger and PDM Commands . . . . . . . . . . . . . . . . . . . . . 13-10
13.3 Summary of Profiling Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-68
Marking areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-68
Disabling marked areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-68
Enabling disabled areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-69
Unmarking areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-70
Changing the profile window display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-71
Contents
Contents xvii
14 Basic Information About C Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-1
Many of the debugger commands accept C expressions as parameters. This chapter provides
general information about the rules governing C expressions and describes specific implementation
features related to using C expressions as command parameters.
14.1 C Expressions for Assembly Language Programmers . . . . . . . . . . . . . . . . . . . . . . . . . . 14-2
14.2 Using Expression Analysis in the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-4
Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-4
Additional features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-4
A What the Debugger Does During Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
In some circumstances, you may find it helpful to know the steps that the debugger goes
through during the invocation process; this appendix lists these steps.
B Customizing the Emulator Analysis Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
Describes the analysis registers and explains how to use them to create customized analysis
commands.
B.1 Loading the Analysis Pseudoregisters With Their Default Values . . . . . . . . . . . . . . . . . . B-2
B.2 Summary of Predefined Analysis Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-3
Enabling the analysis interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-5
Enabling the program window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-5
Enabling the EMU0/1 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-5
Enabling event counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-6
Setting breakpoints on a single program or data address . . . . . . . . . . . . . . . . . . . . . . . . . B-8
Breaking on event occurrences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-9
Qualifying on a read or a write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-10
Resetting the analysis interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-11
B.3 Creating Customized Analysis Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-12
B.4 Summary of Analysis Pseudoregisters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-13
anaenbl (enable analysis) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-13
anastat (analysis status) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-13
datbrkp (data breakpoint address) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-14
datdval (data breakpoint data value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-14
datmval (data breakpoint mask value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-14
datqual (data breakpoint qualifier) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-14
evtcntr (event counter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-15
evtselt (select the event for counting) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-16
hbpenbl (select hardware breakpoints) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-16
pgabrkp1, pgabrkp2 (program address breakpoint) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-17
pgaqual1, pgaqual2 (program breakpoint qualifier) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-17
progwin (program window enable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-17
ptrace0/ptrace1/ptrace2 (discontinuity trace samples 0–2) . . . . . . . . . . . . . . . . . . . . . . B-18
Contents
xviii
C Describing Your Target System to the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1
Explains how to supply the information about your target configuration to the debugger.
C.1 Step 1: Create the Board Configuration Text File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-2
C.2 Step 2: Translate the Configuration File to a Debugger-Readable Format . . . . . . . . . . C-5
C.3 Step 3: Specifying the Configuration File When Invoking the Debugger . . . . . . . . . . . . C-6
D Debugger Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
Describes progress and error messages that the debugger may display.
D.1 Associating Sound With Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-2
D.2 Alphabetical Summary of Debugger Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-2
D.3 Alphabetical Summary of PDM Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-21
D.4 Additional Instructions for Expression Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-25
D.5 Additional Instructions for Hardware Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-25
E Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
Defines acronyms and key terms used in this book.

【文件名】:06318@52RD_C54xCSouceDebugger.pdf
【格 式】:pdf
【大 小】:2517K
【简 介】:
【目 录】:


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
点评回复

使用道具 举报

 楼主| 发表于 2006-3-18 16:37:00 | 显示全部楼层

Code Composer Studio User's Guide

Code Composer Studio User's Guide
1 Setting Up Code Composer Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-1
1.1 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2
1.2 Installing Code Composer Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
1.3 Setting Up Code Composer Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
1.4 Getting Started with Code Composer Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-4
1.5 Using Online Help. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-4
2 The Basics of Code Composer Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
2.1 Using Code Composer Studio Windows and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . .2-2
2.1.1 Context-Sensitive Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-2
2.2 Using the Dis-Assembly Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
2.2.1 Opening More Than One Dis-Assembly Window. . . . . . . . . . . . . . . . . . . . . .2-3
2.2.2 Changing the Start Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
2.2.3 Managing Breakpoints, Probe Points, and Profile Points from the
Dis-Assembly Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
2.2.4 Changing Color Highlights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
2.2.5 Setting Dis-Assembly Style Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
2.2.6 Viewing Mixed C Source and Assembly Code . . . . . . . . . . . . . . . . . . . . . . . .2-5
2.3 Using the Memory Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-6
2.3.1 Setting Memory Window Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-7
2.3.2 Editing a Memory Location. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-9
2.3.3 C Expression Input Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-9
2.4 CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-11
2.4.1 Viewing Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-11
2.4.2 Editing Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-11
2.5 Loading a COFF File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-12
2.5.1 Loading Symbol Information Only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-12
2.5.2 Reloading a COFF File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-12
2.5.3 Setting Program Load Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-13
2.6 Single Stepping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-14
2.6.1 Multiple Stepping Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-15
2.7 Run, Halt, Animate, Run Free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-16
2.7.1 Setting Animation Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
2.8 Resetting Your Target Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-18
2.9 Copying Data Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-19
2.10 Filling Memory Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-19
vi
Contents
2.11 Editing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
2.12 Editing the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
2.13 Refreshing Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
2.14 Viewing the Call Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
2.14.1 Observing Local Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
2.15 Saving and Restoring Your Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
2.15.1 Automatically Loading Your Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
2.15.2 The Default Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
3 Multiprocessing With Code Composer Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.1 The Parallel Debug Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.2 Opening an Individual Parent Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.3 Grouping Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
3.4 Multiprocessor Broadcast Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
3.5 Broadcasting GEL Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
3.6 Auto-Executing GEL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
3.7 Global Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
4 Breakpoints and Probe Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.1 Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.1.1 Designer Notes (Kernel-Based Code Composer Studio Debugger). . . . . . . 4-2
4.1.2 Adding and Deleting Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.1.3 Enabling and Disabling Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4.2 Conditional Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4.3 Hardware Breakpoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
4.4 Probe Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4.4.1 Adding and Deleting Probe Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4.4.2 Connecting Probe Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
4.4.3 Enabling and Disabling Probe Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
4.5 Conditional Probe Points. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
4.6 Hardware Probe Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
5 Using the File Input/Output Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
5.1 File Input/Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.1.1 File I/O Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.1.2 Data File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.2 Loading a Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.3 Storing a Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
Contents vii
Contents
6 The Graph Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-1
6.1 Time/Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-2
6.1.1 How the Time/Frequency Graph Works . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-2
6.1.2 Display Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-3
6.1.3 Graph Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-13
6.1.4 Data Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-13
6.1.5 Start Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-13
6.1.6 Acquisition Buffer Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-14
6.1.7 Display Data Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-14
6.1.8 DSP Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-15
6.1.9 Q-Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-15
6.1.10 Sampling Rate (Hz) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-15
6.1.11 Plot Data From . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-16
6.1.12 Left-Shifted Data Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-16
6.1.13 Display Peak and Hold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-16
6.1.14 Autoscale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-17
6.1.15 DC Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-17
6.1.16 Axes Display. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-17
6.1.17 Status Bar Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-17
6.1.18 Magnitude Display Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-17
6.1.19 Data Plot Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-18
6.1.20 Grid Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-18
6.1.21 Cursor Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-18
6.2 Constellation Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-19
6.2.1 How the Constellation Diagram Works. . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-19
6.2.2 Display Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-20
6.2.3 Graph Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-20
6.2.4 Interleaved Data Sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-20
6.2.5 Data Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-21
6.2.6 Acquisition Buffer Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-21
6.2.7 Index Increment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-22
6.2.8 Constellation Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-22
6.2.9 DSP Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-22
6.2.10 Q-Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23
6.2.11 Minimum X-Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23
6.2.12 Maximum X-Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23
6.2.13 Minimum Y-Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23
6.2.14 Maximum Y-Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23
6.2.15 Symbol Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23
6.2.16 Axes Display. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23
6.2.17 Status Bar Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-24
6.2.18 Grid Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-24
6.2.19 Cursor Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-24
viii
Contents
6.3 Eye Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
6.3.1 How the Eye Diagram Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
6.3.2 Display Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
6.3.3 Graph Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
6.3.4 Trigger Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27
6.3.5 Data Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
6.3.6 Acquisition Buffer Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
6.3.7 Index Increment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
6.3.8 Persistence Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29
6.3.9 Display Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29
6.3.10 Minimum Interval Between Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29
6.3.11 Pre-Trigger (in samples) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
6.3.12 DSP Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
6.3.13 Q-Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
6.3.14 Sampling Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
6.3.15 Trigger Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
6.3.16 Maximum Y-Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
6.3.17 Axes Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
6.3.18 Time Display Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
6.3.19 Status Bar Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
6.3.20 Grid Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
6.3.21 Cursor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
6.4 Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
6.4.1 How the Image Graph Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
6.4.2 Graph Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
6.4.3 Color Space Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
6.4.4 Data Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36
6.4.5 Lines Per Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-37
6.4.6 Pixels Per Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-37
6.4.7 Byte Packing to Fill 32 Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-37
6.4.8 Image Origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-37
6.4.9 Uniform Quantization to 256 Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38
6.4.10 Status Bar Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38
6.4.11 Cursor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38
7 The Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
7.1 Accessing Memory Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
7.2 Defining the Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7.3 Using GEL to Define Your Memory Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
8 Using the Watch Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.1 Adding and Deleting Expressions in the Watch Window . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.1.1 Expanding and Collapsing Watch Variables . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8.2 Editing Variables in the Watch Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
8.3 Watch Window Display Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8.4 QuickWatch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Contents ix
Contents
9 The Integrated Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-1
9.1 Overview of Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-2
9.1.1 Standard Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-3
9.1.2 Edit Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-4
9.2 Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-5
9.2.1 Customizing Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-8
9.3 File Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-9
9.3.1 Creating a New File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-9
9.3.2 Opening a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-10
9.3.3 Duplicating File Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-10
9.3.4 Saving Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-10
9.3.5 Printing Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-11
9.3.6 Cutting, Copying, and Pasting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-12
9.3.7 Deleting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-12
9.3.8 Editing Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-12
9.3.9 Undo/Redo Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-13
9.3.10 Tabbing Multiple Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-13
9.3.11 Go To Source Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-13
9.3.12 Changing Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-14
9.4 Finding and Replacing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-15
9.4.1 Finding Text in the Current File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-15
9.4.2 Setting Find/Replace Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-16
9.4.3 Finding and Replacing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-16
9.4.4 Finding Text in Multiple Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-17
9.5 Setting Editor Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-18
9.6 Using Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-19
9.6.1 Managing Your Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-20
9.6.2 Editing Bookmark Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-20
10 The Project Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-1
10.1 Creating, Opening, and Closing Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-2
10.2 Adding Files to the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-4
10.3 Scanning Dependencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-6
10.4 Project Environment Build Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-8
10.5 Project Build Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-8
11 Profiling Code Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-1
11.1 Profile Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-2
11.1.1 Profile Clock Setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-3
11.1.2 Profile Clock Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-4
11.2 Profile Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-6
11.2.1 Enabling and Disabling Profile Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-7
11.3 Hardware Profile Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-9
11.4 Viewing Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-10
11.5 Divide And Conquer Using Profile Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-12
x
Contents
12 The General Extension Language (GEL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
12.1 GEL Grammar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
12.2 GEL Function Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
12.3 GEL Function Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5
12.4 Calling GEL Functions and Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7
12.4.1 GEL Return Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7
12.4.2 GEL If-Else Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7
12.4.3 GEL While Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
12.4.4 GEL Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
12.4.5 GEL Preprocessing Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9
12.5 Loading/Unloading GEL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-10
12.6 Adding GEL Functions to the GEL Menu Using Keywords . . . . . . . . . . . . . . . . . . . . 12-11
12.6.1 The hotmenu Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-11
12.6.2 The dialog Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12
12.6.3 The slider Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13
12.7 Accessing the Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-15
12.8 Autoexecuting GEL Functions Upon Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16
12.9 Viewing the Expression Queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-18
12.10 Built-In GEL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19
A Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
A.1 Installation/Loading Code Composer Studio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
A.2 DSP Project Management System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
A.3 General Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
A.4 Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
A.5 Watch Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
A.6 General Extension Language – GEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-9
A.7 Graph Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-11
B Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1

【文件名】:06318@52RD_CCSUserGuide.pdf
【格 式】:pdf
【大 小】:1384K
【简 介】:
【目 录】:
[UseMoney=1]

[/UseMoney]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
点评回复

使用道具 举报

发表于 2008-5-29 13:19:00 | 显示全部楼层
晕啊 这些资料TI上多的是 还拿来卖????[em10]
点评回复

使用道具 举报

发表于 2008-9-4 21:45:00 | 显示全部楼层
现在就在学这个,怎么又是要MONEY。
想下来看都没这个可能
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-10-8 01:23 , Processed in 0.056666 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表