IAR Embedded Workbenches for Renesas

Similar documents
Getting the Least Out of Your C Compiler

IAR Embedded Workbench for 8051 Version 7.30A

IDE for medical device software development. Hyun-Do Lee, Field Application Engineer

ID 321L: KPIT GNU compiler plug-ins for HEW / KPIT Eclipse IDE

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.0 Revision: 0 Date: September 18, 2017

An Introduction to e 2 studio

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.1 Revision: 0 Date: May 3, 2018

Boost Performance Optimizations. Rafael Taubinger Sr. FAE

Migrating from Keil µvision for 8051 to IAR Embedded Workbench for 8051

Migrating from Keil µvision for 8051 to IAR Embedded Workbench for 8051

IAR Embedded Workbench

IAR C-SPY Hardware Debugger Systems User Guide

L2 - C language for Embedded MCUs

embos Real Time Operating System CPU & Compiler specifics for RENESAS M16C CPUs and IAR compiler Document Rev. 5

embos Real Time Operating System CPU & Compiler specifics for RENESAS M16C CPUs and HEW workbench Document Rev. 1

IAR Embedded Workbench

IAR Embedded Workbench

MetaWatch Firmware Design Guide

EW The Source Browser might fail to start data collection properly in large projects until the Source Browser window is opened manually.

IAR C-SPY Hardware Debugger Systems User Guide. for Renesas E30A/E30 Emulators

Laboratory Exercise 3 Comparative Analysis of Hardware and Emulation Forms of Signed 32-Bit Multiplication

embos Real Time Operating System CPU & Compiler specifics for RENESAS SH2A CPUs and KPIT GNU compiler Document Rev. 1

Getting Started. with IAR Embedded Workbench GSEW-2

VX-Toolset for TriCore

Kinetis Software Optimization

Introduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger

RL78 Project Configuration Tips

IAR Embedded Workbench

MSP430 IAR Embedded Workbench IDE User Guide. for Texas Instruments MSP430 Microcontroller Family

Fujitsu 2010 FAE Training Lab Sunnyvale, CA

WIND RIVER DIAB COMPILER

embos Real Time Operating System CPU & Compiler specifics for RENESAS SH2 CPUs and RENESAS HEW4 Document Rev. 1

embos Real-Time Operating System CPU & Compiler specifics for SH2A core using IAR Embedded Workbench

BASICS OF THE RENESAS SYNERGY PLATFORM

IAR EWARM Quick Start for. Holtek s HT32 Series Microcontrollers

An unrivalled feature-set and unprecedented integration

Computer Organization and Assembly Language. Lab Session 01

embos Real-Time Operating System CPU & Compiler specifics for RH850 using IAR

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Embedded Software Development Tools Module No: CS/ES/36 Quadrant 1 e-text

BASICS OF THE RENESAS SYNERGY TM

IAR PowerPac RTOS for Texas Instruments MSP430 Microcontroller Family

IAR Embedded Workbench

IAR Embedded Workbench

Introduction to C. Why C? Difference between Python and C C compiler stages Basic syntax in C

SOMNIUM DRT Benchmarks Whitepaper DRT v3.4 release : August 2016

Fixed-Point Math and Other Optimizations

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document C28X CCS

Kampala August, Agner Fog

18-600: Recitation #3

IAR Embedded Workbench

Hands-On with STM32 MCU Francesco Conti

Final CSE 131B Spring 2004

embos Real-Time Operating System CPU & Compiler specifics for Renesas RX using KPIT GNU tools

Recitation #11 Malloc Lab. November 7th, 2017

CPE 323: Laboratory Assignment #1 Getting Started with the MSP430 IAR Embedded Workbench

IAR Embedded Workbench

Special Topics for Embedded Programming

TMS470 ARM ABI Migration

Software Development with an Open Source RTOS

Pragma intrinsic and more

Programming in the MAXQ environment

esi-risc Development Suite Getting Started Guide

Renesas 78K/78K0R/RL78 Family In-Circuit Emulation

H8 C-SPY. User Guide WINDOWS WORKBENCH VERSION

