23
General Option

General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

General Option

Page 2: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

사용하고자 하는 8051 MCU를 폴더별로 분리되어 있습니다. 해당되는 Device 의 *.i51 파일을 불러옵니다.

다양한 8051 Core 의 메모리를 지원하기 위하만들어 놓은 Memory Mapping Table 입니다.기본적으로 *.i51 파일을 불러오면 CPU 에 따라서 자동으로 설정된다.

- Plain : 일반적인 8051 Core 일 경우, - Tiny : 80751 Core 를 사용할 경우- Extended1 : 그 외에 확장된 8051 Core 를

사용할 경우, ( ex: Dallas DS80C390 /400 계열 )

* EW8051 C Compiler Reference Guide 참고(#page 28/366)

11--1) Derivative Information 1) Derivative Information < CPU< CPU의의 선택선택 >>

*참고사항

Page 3: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

최대로 사용할 수 있는 ROM 의 메모리를 설정한다. (함수 호출시 기본 번지 지정에 적용됨)

- Tiny : 최대 2 Kbyte- Near : 최대 64 Kbyte

- banked : 최대 확장 24bit 처리가능( 0~0xFFFFFF, Banked, 약 400M 정도 )

- Far : 최대 24bit 처리 가능( 0~0xFFFFFF, no-banked , 약 400M 정도)

* 기본적을 Device/ CPU core 선택에 따라서, 설정내용에 따라서 사용 model 이 제한된다.

* EW8051 C Compiler Reference Guide 참고(#page 29/366)

11--2) Code / Data Model2) Code / Data Model < Memory < Memory 선택선택 >>

DATA Model

기본 포인터지시자

사용 Memory 영역( 기본변수 저장 위치)

기본 Data Pointer Size

최대 Object Size

Tiny __idata Data 8 bits 128 bytes

Small __idata Idata 8 bits 256 bytes

Large __xdata Xdata 16 bits 64 Kbytes

Generic __generic Xdata 24 bits 64 Kbtes

Far __far Far Memory 24 bits 16 Mbytes

Data (RAM ) 메모리 설정에 따라서 기본적인 메모리 사용영역과 Pointer Size 와 최대Object Size 가 틀려지게 된다.

Page 4: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

다양한 종류의 Device 와 CPU 를 지원하기 위하여Code & Data Model Type 에 따라서 세분화된Calling Convention (함수 호출 규약) 을 제공하고있다.

아래의 표를 참고하여 메모리의 파라미터 , 내부에선언된 변수들의 위치를 선정/판단 할 수 있다.

11--3) 3) 기타기타 option option

Calling Convention

Stack Pointer

함수 data 위치

Data Overlay - Data overlay Memory

Idata Overlay - Idata overlay Memory

Idata reentrant SP Idata stack

Pdata reentrant PSP Pdata stack

Xdata reentrant XSP Xdata stack

Extended Stack reentrant

ESP:SP Extended stackData 메모리를 활용하여 가상 레지스터를 활용할 수가 있다. 컴파일러를 활용하여 최소 8개에서 최대 32 개 까지의 가상 레지스터 설정이 가능한데, * 물론, CPU 처리 능력 향상에 도움이 되지만, 메모리에 대한 부담을 초래 할 수도 있다.

기본적으로 Internal Data Memory 에서 Stack 영역이 할당되어 있지만, 경우에 따라서 External RAM 에서 Stack 활용이 필요한 경우도 있다.

* 물론, Data Memory 를 Large 이상으로 설정해야만 사용이가능하게 된다.

상수와 String 등을 구분하여 특정 영역에 저장할수 있도록 설정한다.

- (default) RAM Memory : Code data 영역으로 data 영역에 복사한다. - ROM mapped as data : Data 모델에 의해서 Xdata 나 Far 메모리

영역에 저장된다. - Code memory : Code data 영역으로 저장한다.

Page 5: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

CPU 사양에 따라서, Data Pointer 의 동작 방식을변동할 수가 있다. Increment 방식과 XOR/AND 방식으로 구분된다. *기본적으로 CPU 선택 시 자동 설정/지정된다.

* EW8051 C/C++ Compiler Reference Guide 참고(#page 19/366)

2) Data Pointer & Code Bank2) Data Pointer & Code Bank

