Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.

Similar presentations


Presentation on theme: "© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options."— Presentation transcript:

1 © 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options of the High-performance Embedded Workshop (HEW), a key tool for developing software for embedded systems that use microcontrollers (MCUs) from Renesas Technology Corp. Objectives  Learn about the five main categories of C/C++ compiler configuration options that HEW provides.  Understand how to configure each of these options Content  43 pages  5 questions Learning Time  60 minutes Introduction

2 © 2008, Renesas Technology America, Inc., All Rights Reserved 2 Click on Build  Select H8 Standard Toolchain… Invoking C/C++ Configuration C/C++ settings for a specific project/ files configuration can be selected here. Here are the corresponding command line entries for all settings in the HEW linker dialog.

3 © 2008, Renesas Technology America, Inc., All Rights Reserved 33 Five categories of options Options in C/C++ Compiler To configure the source-file related information; for example, location of the include files, etc. To configure the type of output format for source files, section specification for source files, etc. To configure the optimization for the C and C++ files during compilation To configure the optimization for the C and C++ files during compilation To select the type of listing file generated for C and C ++ files. To select the type of listing file generated for C and C ++ files. To configure other miscellaneous options To configure other miscellaneous options 1. Source 2. Object 3. List 4. Optimize 5. Other 1. Source 2. Object 3. List 4. Optimize 5. Other

4 © 2008, Renesas Technology America, Inc., All Rights Reserved 4 Source settings  Include file directories  PreInclude files  Defines  Messages  Message level  File inline path Overview of Source Category

5 © 2008, Renesas Technology America, Inc., All Rights Reserved 5 Source settings  Include file directories - Specifies path for include files  PreInclude files - Specify an include file that will be inserted into head of a C/C++ source file  Defines - Specify definitions of macro names; e.g., #define DEBUG 1 Includes, Preincludes, Defines

6 © 2008, Renesas Technology America, Inc., All Rights Reserved 6 Display of Information Messages Source settings  Messages - Configures the information- level messages to be displayed during compilation - Default: Unchecked to keep build output messages as clean as possible Example (command line) ch38 -nomessage=5,300-306 test.c

7 © 2008, Renesas Technology America, Inc., All Rights Reserved 7 Adjusting the Level of Messages Source settings  Message level - Changes message level of different types of messages that are displayed during compilation - Available settings: - Default - Information - Warning - Error - Custom (such as, error=200) User’s Manual H8S, H8/300 Series C/C++ Compiler, Assembler, Optimizing Linkage Editor User’s Manual”.

8 © 2008, Renesas Technology America, Inc., All Rights Reserved 8 Inter-file Inline Expansion Source settings  File inline path* can be used to add location of files for inter-file inline expansion - Add, insert, and remove the path in the list box - Set path priority - Double-click on path to modify the entry in the “Include Files Directory” * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option

9

10 © 2008, Renesas Technology America, Inc., All Rights Reserved 10 Five categories of options Options in C/C++ Compiler To configure the source-file related information; for example, location of the include files, etc. To configure the type of output format for source files, section specification for source files, etc. To configure the optimization for the C and C++ files during compilation To configure the optimization for the C and C++ files during compilation To select the type of listing file generated for C and C ++ files. To select the type of listing file generated for C and C ++ files. To configure other miscellaneous options To configure other miscellaneous options 1. Source 2. Object 3. List 4. Optimize 5. Other 1. Source 2. Object 3. List 4. Optimize 5. Other

11 © 2008, Renesas Technology America, Inc., All Rights Reserved 11 Overview of Object Category Object settings  Choose Output file type  Configure Section  Select Multiply/Divide operation specification  Select Template  Choose Data string storage location  Specify variables boundary alignment  Modify output directory  Select generate debug information choice 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8

12 © 2008, Renesas Technology America, Inc., All Rights Reserved 12 Files Generated by the Compiler Object settings  Output file type - Machine code - Assembly source code - Preprocessed source file* * When this option is selected, no object code is generated, so many of the toolchain settings options no longer apply. * When this option is selected, no object code is generated, so many of the toolchain settings options no longer apply.

13 © 2008, Renesas Technology America, Inc., All Rights Reserved 13 Section Names Can Be Entered Object settings  Options for Section configuration - Program code section - Const data section - Data section - Un-initialized data section