Development Tools. 8-Bit Development Tools. Development Tools. AVR Development Tools

Experiment 1. Development Platform. Ahmad Khayyat, Hazem Selmi, Saleh AlSaleh

Getting Started with IAR Embedded Workbench for Renesas Synergy

RL78 Ultra Low Power MCU Lab

VORAGO VA108x0 GCC IDE application note

AD5669R - Microcontroller No-OS Driver

Figure 1. Simplicity Studio

Factsheet 16FX Concept Compatible Platform of 16-bit Microcontrollers

Device support in IAR Embedded Workbench for 8051

Using Code Composer Studio IDE with MSP432

Under the Compiler's Hood: Supercharge Your PLAYSTATION 3 (PS3 ) Code. Understanding your compiler is the key to success in the gaming world.

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 11 gdb and Debugging (Thanks to Hal Perkins)

M16C R8C PC7501 Emulator Debugger V Release Notes

Introducing the Latest SiFive RISC-V Core IP Series

MCUXpresso IDE FreeRTOS Debug Guide. Rev November, 2017

In examining performance Interested in several things Exact times if computable Bounded times if exact not computable Can be measured

embos Real Time Operating System CPU & Compiler specifics for ARM core with ARM RealView Developer Suite 3.0 Document Rev. 1

CC05B RX Project Configuration Tips

Embedded Systems - FS 2018

embos Real-Time Operating System CPU & Compiler specifics for Renesas RX using Renesas CCRX compiler and e2studio

Trace Getting Started V8.02

CODE TIME TECHNOLOGIES. Abassi RTOS MISRA-C:2004. Compliance Report

Tools Basics. Getting Started with Renesas Development Tools R8C/3LX Family

BASICS OF THE RENESAS SYNERGY PLATFORM

CodeWarrior Development Studio for Freescale HCS12(X) Microcontrollers

Short Notes of CS201

_ V Renesas R8C In-Circuit Emulation. Contents. Technical Notes

The ThreadX C-SPY plugin

IAR Embedded Workbench

CS201 - Introduction to Programming Glossary By

2-bit ARM Cortex TM -M3 based Microcontroller FM3 Family MB9A130 Series

IAR PowerPac RTOS for ARM Cores

IAR Embedded Workbench

Tool Kit. ARM Cortex MCU Development Tools. June,

IAR C/C++ Compiler Reference Guide

embos Real-Time Operating System CPU & Compiler specifics for Texas Instruments using TI Code Composer for MSP430

Transcription:

IAR Embedded Workbenches for Renesas Shawn A. Prestridge, Senior Field Applications Engineer IAR Systems, Inc. Class ID: 3C19I Renesas Electronics America Inc.

Shawn A. Prestridge Senior Field Applications Engineer Responsible for Embedded Workbench training Develops applications for many different boards Develops applications for middleware such as: RTOS GUI Projects as examples and for customers PREVIOUS EXPERIENCE: Embedded hardware/software engineer for Texas instruments. Contractual-based development for Ministry of Software Degree work from Southern Methodist University: BSEE, BS Mathematics, MSEE, MS Software Engineering, PhD in EE 2

Renesas Technology & Solution Portfolio 3

Agenda Tour of the Embedded Workbench Renesas MCU support Hardware debugger support Example Projects C-SPY debugger advanced features visualstate overview Eclipse support Customer support Writing more efficient code Live demonstration Summary 4

Introduction The Embedded Workbench enables developers to write the tightest and fastest code possible for their embedded designs. This session will explore the features of the toolchain and show you how to use them effectively. 5

IAR Embedded Workbench 6

Overview IAR Embedded Workbench IDE IDE tools Build tools IAR C-SPY Debugger Plug-in to Eclipse IDE Custom plug-ins (editors, source code control systems, etc.) Editor Project manager Library builder IAR C/C++ Compiler Assembler Simulator driver Hardware system drivers Power debugging Segger J-Link Renesas E1 Renesas E20 3 rd party probes IAR visualstate Librarian Linker RTOS plug-ins Integrated RTOS partners 7