Bank Memomry 를 사용하기 위한 설정으로,

Number of : Bank 메모리 사용 개수 설정Register : Bank-Switching 레지스터 설정Register mask : Bank 스위칭 bit 를 임의로

설정Bank start : bank 메모리 시작번지 설정Bank end : bank 메모리 끝 번지

* EW8051 C/C++ Compiler Reference Guide 참고(#page 58/366)

CPU 사양에 따라서, 외부메모리접근을 위한 DPTR ( Data Pointer Register ) 의 개수와 DPTR 의 Size 를 설정할 수가 있습니다.

CPU 사양에 따라서, DPTR 번지 설정을 중복(Shadowed) 방식과 구분(Separate)방식으로 나눌수 있으며, Configure 를 통해서 원하는 DPTR 번지를 직접 입력하여 사용할 수도 있다. *기본적으로 CPU 선택 시 자동 설정/지정된다.

* EW8051 C/C++ Compiler Reference Guide 참고(#page 18/366)

Page 6: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

출력되는 Output 파일들의 디렉토리를 임의적으로변경할 수 있도록 설정한다.

• Debug\Exe < HEX, Binary, Debug 파일 생성• Debug\Obj < Object 파일 생성• Debug\List < List, MAP 파일 생성

3) Output & Library Configuration3) Output & Library Configuration

Library ConfigurationLibrary Configuration 은 사용하게 될 Library 의 종류를 설정할 수 있습니다.

< 8051 Library 선택에 영향을 미치는 요소 >

- Target CPU- C / C++ / Embedded C++- DPTR Register- Memory

OutputOutput 은 컴파일 후에 실행 될 혹은 참조하게 될파일 들이 생성되는 Output files 이 저장되는 폴더를 명시합니다.

출력되는 파일의 형태를 Executable / Library 형태로 구분해준다.

Executable : Hex, Binary, Debug, Object 등Library : Object only

Page 7: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

4) Library Options4) Library Options

Library Options 은 불필요한 메모리의 소비를 줄이기 위한 방법으로 printf /scanf formatter 의Level 을 설정기 가능합니다.

Printf formatter :Large (default) / Meduim / Small

Scanf formatter : Large (default) / Meduim

* : Library Configuration 설정에 따라 ON/OFF( Normal - No/ Full – Yes )

Library Options Library Options 은 불필요한 메모리의 소비를 줄이기 위한 방법으로 printf /scanf formatter 의Level 을 설정기 가능합니다.

Printf formatter :Printf formatter :Large (default) / Meduim / Small

Scanf formatter : Scanf formatter : Large (default) / Meduim

* : Library Configuration* : Library Configuration 설정에 따라 ON/OFF( Normal - No/ Full – Yes )

Page 8: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

IDATA SFR ( DATA )0xFF

0x7F

0x00

0xFFFF

0xFFFFFF

XDATA

FAR & Huge ( Extended )

PDATA

기본적인 8051 Data 메모리 구조는 좌측과 같이 복잡한 구조로 분리되어 있으며, 최소한의 기본적인 STACK 은 IDATA에 설정이 되는게 일반 적이며, 추가적으로 PDATA 와 XDATA 로 확장하여 STACK 영역까지 좀더 크게 사용할 수 있다. 또한, 특별한 8051 Core 를 위한 , Extended Data 메모리도 구성해놓았다.

마찬가지로, Heap size 의 경우에도 Size 설정이 가능하지만, XDATA 이상의 고용량의 메모리 에서만 사용이 가능하다.

물론, STACK 이나 Heap size 의 기준은 사용 MCU 와 Application 에 따라 다르다.

5) STACK / HEAP5) STACK / HEAP

Bdata (고정)

SFR (고정)

Memory Type Segment Type

Address range

IDATA IDATA 0xFF

PDATA XDATA 0xFF

XDATA XDATA 0xFFFF

FAR & Extended

CONST 0xFFFFFF

Page 9: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

Example :

__idata_reentrant void f(void){int x;int *xp = &x ;

}

위에 예제가 Small Data model 로 컴파일 되었다면, 포인터 xp 의 경우, idata 영역에 위치하게되는 기본 포인터 타입으로 설정되며, Idata stack 에 위치하는 지역변수 x 를 활용할수 있다.

