Better than Hand Generating Highly Optimized Code using Simulink and Embedded Coder

Similar documents
Generating Industry Standards Production C Code Using Embedded Coder

Ein Modell - viele Zielsysteme

Developing AUTOSAR Compliant Embedded Software Senior Application Engineer Sang-Ho Yoon

Automating Best Practices to Improve Design Quality

Verification and Validation of Models for Embedded Software Development Prashant Hegde MathWorks India Pvt. Ltd.

Intro to Proving Absence of Errors in C/C++ Code

Implementation and Verification Daniel MARTINS Application Engineer MathWorks

Optimization and Implementation of Embedded Signal Processing Algorithms Jonas Rutström Senior Application Engineer

Introduction to C and HDL Code Generation from MATLAB

Automatización de Métodos y Procesos para Mejorar la Calidad del Diseño

Verification and Test with Model-Based Design

Leveraging Formal Methods Based Software Verification to Prove Code Quality & Achieve MISRA compliance

정형기법을활용한 AUTOSAR SWC 의구현확인및정적분석

From Design to Production

Model-Based Design for High Integrity Software Development Mike Anthony Senior Application Engineer The MathWorks, Inc.

2015 The MathWorks, Inc. 1

Verification and Validation of High-Integrity Systems

Model-Based Design for Safety-Critical and Mission-Critical Applications Bill Potter Technical Marketing April 17, 2008

Utilisation des Méthodes Formelles Sur le code et sur les modèles

Simulink 모델과 C/C++ 코드에대한매스웍스의정형검증툴소개 The MathWorks, Inc. 1

Simulink 를이용한 효율적인레거시코드 검증방안

Model-Based Design for effective HW/SW Co-Design Alexander Schreiber Senior Application Engineer MathWorks, Germany

WHITE PAPER. 10 Reasons to Use Static Analysis for Embedded Software Development

Integrated Workflow to Implement Embedded Software and FPGA Designs on the Xilinx Zynq Platform Puneet Kumar Senior Team Lead - SPC

Standardkonforme Absicherung mit Model-Based Design

Leveraging Formal Methods for Verifying Models and Embedded Code Prashant Mathapati Application Engineering Group

MATLAB/Simulink 기반의프로그래머블 SoC 설계및검증

Jay Abraham 1 MathWorks, Natick, MA, 01760

AVS: A Test Suite for Automatically Generated Code

Designing and Prototyping Digital Systems on SoC FPGA The MathWorks, Inc. 1

Model to Code, Made Simple and Easy Sebastien Dupertuis Application Engineer Applications Engineering Group MathWorks Switzerland June 11, 2015

Simulink as Your Enterprise Simulation Platform

Using Model-Based Design in conformance with safety standards

What s New in MATLAB & Simulink. Prashant Rao Technical Manager MathWorks India

Addressing Fixed Point Design Challenges

2015 The MathWorks, Inc. 1

A Seamless Tool Access Architecture from ESL to End Product

2015 The MathWorks, Inc. 1

Model-Based Design for Safety Critical Automotive Applications

Hardware-Software Co-Design and Prototyping on SoC FPGAs Puneet Kumar Prateek Sikka Application Engineering Team

Motor Control: Model-Based Design from Concept to Implementation on heterogeneous SoC FPGAs Alexander Schreiber, MathWorks

Accelerating FPGA/ASIC Design and Verification

Model-based Design/Simulation

Hardware and Software Co-Design for Motor Control Applications

Increasing Design Confidence Model and Code Verification

Static Analysis in C/C++ code with Polyspace

MathWorks Products and Prices North America January 2018

Modeling a 4G LTE System in MATLAB

Vision Toolbox for MATLAB

System Requirements & Platform Availability by Product for R2016b

Model-based Design/Simulation

Automating Best Practices to Improve Design Quality

Reducing the cost of FPGA/ASIC Verification with MATLAB and Simulink

Déploiement embarqué et connectivité hardware avec MATLAB et Simulink

Simulink for AUTOSAR: Best Practices

Implementing MATLAB Algorithms in FPGAs and ASICs By Alexander Schreiber Senior Application Engineer MathWorks

Verification, Validation, and Test with Model-Based Design

Automatic Code Generation Technology Adoption Lessons Learned from Commercial Vehicle Case Studies

Real-Time Testing in a Modern, Agile Development Workflow

Extending Model-Based Design for HW/SW Design and Verification in MPSoCs Jim Tung MathWorks Fellow

Master Class: Target Optimized Code Generation Shobhit Shanker Senior Application Engineer-Code Generation & Verification

Product Support. mathworks.com Release 14 Supported / Compatible Compilers for MATLAB 7.0

Verification, Validation and Test in Model Based Design Manohar Reddy

Design and Verification of FPGA Applications

Increasing Embedded Software Confidence Model and Code Verification. Daniel Martins Application Engineer MathWorks

Audio Signal Processing in MATLAB Youssef Abdelilah Senior Product Manager

개발과정에서의 MATLAB 과 C 의연동 ( 영상처리분야 )

Speeding up MATLAB Applications Sean de Wolski Application Engineer

Codegenerierung für Embedded Systeme leicht gemacht So geht s!

Moving MATLAB Algorithms into Complete Designs with Fixed-Point Simulation and Code Generation

90A John Muir Drive Buffalo, New York Tel: Fax:

What s New with the MATLAB and Simulink Product Families. Marta Wilczkowiak & Coorous Mohtadi Application Engineering Group

Deep learning in MATLAB From Concept to CUDA Code