14 © 2008, Renesas Technology America, Inc., All Rights Reserved 14 Multiply/Divide Operations Object settings  Multiplication and division operations can be handled in different ways - Based on ANSI* - Non ANSI* - Non ANSI ver6.0* * Available only for the following CPUs: H8/300 H8/300H H8S with Legacy=v4 option * Available only for the following CPUs: H8/300 H8/300H H8S with Legacy=v4 option

15 © 2008, Renesas Technology America, Inc., All Rights Reserved 15 Specify Template Instances Object settings  Five choices for conditions for generating Template instances - None - Static - Used - All - Auto

16 © 2008, Renesas Technology America, Inc., All Rights Reserved 16 String Data Storage Location Object settings  Store string data in - Const section - Data section

17 © 2008, Renesas Technology America, Inc., All Rights Reserved 17 Variables Alignment Boundary Object settings  Group by alignment - None - Auto - 4byte

18

19 © 2008, Renesas Technology America, Inc., All Rights Reserved 19 Five categories of options Options in C/C++ Compiler To configure the source-file related information; for example, location of the include files, etc. To configure the type of output format for source files, section specification for source files, etc. To configure the optimization for the C and C++ files during compilation To configure the optimization for the C and C++ files during compilation To select the type of listing file generated for C and C ++ files. To select the type of listing file generated for C and C ++ files. To configure other miscellaneous options To configure other miscellaneous options 1. Source 2. Object 3. List 4. Optimize 5. Other 1. Source 2. Object 3. List 4. Optimize 5. Other

20 © 2008, Renesas Technology America, Inc., All Rights Reserved 20 Overview of List Category List Settings  Generate list file* - Determines whether or not list file is generated - If selected, enables various options * Not available when Preprocessed source file is selected for the Output file type

21 © 2008, Renesas Technology America, Inc., All Rights Reserved 21 List File Tab Size, Contents List Settings  File tab size - 4 - 8  Contents - Object list - Statistics - Allocation information - Source code listing - After preprocessor expansion

22 © 2008, Renesas Technology America, Inc., All Rights Reserved 22 Five categories of options Options in C/C++ Compiler To configure the source-file related information; for example, location of the include files, etc. To configure the type of output format for source files, section specification for source files, etc. To configure the optimization for the C and C++ files during compilation To configure the optimization for the C and C++ files during compilation To select the type of listing file generated for C and C ++ files. To select the type of listing file generated for C and C ++ files. To configure other miscellaneous options To configure other miscellaneous options 1. Source 2. Object 3. List 4. Optimize 5. Other 1. Source 2. Object 3. List 4. Optimize 5. Other

23 © 2008, Renesas Technology America, Inc., All Rights Reserved 23 Overview of Optimize Category Optimization settings  Enable optimization*  Select type of optimization: Speed or Size  Configure details optimization  Configure Switch statement generation  Configure Function calls indirect addressing mode  Specify Data access mode  Select Generate file for inter-module optimization choice * Not available when Preprocessed source file is selected for the Output file type

24 © 2008, Renesas Technology America, Inc., All Rights Reserved 24 Choice of Optimization Type Optimization settings  Size oriented*  Speed oriented* Like other compiler options, you can set different optimizations for individual files by first selecting them in the left-hand navigation pane before changing the option. * Not available when Preprocessed source file is selected for the Output file type Size option does not provide a Configuration option

25 © 2008, Renesas Technology America, Inc., All Rights Reserved 25 Speed Optimization Choices Optimization Settings  For Speed only - Register - Switch judgment - Shift to multiple - Structure assignment - Expression - Loop optimization - Loop unrolling - Inline function

26 © 2008, Renesas Technology America, Inc., All Rights Reserved 26 Switch Statement Generation Optimization settings  Options for generating code for switch statements apply to both Speed and Size optimization - Auto - If then - Table

27 © 2008, Renesas Technology America, Inc., All Rights Reserved 27 Memory Indirect Addressing Optimization settings  For Size optimization, Function calls can be made using different memory indirect addressing modes - @aa (None) - @@aa:8 (Normal)  section “$INDIRECT” - @@vec:7 (Extended)  section“$EXINDIRECT” Extended Normal None