만약, large data model 로 설정될 경우, 컴파일이 안된는데, 변수 x 는 idata 영역에 위치하지만, 포인터 xp 는 xdata 에 존재하기 때문이다.

55--1) TIP 1) TIP –– Data Model Data Model 과과 Calling Conversion Calling Conversion 연관연관 관계관계

Page 10: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

What is MISRA C?

The Motor Industry Software Reliability Association (MISRA) is an organization in the UK that promotes safety in automotive software.

In 1998, MISRA published its “Guidelines for the Use of the C Language in Vehicle Based Software”. The guidelines address the ambiguities of the C languageand establish coding rules for the automotive industry.

MISRA C includes 127 rules. 93 of these are requiredand the remaining 34 are advisory. All rules apply to the source code and not to the object code generated by the compiler.

Who should use MISRA C?

Compliance with the MISRA C guidelines is a require-ment in many automotive companies but could be beneficial in any development organization.

The guidelines enforce sound coding practices and address the ambiguities of C; they help developers write code in a consistent manner and avoid confusingconstructions.

What is MISRA C?What is MISRA C?

The Motor Industry Software Reliability Association (MISRA) is an organization in the UK that promotes safety in automotive software.

In 1998, MISRA published its “Guidelines for the Use of the C Language in Vehicle Based Software”. The guidelines address the ambiguities of the C languageand establish coding rules for the automotive industry.

MISRA C includes 127 rules. 93 of these are requiredand the remaining 34 are advisory. All rules apply to the source code and not to the object code generated by the compiler.

Who should use MISRA C?Who should use MISRA C?

Compliance with the MISRA C guidelines is a require-ment in many automotive companies but could be beneficial in any development organization.

The guidelines enforce sound coding practices and address the ambiguities of C; they help developers write code in a consistent manner and avoid confusingconstructions.

6) MISRA6) MISRA--CC

How does it work?

The IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will be used for both the compiler and the linker.

How does it work?How does it work?

The IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will be used for both the compiler and the linker.

MISRA C 는 자동차 산업용으로 적용할 수 있는 서비스유틸리티로써, 소스의 안정성을 높이기 위한 C Checker 프로그램입니다.

MISRA C MISRA C 는 자동차 산업용으로 적용할 수 있는 서비스유틸리티로써, 소스의 안정성을 높이기 위한 C Checker 프로그램입니다.

Page 11: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

C / C++ Compiler

Page 12: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

Require prototypes : [Disable]

아래의 프로토타입에 대해서 Error 메시지를 발생시킴으로써, 소스를 추가 검증 할 수 있다.

1)선언되지않은 함수가 호출 시2)Kernighan & Ritchie C 표준 Rule 적용3)프로토타입 선언없이 사용된 Public 함수 선언시4)프로토타입이 선언되어 있지 않은 상태에서,

함수 포인터를 이용한 간접 함수 호출시

* EW8051_User Guide “ Require prototypes ” 참조349/460 Page

Require prototypes : [Disable]Require prototypes : [Disable]

아래의 프로토타입에 대해서 Error 메시지를 발생시킴으로써, 소스를 추가 검증 할 수 있다.

1)선언되지않은 함수가 호출 시2)Kernighan & Ritchie C 표준 Rule 적용3)프로토타입 선언없이 사용된 Public 함수 선언시4)프로토타입이 선언되어 있지 않은 상태에서,

함수 포인터를 이용한 간접 함수 호출시

* EW8051_User Guide “ Require prototypes ” 참조349/460 Page

1) Language1) Language

Language : [C]

사용하게 될 Language 의 종류에 대해서 결정한다. IAR 은 C 뿐만 아니라, Embedded C++ 을 동시에지원이 가능하다.

Language : [C]Language : [C]

사용하게 될 Language 의 종류에 대해서 결정한다. IAR 은 C 뿐만 아니라, Embedded C++ 을 동시에지원이 가능하다.

Enable Multibyte Support : [ Disable ]Multibyte의 사용 유무를 결정 할 수 있다.

Enable IAR migration Preprocessor extensions : [ Disable ]구버전 컴파일러서의 소스를 신버젼과 호환되게 하기 위하여 (확장된) 전처리 기능으로 지원하고 있다. 신버전을 위한 전처리기능이 지원되는 사항은아래와 같다.