Renesas MCU Support 32-bit RX SuperH V850 R32C RH850 16-bit RL78 78K0R M32C/M16C R8C H8S H8/300H 8-bit 78K0 78K0S 8

IAR Embedded Workbench for Renesas RH850 Beta version planned for Autumn 2012 Based on the current EWV850 with: New instructions added Improved optimization including re-written arithmetic libraries C99 support New editor (source browser, auto completion, code folding, block selection, etc.) Improved inline assembler (GNU style) Improved stack analysis (Link-time analysis of max stack depth) Elf/Dwarf as object format Renesas ABI (Application Binary Interface) compliant Link compatibility between toolchains Ability to port existing object code into EWRH850 C-SPY support for Renesas emulators 9

IAR Embedded Workbench for Renesas The only toolchain that supports virtually ALL Renesas devices! One IDE to access all your Renesas projects An Embedded Workbench workspace can have multiple projects, each one targeting a different Renesas architecture 10

Hardware Debugging Support for Renesas Renesas E(x) Emulators (OCD) Download to flash Debug in real time on hardware Support for hardware breakpoints Renesas IECUBE (in-circuit) Adds support for instruction and function trace, event breakpoints, timers, etc 11

Example Projects Ready-made example projects demonstrating the different peripheral s of the MCU Most popular boards supported Kickstart version of EW included in Renesas Starterkits 12

IAR Embedded Workbench for RX v2.40 2.76 Coremarks/MHz! Coremark Board: RDKRX62N, 96Mhz Result: 2.76 Coremarks/Mhz CoreMark Size : 666 Total ticks : 542918054 Total time (secs): 11.310793 Iterations/Sec : 265.233400 Iterations : 3000 Compiler version : Compiler flags : Memory location : STACK seedcrc : 0xe9f5 [0]crclist : 0xe714 [0]crcmatrix : 0x1fd7 [0]crcstate : 0x8e3a [0]crcfinal : 0xcc42 Correct operation validated. See readme.txt for run and reporting rules. CoreMark 1.0 : 265.233400 / / STACK 13

EEMBC Benchmarks Published by Renesas 14

IAR Embedded Workbench for RX v2.40 RX size benchmark This is a code size test on real customer applications where the size of linked code + constants has been compared. The test was performed with the following tools: IAR EWRX v2.40.0 Options: -e -Ohz --double=32 --data_model=f --align_func=1 --endian l --core RX600 mfc Renesas RX v1.02.01 Options: -cpu=rx600 -fpu -optimize=max -size -goptimize Linker: -noprelink optimize GNURX v12.01 -Os -fno-function-cse -funit-at-a-time -falign-jumps -fdata-sections -ffunctionsections -g3 -g -flto -mlittle-endian-data -mcpu=rx600 -c -x c Linker: --gc-sections -no-keep-memory -e _PowerON_Reset -loptm -loptc - lnosys flto 30000 25000 20000 15000 10000 5000 0 GNURX HEWRX EWRX Customer application Name GNURX HEWRX EWRX EWRX vs GNURX EWRX vs HEWRX Blowfish algorithm blowfish 6522 8222 6275 96,2% 76,3% Functions to descramble CSS encrypted DVD content. decrypt 7521 9062 7230 96,1% 79,8% Reed-Solomon Reed_Solom 11615 8539 6240 53,7% 73,1% encoding/decoding on Microwave sensor microwave 20883 28250 18255 87,4% 64,6% application Bluetooth stack bt_stack 54104 63438 53716 99,3% 84,7% Car navigation system car_navig 78194 64573 54596 69,8% 84,5% Turbogenerator technology, engine_contr 128758 124964 116772 90,7% 93,4% "turbocompounding" Remote monitoring and operation for generators and engines. generator 221499 189191 182177 82,2% 96,3% Sum: 529096 496239 445261 84,2% 89,7% 200000 180000 160000 140000 120000 100000 80000 60000 40000 20000 0 GNURX HEWRX EWRX 15

Embedded Workbenches Available Now! See www.iar.com/renesas for more information 16

IAR C-SPY Debugger Advanced Features 17