28 © 2008, Renesas Technology America, Inc., All Rights Reserved 28 Access Statically Allocated Data Optimization settings  Data access modes for Size optimization - @aa  None - @aa:8  8-bit absolute addressing - @aa:16  16-bit absolute addressing

29 © 2008, Renesas Technology America, Inc., All Rights Reserved 29 Optimize Details: 3 Categories Optimization settings  Inline*  Global variables  Miscellaneous * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option

30 © 2008, Renesas Technology America, Inc., All Rights Reserved 30 Treatment of Global Variables Optimization settings  Four choices for levels: - Level 1 - Level 2 - Level 3 - Custom* * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option

31 © 2008, Renesas Technology America, Inc., All Rights Reserved 31 Global Variable Custom Settings Optimization settings  Specify optimizing range - All* - No loop* - No block* * These “Custom” settings are available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * These “Custom” settings are available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option

32 © 2008, Renesas Technology America, Inc., All Rights Reserved 32 Customize Register Allocations Optimization settings  Allocate registers to global variables - Disable* - Enable* - Default* * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * These “Custom” settings are available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * These “Custom” settings are available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option

33 © 2008, Renesas Technology America, Inc., All Rights Reserved 33 Propagation of Global Variables Optimization settings  Propagate variables which are const qualified - Disable* - Enable* - Default* Example const int x = 1; int A; void f() { A = x; } void f() { A = 1; /* x = 1 is propagated */ } * These “Custom” settings are available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * These “Custom” settings are available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option

34 © 2008, Renesas Technology America, Inc., All Rights Reserved 34 Miscellaneous Category Optimization settings  Select Delete vacant-loop choice*  Specify maximum unroll factor*  Select Allocate registers to structure choice*  Select Inline memcpy/strcpy choice** ** Available only for the following CPUs: AE5 H8SX ** Available only for the following CPUs: AE5 H8SX * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option * Available only for the following CPUs: AE5 H8SX H8S without Legacy=v4 option

35 © 2008, Renesas Technology America, Inc., All Rights Reserved 35 Five categories of options Options in C/C++ Compiler To configure the source-file related information; for example, location of the include files, etc. To configure the type of output format for source files, section specification for source files, etc. To configure the optimization for the C and C++ files during compilation To configure the optimization for the C and C++ files during compilation To select the type of listing file generated for C and C ++ files. To select the type of listing file generated for C and C ++ files. To configure other miscellaneous options To configure other miscellaneous options 1. Source 2. Object 3. List 4. Optimize 5. Other 1. Source 2. Object 3. List 4. Optimize 5. Other

36

37 © 2008, Renesas Technology America, Inc., All Rights Reserved 37 Overview of “Other” Category “Other” Settings  Miscellaneous options  User defined options

38 © 2008, Renesas Technology America, Inc., All Rights Reserved 38 Additional Settings Choices “Other” Settings  Miscellaneous options - Allow comment nest - Check EC++ language* - Interrupt handler saves/restores MACH and MACL registers - Enum treatment - Register variable increase - Put common sub-expression on register temporarily * Must be enabled if EC++ library is used.

39 © 2008, Renesas Technology America, Inc., All Rights Reserved 39 Misc. and User Defined Choices “Other” settings  Miscellaneous options - Use EEPMOV in block copy - Loop condition treatment - Suppress #line - Enable register declaration - Obey ANSI specification*  User defined options - change_message= error Use EEPMOV in block copy Disable optimization of loop iteration condition Suppress #line Enable register definition Use EEPMOV in block copy Disable optimization of loop iteration condition Suppress #line Enable register definition * Valid only for AE5, H8SX, and H8S without Legacy=v4 option CPU types. Invalid if Preprocessed source file is selected for Output file type Generate your own options here.

40 © 2008, Renesas Technology America, Inc., All Rights Reserved 40 C/C++ Configuation Flexibility Toolchain configuration options  Apply settings to match your needs - To specific files - To entire C files only - To entire C++ files only If HEW displays the set of files or folder you have selected in a gray color rather than tan, those files have multiple settings.

41

42

43 © 2008, Renesas Technology America, Inc., All Rights Reserved 43 Categories for C/C++ files configuration What the many various settings are and do Application of toolchain configuration Course Summary Download a free evaluation copy of HEW at: www.renesas.com/hew


Download ppt "© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options."

Similar presentations


Ads by Google