- Floating-point expressions- Basic type names and sizeof- All symbol names (including typedefs and variables).

Enable Multibyte Support :Enable Multibyte Support : [ Disable ][ Disable ]Multibyte의 사용 유무를 결정 할 수 있다.

Enable IAR migration Preprocessor extensions : [ Disable ]구버전 컴파일러서의 소스를 신버젼과 호환되게 하기 위하여 (확장된) 전처리 기능으로 지원하고 있다. 신버전을 위한 전처리기능이 지원되는 사항은아래와 같다.

- Floating-point expressions- Basic type names and sizeof- All symbol names (including typedefs and variables).

Language conformance : [ Allow IAR extensions ]

현재 설정된 language 의 상태를 가장 기본적인Strict ISO/ANSI Type 으로 할 지, 혹은 Core 와 컴파일러에 의해서 확장된 language 로 할지 설정한다.

* Compiler Reference Guide “ IAR language extension ” 참조

Plain ‘char’ is : [Unsigned](Unsigned) “ Char “ 변수 타입을 변경할 수 있다.

Language conformance : [ Allow IAR extensions ]Language conformance : [ Allow IAR extensions ]

현재 설정된 language 의 상태를 가장 기본적인Strict ISO/ANSI Type 으로 할 지, 혹은 Core 와 컴파일러에 의해서 확장된 language 로 할지 설정한다.

* Compiler Reference Guide “ IAR language extension ” 참조

Plain Plain ‘‘charchar’’ is : [Unsigned]is : [Unsigned](Unsigned) “ Char “ 변수 타입을 변경할 수 있다.

Page 13: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

2) Code2) Code

Padding for ROM-monitor breakpoint : [ Disable ]

IAR 에서 지원되는 Generic C-SPY Rom 모니터 디버깅시에 C소스 Breakpoint 기능이 가능하도록 지원해준다.

When the C-SPY ROM-monitor sets a breakpoint, it replaces the original instruction with the 3-byte instruction LCALL monitor. For those cases where the original instruction has a different size than three bytes, the compiler will insert extra NOPinstructions (pads) to ensure that all jumps to this destination are correctly aligned.

Note: This mechanism is only supported for breakpoints that you set on C-statementlevel. For breakpoints in assembler code, you have to add pads manually.

Padding for ROMPadding for ROM--monitor breakpoint : monitor breakpoint : [ Disable ][ Disable ]

IAR IAR 에서에서 지원되는지원되는 Generic CGeneric C--SPY Rom SPY Rom 모니터모니터 디버디버깅시에깅시에 CC소스소스 Breakpoint Breakpoint 기능이기능이 가능하도록가능하도록 지원해지원해준다준다. .

When the C-SPY ROM-monitor sets a breakpoint, it replaces the original instruction with the 3-byte instruction LCALL monitor. For those cases where the original instruction has a different size than three bytes, the compiler will insert extra NOPinstructions (pads) to ensure that all jumps to this destination are correctly aligned.

Note: This mechanism is only supported for breakpoints that you set on C-statementlevel. For breakpoints in assembler code, you have to add pads manually.

No UBROF messages in output files : [ Disable ]

UBROF (Universal Binary Relocatable Object Format ) C-SPY Debugging 시에사용되는 Output Format 으로써, 소스와 각종 Symbol 정보들을 포함함으로써, 원활한 디버깅이 가능하도록 돕는다.

No UBROF messages in output files :No UBROF messages in output files : [ Disable ][ Disable ]

UBROF (Universal Binary Relocatable Object Format ) C-SPY Debugging 시에사용되는 Output Format 으로써, 소스와 각종 Symbol 정보들을 포함함으로써, 원활한 디버깅이 가능하도록 돕는다.

Page 14: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

3) Optimization3) Optimization

Enabled transformations :

- Common Sub-expression elimination - Loop unrolling- Function in-lining- Code motion- Type-based alias analysis

Example )-Common sub-expression : 중복되는 함수,

계산식 삭제하여 실행시간 및 코드 사이즈 단축-Function inline : 간단한 함수를 inline 화 하여,

시행 시간을 단축.-Code Motion : 고정적인 반복 루프를 삭제하여

실행시간 및 사이즈 단축

* EW8051 compiler Guide “ Efficient coding for … ” 참조

Enabled transformations :Enabled transformations :