IAR C-SPY Debugger Performance Analysis Dedicated breakpoint type Capable of measuring these execution aspects: total time total number of cycles number of cycles spent in interrupts and other exceptions the number of executed instructions the number of accepted interrupts and other exceptions. 18

IAR C-SPY Debugger Complex Breakpoints Allows break at address condition and/or data condition Useful to detect access to a certain memory area and within a certain data range Can help you find where data gets clobbered in code Can help you see unauthorized access to memory areas 19

IAR C-SPY Debugger Profiling/Code Coverage Profiling helps you to find the functions in your source code where the most time is spent during execution. Lets you know where to focus optimization efforts Can also help you see when you should inline a function call Code coverage helps you to verify whether all parts of the code have been executed. 20

IAR C-SPY Debugger Trace Functionality Trace lets you inspect the program flow to a specific state. Information based on E1/E20 and J-Link trace capabilities. Choose between non-intrusive mode and richer trace information modes 21

IAR C-SPY Debugger During Execution Features Breakpoints can be set/removed Live watch displays live data in the Watch window Live memory displays live data in the memory window The RAM monitor enables display of data read, written or both, with different colors in the memory window. 22

IAR C-SPY Debugger Hot Attach Feature Possibility to let the debugger attach to a running application at its current location, without resetting the target system. When a board in the field is in the weeds, you can attach to it without resetting in order to determine what went wrong. 23

IAR C-SPY Debugger Power Debugging Feature Ability to sample power consumption and correlate it to the program's instruction sequence and hence with the source code. C-SPY visualizes power consumption data in different views. Provides a view of the power profile of an application. Allows a developer to try different approaches to the application to minimize power footprint. 24

IAR C-SPY Debugger RTOS Awareness RTOS kernel awareness Displays RTOS properties like: task lists, mailboxes, timers, semaphores, queues, and resources Built in support is currently available for: -ThreadX - Micrium uc/os-ii / III - Segger embos - OSEK ORTI -FreeRTOS Task List RTOS Overview 25

visualstate C-SPY Debug Integration Direct graphical feedback in C-SPY for state machines on various levels of detail, like current state vector, executed actions, received events etc. 26

IAR C-SPY Debugger Advanced Features Be sure to attend our lab section to see advanced debug features in action! 27

Learning Renesas Tools Renesas provides a wide variety of starter, evaluation and development kits to fit any price point. All of these kits are supported by IAR Systems and many have a bevy of example applications to get your development effort kick-started! 28

Eclipse Support Eclipse build chain plug-ins available for RX, V850, RL78, R32C and 78K Supports any Eclipse IDE distribution with CDT v3.5 (Galileo) or later Plug-ins included in Renesas e2studio 29

Customer Support Support and Update Agreement (SUA) Free software updates First class world-wide technical support by telephone, e-mail and fax VIP Support contracts available My Pages at www.iar.com Read about new product releases Download product updates Transfer licenses to co-workers Manage your contact information Different architectures, one solution! We have compilers to support over 30 different architectures We are your one-stop compiler supplier 30

Writing Efficient Code 31

Controlling Optimization Global setting Over entire project Per-file settings When functions in a file must run as fast as possible. Per-function settings Use #pragma Compiler version dependent, so check your manual #pragma optimize=s 0 void delay(int time) {... } 32

Structuring an Application To be efficient and portable, an application should: Isolate device-dependent code Leave most of the code undisturbed Use tuned code where needed Generic Program Files Tuned Program Files Device Driver Files Hardware 33

Use Correct Data Sizes Different architectures have different natural data size Different available memories, sizes, etc. Using Unnatural data size might cost A 32-bit MCU might need to shift, mask and signextend operations to use smaller types A smaller MCU will need to store 32-bit data in multiple registers to hold all its contents and perform operations in RAM It is therefore better to use a natural size unless there is a compelling reason not to do so, e.g.: Perhaps you are doing I/O and you need a precise number of bits Bigger types like a char array might take up too much room 34