Using HDL Coder for Complex Algorithm Deployment Steve Hamilton, James Hui & Ian Brown

Simulink to Embedded Hardware Paul Peeling MathWorks

Making the Most of your MATLAB Models to Improve Verification

MathWorks Products and Prices International September 2016

2015 The MathWorks, Inc. 1

Accelerate FPGA Prototyping with

Simulink Verification and Validation

Optimizing and Accelerating Your MATLAB Code

How Real-Time Testing Improves the Design of a PMSM Controller

Automated test of the AMG Speedshift DCT control software

The Use of Computing Clusters and Automatic Code Generation to Speed Up Simulation Tasks

Design and Verification of FPGA and ASIC Applications Graham Reith MathWorks

II. RTW BUILD METHODS In order to understand how RTW generates C code and produces an executable image, the build process can be divided into three st

Deploying Deep Learning Networks to Embedded GPUs and CPUs

R2017b Update 6 Release Notes

Real Time Testing of PMSM Controller using xpc Target Turnkey solution

REAL TIME OPERATING SYSTEM PROGRAMMING-I: VxWorks

Introduction to System Objects and System Toolboxes Tabrez Khan Application Engineer

Embarquez votre Intelligence Artificielle (IA) sur CPU, GPU et FPGA

Accelerating FASGW(H) / ANL Image Processing with Model-Based Design Issue 2

MathWorks Products and Prices Euro Academic September 2016

Integrating Mechanical Design and Multidomain Simulation with Simscape

Applications of Program analysis in Model-Based Design

Arm Architecture. Enrique Secanechia Santos, Kevin Mesolella

Guidelines for deployment of MathWorks R2010a toolset within a DO-178B-compliant process

Optimize DSP Designs and Code using Fixed-Point Designer

Automated Requirements-Based Testing

Transcription:

Better than Hand Generating Highly Optimized Code using Simulink and Embedded Coder Lars Krause Application Engineering 2015 The MathWorks, Inc. 1

Challenges Limited time and resources are common constraints for development projects Fit advanced algorithms into lowcost production hardware Limited ROM, RAM, stack, and speed Embedded device often not known during design Need optimal implementation Hand coding is process bottleneck Adds bugs, delays, iterations The advantages of Model-Based Design over hand-coding in C can t be overestimated. Kazuhiro Ichikawa, Ono Sokki Ono Sokki Reduces Development Time for Precision Automotive Speed Measurement Device 2

Solutions Techniques for accelerating the development process Optimization Techniques 1. Use optimal settings 2. Optimize data types 3. Target vector engines 4. Use hardware support packages 5. Reuse components 6. Reduce variables 7. Reduce logic 3

1. Use optimal settings Embedded Coder Quick Start Launch Quick Start Select Optimization Objectives Apply All Optimizations Prepare your model for production code generation Optimize generated code, independently of target Find optimal settings with the Quick Start Tool 4

2. Optimize data types Single Precision Converter Launch Single Precision Converter Auto-convert to single precision Generate code with less footprint Bring new algorithms from simulation to production Convert double-precision systems to single precision Save resources - Less memory footprint - Double precision not optimally supported in many targets 5

3. Target vector engines Replace time-consuming code with vector instructions Identify run-time bottlenecks Select code replacement Generate code for vector engines Optimize code for your target Generate highly optimized code using vector instruction sets Increase real-time execution efficiency 6

4. Target vector engines Execution times of a FIR filter - PIL benchmark results, ARM Cortex-A Instructions optimized 410,7 µs Embedded Coder ANSI-C Compiler optimization level 185,5 µs Embedded Coder ANSI-C & compiler optimized 16,8 µs 14,1 µs Embedded Coder NEON Embedded Coder NEON & compiler optimized Vector instructions have a significant impact on execution time This impact can exceed the impact of compiler optimization Run Format: [ANSI or Ne10], [gcc no opt or gcc -02], ARM 1Ghz Cortex A8 7

4. Use hardware support packages Download hardware support packages with the Add-On Explorer The MATLAB Add-On Explorer Fast code adaption to many targets - Model is the golden reference for code generation - Generated code is optimized for specific targets MathWorks package support: - ARM,..., Zynq Additional packages: - NXP, TI, Infineon, STMicroelectronics, 8

5. Reuse components Reuse with Simulink functions Reusable functions Reuse with Simulink functions Generate efficient code from Simulink functions Clear reusability structure Generate compact and efficient code Reusability is not obvious 9

6. Reduce variables New options for global RAM optimization 1) Pass scalar output as individual argument 2) Reuse input signals for output Reduced RAM usage - No additional variables needed for intermediate results in both cases 10

7. Reduce logic Enable component reuse with Simulink Clone Detection Launch Simulink Clone Detection View results Refactor your model Identify modeling clones Improve model componentization Enable Reuse: Replace clones with - Simulink functions or - library blocks 11

7. Reduce logic Polyspace Code Prover Launch Polyspace Code Prover Identify unreachable robustness code Remove unnecessary robustness code Analyze generated and hand written C/C++ source code without program execution Prove absence of runtime errors, e.g. overflow 12

Solution Summary Accelerating the software development process with automatic code generation Optimization Techniques 1. Use optimal settings 2. Optimize data types 3. Target vector engines 4. Use hardware support packages 5. Reuse components 6. Reduce variables 7. Reduce logic The code generated with Embedded Coder required about 16% less RAM than the handwritten code used on a previous version of the ECU; the code met all project requirements for efficiency and structure. Mario Wünsche, Daimler Daimler Designs Cruise Controller for Mercedes-Benz Trucks 13