- Common Sub-expression elimination - Loop unrolling- Function in-lining- Code motion- Type-based alias analysis

Example )-Common sub-expression : 중복되는 함수,

계산식 삭제하여 실행시간 및 코드 사이즈 단축-Function inline : 간단한 함수를 inline 화 하여,

시행 시간을 단축.-Code Motion : 고정적인 반복 루프를 삭제하여

실행시간 및 사이즈 단축

* EW8051 compiler Guide “ Efficient coding for … ” 참조

Optimization : [ Balanced ]ARM IAR C/C++ 컴파일러에서는 3가지의 Optimization 종류와( Size / Speed / Balanced ) 과 각각 4가지 Optimization Level 을 선택할 수 있도록 세부적으로 구성되어다.

Optimization Level : [ LOW ] - None [ Best debug support ] - Low - Medium- High [ Maximum optimization ]

Optimization : [ Balanced ]Optimization : [ Balanced ]ARM IAR C/C++ 컴파일러에서는 3가지의 Optimization 종류와( SizeSize / Speed / Balanced Speed / Balanced ) 과 각각 4가지 Optimization Level 을 선택할 수 있도록 세부적으로 구성되어다.

Optimization Level : [ LOW ] Optimization Level : [ LOW ] - None [ Best debug support ] - Low - Medium- High [ Maximum optimization ]

Multi-file Compilation : [ Disable ]Linking 시에 Optimize 를 한번 더 실행을 함으로써, 컴파일시에만 수행된 Optimize 기능을 획기적으로보강하였다.

Discard Unused Publics : [ Disable ]Multi-file Compilation 을 활용한 Optimization 작업시 Public Function 들과 변수들은 범위에서 제외시킬 수 있다.

MultiMulti--file Compilation : [ Disable ]file Compilation : [ Disable ]Linking Linking 시에시에 Optimize Optimize 를를 한번한번 더더 실행을실행을 함으로써함으로써, , 컴파일시에만컴파일시에만 수행된수행된 Optimize Optimize 기능을기능을 획기적으로획기적으로보강하였다보강하였다. .

Discard Unused Publics : [ Disable ]Discard Unused Publics : [ Disable ]MultiMulti--file Compilation file Compilation 을을 활용한활용한 Optimization Optimization 작업작업시시 Public Function Public Function 들과들과 변수들은변수들은 범위에서범위에서 제외시제외시킬킬 수수 있다있다. .

IAR Optimization TIP.IAR Optimization TIP.1)1)#pragrma #pragrma 를를 활용한활용한 함수함수 직접직접 지정지정 OptimizeOptimize2)2)프로젝트단위가프로젝트단위가 아닌아닌 소스별소스별 직접직접 지정지정 OptimizeOptimize

* EW8051 Compiler reference Guide #299/396 page* EW8051 Compiler reference Guide #299/396 page

Page 15: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

3) Output & Library Configuration3) Output & Library Configuration

List 는 list 파일(*.lst)과 ASM source (*.s79) 을 생성할 수 있도록 만들어 주는 설정이다. 각각의 file 생성에 따른 부가적으로Assembler mnemonics 와 diagnostics 가 포함이 된 파일 생성 및 Source include 와 Compiler call frame information 포함이 가능해진다. (Demo 제한)

* EWAVR User guide “ compiler – list ” 참조

List 는 list 파일(*.lst)과 ASM source (*.s79) 을 생성할 수 있도록 만들어 주는 설정이다. 각각의 file 생성에 따른 부가적으로Assembler mnemonics 와 diagnostics 가 포함이 된 파일 생성 및 Source include 와 Compiler call frame information 포함이 가능해진다. (Demo 제한)

* EWAVR User guide “ compiler – list ” 참조

Output 은 컴파일된 파일을 program module [ Enable ] 과 Library module 로 구분하여 컴파일설정한다. 생성된 module은 임의적으로 이름설정이 가능하며, 디버깅 용 소스 정보를 포함 유무에대해서도 설정할 수 있다.

C-SPY 에서 사용할 Debugging Information 을 저장할수 있도록 Generate debug Information 을설정할 수 있다.

* EW8051 compiler Guide “ segment reference ” 참조