Use Signedness Appropriately Think about signedness Division by a negative number is treated differently than that for a positive number (by the rules of the C language) Signed Negative values possible Arithmetic operations performed Using a signed number that never will be negative, incurs an extra test-and-jump condition Unsigned Negative values impossible Bit operations performed + - * / % << >> & ^ ~ 35

Avoid Floating Point Arithmetic if Possible Floating point very expensive Brings in large library (from C runtime) Use only when really needed Can be done inadvertently: Example code: #define Other 20 #define ImportantRatio (1.95 * Other) #define ImportantRatioBetter int i=a + b * ImportantRatio; 36

Avoid Floating Point Arithmetic if Possible IEEE 754: float Wide range: Float 10-38 to 10 38, Double 10-308 to 10 308 Good precision: Float 10-7, Double 10-16 Designed for giving small error in complex computations Expensive in size and speed...unless there s hardware support Real-world data usually have: Fixed range Fixed precision Fixed-point arithmetic: Implemented using integers Can give significant savings (size and speed)...do the math before writing the code Use relaxed floating-point semantics 37

Avoid Becoming a Castaway C has implicit and explicit casts Casting is (usually) not free: Sign-extension and zero-extension Complex conversions to and from floating-point numbers Extending pointers Casting to/from pointers is bad Can lose information (smaller size) Inefficient code (larger size) Avoid unless really necessary Don t do explicit casts Don t mix types in expressions 38

Structure your Structures Carefully Structures are padded when the CPU requires alignment or gains from it struct foo { uint8_t byte; uint32_t word; }; 0 4 8 byte 1 byte padding to align word word 4 bytes thus, foo 8 bytes 39

Structure your Structures Carefully Waste of memory to pad? Packed structures require more code Simple guideline reduces need of padding Guideline: Order fields by size Largest object first, smallest object last struct record { long id; /* 4 bytes */ char* name; /* 2 bytes */ char* title; /* 2 bytes */ char tag; /* 1 byte */ }; 40

Use Global Variables Locally Copy value into a local variable Local variable probably placed in register, so operations on it is fast No memory reads Write back the value if needed. Gives more info to compiler No function call will change the variable 41

Use Parameters and Local Variables Parameters and local variables: Give compiler more freedom Usually placed in registers but can be placed in memory Parameter passing: First parameters usually in registers Registers to use = calling convention Register allocation targets: Simple values (integers, pointers, floating-point numbers) Hard to allocate: Arrays indexed addressing the norm Structs large, often pointed to Struct as parameter: Value copied, and a pointer passed Pass pointer directly for efficiency! 42

Use Parameters and Local Variables void foo(char a) { char b,i,j; char h[10]; b=a<<5; for(i=0; ) OUTPUT(b); live ranges a b i j Register usage: Variables can share a register Only present in register while live Don t worry about extra variables Optimize: Minimize lifetime Minimize overlap } for(j=0; ) h[j]=a; 43

Don t Write Clever Code! Clever code: Fewer source characters = better code Using dark corners of C semantics Straightforward code: Easy to read = easy to optimize Easy to maintain Use common constructions: Likely to be better optimized Clever code unsigned long int a; unsigned char b; b =!!(a<<11); Better code unsigned long int a; unsigned char b; if((a & 0x1FFFFF)!= 0) b = 0x01; 44

Avoid Tight Timing Loops Empty delay loop does not work Code with no effect Gets removed Delay is always zero To really delay: Access volatile variable Use OS services Use CPU timer void delay(int time) { int i; for (i=0;i<time;i++) continue; return; } void InitHW(void) { OUT_SIGNAL (0x20); delay(120); OUT_SIGNAL (0x21); delay(121); OUT_SIGNAL (0x19); } 45

Live Demonstration 46

Questions? 47

Summary Tour of the Embedded Workbench Renesas MCU support Hardware debugger support Example Projects C-SPY debugger advanced features visualstate overview Eclipse support Customer support Writing more efficient code Live demonstration Summary 48

Please Provide Your Feedback Please utilize the Guidebook application to leave feedback or Ask me for the paper feedback form for you to use 49

Renesas Electronics America Inc.