没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
TASKING VX-toolset for
TriCore User Guide
MA160-800 (v6.3r1) April 01, 2019
Copyright © 2019 TASKING BV.
All rights reserved.You are permitted to print this document provided that (1) the use of such is for personal use only
and will not be copied or posted on any network computer or broadcast in any media, and (2) no modifications of the
document is made. Unauthorized duplication, in whole or part, of this document by any means, mechanical or electronic,
including translation into another language, except for brief excerpts in published reviews, is prohibited without the
express written permission of TASKING BV. Unauthorized duplication of this work may also be prohibited by local
statute. Violators may be subject to both criminal and civil penalties, including fines and/or imprisonment. Altium
®
,
TASKING
®
, and their respective logos are registered trademarks of Altium Limited or its subsidiaries. All other registered
or unregistered trademarks referenced herein are the property of their respective owners and no trademark rights to
the same are claimed.
Table of Contents
1. C Language .................................................................................................................. 1
1.1. Data Types ......................................................................................................... 2
1.1.1. Half Precision Floating-Point ....................................................................... 3
1.1.2. Fractional Types ........................................................................................ 4
1.1.3. Packed Data Types .................................................................................... 5
1.1.4. Changing the Alignment: __unaligned, __packed__ and __align() ....................... 7
1.2. Accessing Memory .............................................................................................. 8
1.2.1. Memory Qualifiers ..................................................................................... 8
1.2.2. Placing an Object at an Absolute Address: __at() ........................................... 11
1.2.3. Accessing Bits ........................................................................................ 12
1.3. Data Type Qualifiers ........................................................................................... 13
1.3.1. Circular Buffers: __circ ............................................................................. 13
1.3.2. Accessing Hardware from C ...................................................................... 14
1.3.3. Saturation: __sat ..................................................................................... 16
1.3.4. External MCS RAM Data References: __mcsram ........................................... 16
1.3.5. External PCP PRAM Data References: __pram ............................................. 17
1.3.6. Shared Data between TriCore and PCP: __share_pcp .................................... 17
1.4. Multi-Core Support ............................................................................................. 19
1.4.1. Scratchpad RAM ..................................................................................... 19
1.4.2. Program Flash Memory (PFLASH) ............................................................. 20
1.4.3. Distributed Local Memory Unit SRAM (DLMU) .............................................. 21
1.4.4. Compile Time Core Association ................................................................. 21
1.5. Shift JIS Kanji Support ........................................................................................ 29
1.6. Using Assembly in the C Source: __asm() .............................................................. 30
1.7. Attributes ......................................................................................................... 36
1.8. Pragmas to Control the Compiler .......................................................................... 41
1.9. Predefined Preprocessor Macros .......................................................................... 50
1.10. Switch Statement ............................................................................................. 51
1.11. Functions ....................................................................................................... 53
1.11.1. Calling Convention ................................................................................. 53
1.11.2. Register Usage ..................................................................................... 55
1.11.3. Inlining Functions: inline .......................................................................... 55
1.11.4. Interrupt and Trap Functions .................................................................... 57
1.11.5. Intrinsic Functions ................................................................................. 64
1.12. Compiler Generated Sections ............................................................................. 79
1.12.1. Rename Sections .................................................................................. 80
1.12.2. Influence Section Definition ..................................................................... 82
2. C++ Language ............................................................................................................ 83
2.1. C++ Language Extension Keywords ...................................................................... 83
2.2. C++ Dialect Accepted ......................................................................................... 83
2.2.1. C++03 Mode .......................................................................................... 84
2.2.2. GNU C++ Mode ...................................................................................... 85
2.2.3. Anachronisms Accepted ........................................................................... 86
2.2.4. Atomic Operations ................................................................................... 87
2.3. Namespace Support .......................................................................................... 89
2.4. Template Instantiation ......................................................................................... 90
2.4.1. Instantiation Modes ................................................................................. 91
2.4.2. Instantiation #pragma Directives ................................................................. 92
iii
2.4.3. Implicit Inclusion ..................................................................................... 93
2.5. Inlining Functions ............................................................................................... 94
2.6. Extern Inline Functions ....................................................................................... 95
2.7. Pragmas to Control the C++ Compiler .................................................................... 95
2.7.1. C pragmas Supported by the C++ compiler .................................................. 96
2.8. Predefined Macros ............................................................................................. 97
2.9. Precompiled Headers ....................................................................................... 101
2.9.1. Automatic Precompiled Header Processing ................................................. 101
2.9.2. Manual Precompiled Header Processing .................................................... 104
2.9.3. Other Ways to Control Precompiled Headers ............................................... 104
2.9.4. Performance Issues ............................................................................... 105
3. Assembly Language .................................................................................................... 107
3.1. Assembly Syntax ............................................................................................. 107
3.1.1. Deviations from the Instruction Set Manual ................................................. 108
3.2. Assembler Significant Characters ........................................................................ 109
3.3. Operands of an Assembly Instruction ................................................................... 109
3.4. Symbol Names ................................................................................................ 110
3.4.1. Predefined Preprocessor Symbols ............................................................ 110
3.5. Registers ........................................................................................................ 111
3.5.1. Special Function Registers ...................................................................... 112
3.6. Assembly Expressions ...................................................................................... 112
3.6.1. Numeric Constants ................................................................................ 113
3.6.2. Strings ................................................................................................ 113
3.6.3. Expression Operators ............................................................................. 114
3.7. Working with Sections ....................................................................................... 115
3.8. Built-in Assembly Functions ............................................................................... 117
3.9. Assembler Directives and Controls ...................................................................... 130
3.9.1. Assembler Directives .............................................................................. 131
3.9.2. Assembler Controls ................................................................................ 176
3.10. Macro Operations ........................................................................................... 192
3.10.1. Defining a Macro ................................................................................. 192
3.10.2. Calling a Macro ................................................................................... 192
3.10.3. Using Operators for Macro Arguments ..................................................... 193
4. Using the C Compiler .................................................................................................. 199
4.1. Compilation Process ......................................................................................... 199
4.2. Calling the C Compiler ...................................................................................... 200
4.3. The C Startup Code .......................................................................................... 202
4.4. How the Compiler Searches Include Files ............................................................. 206
4.5. Compiling for Debugging ................................................................................... 206
4.6. Compiler Optimizations ..................................................................................... 207
4.6.1. Generic Optimizations (frontend) .............................................................. 208
4.6.2. Core Specific Optimizations (backend) ....................................................... 211
4.6.3. Optimize for Code Size or Execution Speed ................................................ 214
4.7. Static Code Analysis ......................................................................................... 217
4.7.1. C Code Checking: CERT C ...................................................................... 218
4.7.2. C Code Checking: MISRA C .................................................................... 220
4.8. C Compiler Error Messages ............................................................................... 222
5. Using the C++ Compiler ............................................................................................... 225
5.1. Calling the C++ Compiler ................................................................................... 225
5.2. How the C++ Compiler Searches Include Files ....................................................... 227
iv
TASKING VX-toolset for TriCore User Guide
5.3. C++ Compiler Error Messages ............................................................................ 228
6. Using the Assembler ................................................................................................... 231
6.1. Assembly Process ............................................................................................ 231
6.2. Calling the Assembler ....................................................................................... 232
6.3. How the Assembler Searches Include Files ........................................................... 233
6.4. Assembler Optimizations ................................................................................... 234
6.5. Generating a List File ........................................................................................ 235
6.6. Assembler Error Messages ................................................................................ 235
7. Using the Linker ......................................................................................................... 237
7.1. Linking Process ............................................................................................... 238
7.1.1. Phase 1: Linking .................................................................................... 239
7.1.2. Phase 2: Locating .................................................................................. 240
7.2. Calling the Linker ............................................................................................. 242
7.3. Linking with Libraries ........................................................................................ 243
7.3.1. How the Linker Searches Libraries ............................................................ 245
7.3.2. How the Linker Extracts Objects from Libraries ............................................ 246
7.4. Incremental Linking .......................................................................................... 247
7.5. Cross-Linking .................................................................................................. 248
7.6. Linking Core-Specific Projects into a Multi-Core Application ...................................... 249
7.7. Importing Binary Files ....................................................................................... 251
7.8. Linker Optimizations ......................................................................................... 252
7.9. Controlling the Linker with a Script ....................................................................... 254
7.9.1. Purpose of the Linker Script Language ...................................................... 254
7.9.2. Eclipse and LSL .................................................................................... 254
7.9.3. Preprocessor Macros in the Linker Script Files ............................................ 256
7.9.4. Structure of a Linker Script File ................................................................ 258
7.9.5. The Architecture Definition ...................................................................... 262
7.9.6. The Derivative Definition ......................................................................... 265
7.9.7. The Processor Definition ......................................................................... 268
7.9.8. The Memory Definition ............................................................................ 268
7.9.9. The Section Layout Definition: Locating Sections .......................................... 270
7.9.10. Locating in a Multi-core Processor Environment ......................................... 272
7.9.11. Locating Private Sections in ROM ........................................................... 274
7.9.12. Stack Size Estimation ........................................................................... 275
7.9.13. MPU Configuration Data ........................................................................ 280
7.9.14. Boot Mode Headers ............................................................................. 283
7.9.15. Booting AURIX SCR ............................................................................. 289
7.10. Linker Labels ................................................................................................. 289
7.11. Generating a Map File ..................................................................................... 292
7.12. Linker Error Messages .................................................................................... 292
8. Using the Utilities ........................................................................................................ 295
8.1. Control Program .............................................................................................. 295
8.2. Make Utility amk .............................................................................................. 297
8.2.1. Makefile Rules ...................................................................................... 297
8.2.2. Makefile Directives ................................................................................. 299
8.2.3. Macro Definitions ................................................................................... 299
8.2.4. Makefile Functions ................................................................................. 301
8.2.5. Conditional Processing ........................................................................... 302
8.2.6. Makefile Parsing .................................................................................... 302
8.2.7. Makefile Command Processing ................................................................ 303
v
TASKING VX-toolset for TriCore User Guide
剩余1183页未读,继续阅读
资源评论
Huskiey
- 粉丝: 39
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功