Output 은 컴파일된 파일을 program module [ Enable ] 과 Library module 로 구분하여 컴파일설정한다. 생성된 module은 임의적으로 이름설정이 가능하며, 디버깅 용 소스 정보를 포함 유무에대해서도 설정할 수 있다.

C-SPY 에서 사용할 Debugging Information 을 저장할수 있도록 Generate debug Information 을설정할 수 있다.

* EW8051 compiler Guide “ segment reference ” 참조

Page 16: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

Additional include directories : (one per line)

설정된 기본 디렉토리 이 외의 include 디렉토리에대해서 추가 입력할 수 있다.

Ex) $PROJ_DIR$\srciar\$PROJ_DIR$\..\..\

Additional include directories : (one per line)

설정된 기본 디렉토리 이 외의 include 디렉토리에대해서 추가 입력할 수 있다.

Ex) $PROJ_DIR$\srciar\$PROJ_DIR$\..\..\

4) Preprocessor4) Preprocessor

Ignore standard include directories : [ Disable ]

기본 설치 디렉토리인 C:\…AVR\inc 폴더를( $TOOLKIT_DIR&\INC\ ) 를 기본 참조 includedirectory 로 설정한다.

Ignore standard include directories : [ Disable ]

기본 설치 디렉토리인 C:\…AVR\inc 폴더를( $TOOLKIT_DIR&\INC\ ) 를 기본 참조 includedirectory 로 설정한다.

Defined symbols : (one per line)

Source 내에서 사용이 될 Define symbol 을 입력해 넣는다. Preprocessor output to file 을 통하여 파일로 저장도 가능하다.

Ex) TESTVER = 1

Preprocessor output to file : [ Disable ]

헌데, Preprecessor 기능은 외부 자료가 남지 않으므로, 이러한 이유에서 별도의 Output file 로 생성이 가능하도록 하는 옵션이다.

Defined symbols : (one per line)

Source 내에서 사용이 될 Define symbol 을 입력해 넣는다. Preprocessor output to file 을 통하여 파일로 저장도 가능하다.

Ex) TESTVER = 1

Preprocessor output to file : [ Disable ]

헌데, Preprecessor 기능은 외부 자료가 남지 않으므로, 이러한 이유에서 별도의 Output file 로 생성이 가능하도록 하는 옵션이다.

Pre-include :

include 파일을 전처리기처럼 컴파일러 옵션상에서지정할 수 있다.

Ex) test_source.htest_asm.s79

Pre-include :

include 파일을 전처리기처럼 컴파일러 옵션상에서지정할 수 있다.

Ex) test_source.htest_asm.s79

Page 17: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

5) Output & Library Configuration5) Output & Library Configuration

Extra Options 는 GUI 환경에서 구현 할 수 없는 컴파일러의 여러 가지 다른 Option 들에 대해서 사용자에 의해서 임의적으로 설정할 수 있도록 마련해둔 Option 설정창이다.

* GUI : Graphic User Interface

Extra Options Extra Options 는 GUI 환경에서 구현 할 수 없는 컴파일러의 여러 가지 다른 Option 들에 대해서 사용자에 의해서 임의적으로 설정할 수 있도록 마련해둔 Option 설정창이다.

* GUI : Graphic User Interface

Diagnostics 는 컴파일 과정에서 발생 되는Remark / Warning / Error Message 에 대한 처리를 돕는다.

*EW8051 User guide “ diagnostics ” 참조

*EW8051 Compiler guide “ diagnostics ” 참조

Diagnostics Diagnostics 는 컴파일 과정에서 발생 되는Remark / Warning / Error Message 에 대한 처리를 돕는다.

*EW8051 User guide “ diagnostics ” 참조

*EW8051 Compiler guide “ diagnostics ” 참조

Page 18: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

Customer Build & Build Auction

Page 19: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

1) Customer Build & Build Auction1) Customer Build & Build Auction

Build Actions 는 필요에 의해서 build 전후에 pre-build / post-build 하기 위해서 설정하는 옵션이다.

*EW8051 User guide “ building ” 참조

Build Actions Build Actions 는 필요에 의해서 build 전후에 pre-build / post-build 하기 위해서 설정하는 옵션이다.

*EW8051 User guide “ building ” 참조

Customer Build 기능은 최근에 추가된 Option 으로써, IAR 사에서 제공되는 S/W 이외의 다른 S/W Tool 에 대해서, Tool chain 을 사용해 컴파일 환경을 제공하는 기능이다.

Ex) Lex , YACC

* EW8051 User guide “ Extending the tool chain ” 참조* EW8051 Compiler guide “ diagnostics ” 참조

Customer BuildCustomer Build 기능은 최근에 추가된 Option 으로써, IAR 사에서 제공되는 S/W 이외의 다른 S/W Tool 에 대해서, Tool chain 을 사용해 컴파일 환경을 제공하는 기능이다.

Ex) Lex , YACC

* EW8051 User guide “ Extending the tool chain ” 참조* EW8051 Compiler guide “ diagnostics ” 참조

Page 20: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

Linker

Page 21: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

Format :

Debug information for C-SPY : [ Disable ] 디버깅 정보를 C-SPY 용 Format 으로 변경

With runtime control modules : [ Enable ]Program abort, exit, assertions etc.

With I/O emulation modules : [ Enable ] Terminal I/O handling 설정 ( stdin stdout )

Buffered terminal output : [ Disable ] Terminal 이용 시 Buffer 역할을 해준다.

Allow C-SPY-specific extra output file:[Enable]

Extra Output page enable Option

Format :

Debug information for C-SPY : [ Disable ] 디버깅 정보를 C-SPY 용 Format 으로 변경

With runtime control modules : [ Enable ]Program abort, exit, assertions etc.

With I/O emulation modules : [ Enable ] Terminal I/O handling 설정 ( stdin stdout )

Buffered terminal output : [ Disable ] Terminal 이용 시 Buffer 역할을 해준다.

Allow C-SPY-specific extra output file:[Enable]

Extra Output page enable Option

1) Output1) Output

Output 은 실행파일의 Format 형태와 Output file 타입을 설정할 수 있다.

Output files : [ Disable ]임의로 설정된 Format 에 따라서 실행파일의 형태가 선택되며, 기본적으로 실행파일명은 최초 프로젝트명을 따르도록 되어 있다.

Ex) project.d79 ( For Debugging format ),project.a51 (For Intel-Standard/Extended)project.tsk ( For binary image format )

Output Output 은 실행파일의 Format 형태와 Output file 타입을 설정할 수 있다.

Output files : [ Disable ]임의로 설정된 Format 에 따라서 실행파일의 형태가 선택되며, 기본적으로 실행파일명은 최초 프로젝트명을 따르도록 되어 있다.

Ex) project.d79 ( For Debugging format ),project.a51 (For Intel-Standard/Extended)project.tsk ( For binary image format )

Output : [Disable]C-SPY 용 Format 외에 다른 Format 이 필요할 경우 사용한다.

Output format : - intel-standard : HEX format 의 file 이 필요할 경우 ( 64KB 이하 )- intel-extended : HEX format 의 file 이 필요할 경우 ( 64KB 이상 )

Module-local :Symbol 호출 시 제한할 수 있는 Option.

Output : [Disable]Output : [Disable]C-SPY 용 Format 외에 다른 Format 이 필요할 경우 사용한다.

Output format : Output format : - intel-standard : HEX format 의 file 이 필요할 경우 ( 64KB 이하 )- intel-extended : HEX format 의 file 이 필요할 경우 ( 64KB 이상 )

ModuleModule--local local ::Symbol Symbol 호출호출 시시 제한할제한할 수수 있는있는 Option. Option.

Page 22: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

2) Extra Output & List2) Extra Output & List

List 는 MAP 파일(*.map) 수 있도록 만들어 주는 설정이다. C/C++ Compiler 에 List 파일 생성 옵션과는 틀리다. Linking 이 끝난 상태에서만 생성되며, SymbolOption 설정에 따라서 global / local symbol 포함여부를 결정할 수 있다.

Module summary : module 별 메모리 사용량 표시

Include suppressed entries : 일반 List 파일에서 생략된 segment 에 관련된 모든 정보를 확인해 볼 수 있다.

Static overlay map : Static overlay system 정보 추가

ListList 는 MAP 파일(*.map) 수 있도록 만들어 주는 설정이다. C/C++ Compiler 에 List 파일 생성 옵션과는 틀리다. Linking 이 끝난 상태에서만 생성되며, SymbolSymbolOption 설정에 따라서 global / local symbol 포함여부를 결정할 수 있다.

Module summaryModule summary : module 별 메모리 사용량 표시

Include suppressed entries :Include suppressed entries : 일반 List 파일에서 생략된 segment 에 관련된 모든 정보를 확인해 볼 수 있다.

Static overlay map :Static overlay map : Static overlay system 정보 추가

Extra output 은 Output 에서 설정된 Format 의실행파일 이 외에 다른 실행 파일을 얻고자 할 경우 사용한다. 즉, 한번 컴파일 후에 2가지의 파일을 얻을 수 있다.

Extra output Extra output 은 OutputOutput 에서 설정된 Format 의실행파일 이 외에 다른 실행 파일을 얻고자 할 경우 사용한다. 즉, 한번 컴파일 후에 2가지의 파일을 얻을 수 있다.

Page 23: General OptionThe IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will

3) Config & Processing3) Config & Processing

Processing 은 컴파일 후 사 하지 않는 Code Memory 역의 처리를 위해 사 된다.

Fill unused code Memory : [ Disable ]Fill pattern : 사 하지 않는 공간에 임의 Data로 넣는다. Generate checksum : [ Disable ]

Size : [ 1/2/4 bytes ]Arithmetic sum 정해진 사이즈에 따라 연속적으로

한 결과 값 저장 ( 자지 림 없음 )

CRC16 ( 0x11021 ) CRC 다항식을 사 한 확인CRC32 ( 0x4C11DB7 ) CRC 다항식을 사 한 확인Crc polynomial : CRC 다항식(직접 입력) 사 확인Complement : 1과 2의 보수 선택 사Bit Order : 상위(MSB)/하위(LSB) 비트의 순서 설정.

ProcessingProcessing 은 컴파일 후 사 하지 않는 Code Memory 역의 처리를 위해 사 된다.

Fill unused code Memory : [ Disable ]Fill unused code Memory : [ Disable ]Fill pattern : Fill pattern : 사 하지 않는 공간에 임의 Data로 넣는다. Generate checksum : [ Disable ]Generate checksum : [ Disable ]

Size : [ 1/2/4 bytes ]Size : [ 1/2/4 bytes ]Arithmetic sum Arithmetic sum 정해진 사이즈에 따라 연속적으로

한 결과 값 저장 ( 자지 림 없음 )

CRC16 ( 0x11021 ) CRC16 ( 0x11021 ) CRC 다항식을 사 한 확인CRC32 ( 0x4C11DB7 ) CRC32 ( 0x4C11DB7 ) CRC 다항식을 사 한 확인Crc polynomial : Crc polynomial : CRC 다항식(직접 입력) 사 확인Complement : Complement : 1과 2의 보수 선택 사Bit Order : Bit Order : 상위(MSB)/하위(LSB) 비트의 순서 설정.

Config는 XCL 파일과 Startup code 의 entry point 등의 설정을 도와준다.

Linker command file :기본적으로 iar_arm.xcl 파일을 선택이 되며, XCL 파일에는 기본적으로, 사용하는 CPU 설정을 비롯하여, Interrupt Vector 사용 영역 설정과 ROM과 RAM의세그먼트가 링크 된 어드레스 번지 설정 등의 내용을포함하고 있다.

Override default program entry : Cstartup code 에서 정의 되어 있는 entry point 의위치를 재설정해준다. __program_start 라면 문제가 되지 않지만, 그렇지않을 경우 반드시 변경해 주어야만 한다.

Search paths : (one per line) 라이브러리 파일 path 설정

ConfigConfig는 XCL 파일과 Startup code 의 entry point 등의 설정을 도와준다.

Linker command file :Linker command file :기본적으로 iar_arm.xcl 파일을 선택이 되며, XCL 파일에는 기본적으로, 사용하는 CPU 설정을 비롯하여, Interrupt Vector 사용 영역 설정과 ROM과 RAM의세그먼트가 링크 된 어드레스 번지 설정 등의 내용을포함하고 있다.

Override default program entry : Cstartup code 에서 정의 되어 있는 entry point 의위치를 재설정해준다. __program_start 라면 문제가 되지 않지만, 그렇지않을 경우 반드시 변경해 주어야만 한다.

Search paths : (one per line) Search paths : (one per line) 라이브러리 파일 path 설정