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

Similar documents
Production Code Generation and Verification for Industry Standards Sang-Ho Yoon Senior Application Engineer

Implementation and Verification Daniel MARTINS Application Engineer MathWorks

Using Model-Based Design in conformance with safety standards

Standardkonforme Absicherung mit Model-Based Design

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

From Design to Production

Generating Industry Standards Production C Code Using Embedded Coder

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

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

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

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

Increasing Design Confidence Model and Code Verification

Model-Based Design for Safety Critical Automotive Applications

Testing, Validating, and Verifying with Model-Based Design Phil Rottier

DRYING CONTROL LOGIC DEVELOPMENT USING MODEL BASED DESIGN

Verification and Validation of High-Integrity Systems

Automating Best Practices to Improve Design Quality

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

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

What s New In Simulink: Fraser Macmillen

Simulink for AUTOSAR: Best Practices

Verification, Validation and Test in Model Based Design Manohar Reddy

Simulink as Your Enterprise Simulation Platform

Automating Best Practices to Improve Design Quality

A Model-Based Reference Workflow for the Development of Safety-Related Software

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

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

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

What s New in MATLAB and Simulink

GAIO. Solution. Corporate Profile / Product Catalog. Contact Information

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

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

Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer

AVS: A Test Suite for Automatically Generated Code

Testing Framework with Simulink Test

Formal Verification of Models and Code Prashant Mathapati Application Engineer Polyspace & Model Verification

2015 The MathWorks, Inc. 1

IBM Rational Rhapsody. IBM Rational Rhapsody Kit for ISO 26262, IEC 61508, IEC and EN Overview. Version 1.9

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

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

Optimize DSP Designs and Code using Fixed-Point Designer

Ein Modell - viele Zielsysteme

What s New in Simulink in R2015b and R2016a

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

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

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

Reuse MATLAB Functions and Simulink Models in UVM Environments with Automatic SystemVerilog DPI Component Generation

SCADE. SCADE Suite Tailored for Critical Applications EMBEDDED SOFTWARE

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

Hardware and Software Co-Design for Motor Control Applications

What s New in MATLAB and Simulink

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

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

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

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

Testing Simulink Models

Addressing Fixed Point Design Challenges

Verification, Validation, and Test with Model-Based Design

Automated Requirements-Based Testing

Verification and Validation Introducing Simulink Design Verifier

Architecture-driven development of Climate Control Software LMS Imagine.Lab Embedded Software Designer Siemens DF PL

What s New in MATLAB and Simulink The MathWorks, Inc. 1

Jay Abraham 1 MathWorks, Natick, MA, 01760

Model-Based Design for Altera FPGAs Using HDL Code Generation The MathWorks, Inc. 1

What's new in MATLAB and Simulink for Model-Based Design

MathWorks Products and Prices North America January 2018

Simulink to Embedded Hardware Paul Peeling MathWorks

Hardware Implementation and Verification by Model-Based Design Workflow - Communication Models to FPGA-based Radio

2015 The MathWorks, Inc. 1

Introduction to C and HDL Code Generation from MATLAB

Effective Verification Strategies for Distributed Body Control Applications based on Plant Modeling and Test Case Reuse

MathWorks Products and Prices International September 2016

What s New in MATLAB and Simulink

Don t Be the Developer Whose Rocket Crashes on Lift off LDRA Ltd

Guido Sandmann MathWorks GmbH. Michael Seibt Mentor Graphics GmbH ABSTRACT INTRODUCTION - WORKFLOW OVERVIEW

Designing and Analysing Power Electronics Systems Using Simscape and SimPowerSystems

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

Workpackage WP2.5 Platform System Architecture. Frank Badstübner Ralf Ködel Wilhelm Maurer Martin Kunert F. Giesemann, G. Paya Vaya, H.

Team-Based Collaboration in Simulink Chris Fillyaw Application Engineer Detroit, MI

Embedded Coder Getting Started Guide. R2011b

Simulator in the-loop Environment for Autocode Verification

Introducing Simulink R2012b for Signal Processing & Communications Graham Reith Senior Team Leader, UK Application Engineering

Verification and Test with Model-Based Design

By V-cubed Solutions, Inc. Page1. All rights reserved by V-cubed Solutions, Inc.

Certified Automotive Software Tester Sample Exam Paper Syllabus Version 2.0

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

System Requirements & Platform Availability by Product for R2016b

ConfigurationDesk/RTI. Compatibility with Toolboxes and Blocksets Provided by MathWorks

Model-based Design/Simulation

What s New in Simulink Release R2016a and R2016b

Design and Verification of FPGA Applications

IN VEHICLE NETWORKING & DIAGNOSTICS WITH MODEL BASED DEVELOPMENT APPROACH C OMPA N Y: H A R MAN INTERNATIONAL INDIA. C ONTA C T: PH

What s New in MATLAB and Simulink Young Joon Lee Principal Application Engineer

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

Automatic Code Generation at Northrop Grumman

2015 The MathWorks, Inc. 1

MathWorks Products and Prices North America September 2016

Formal Verification of Flight Control Applications along a Model- Based Development Process A Case Study

Motor Control with Embedded Coder and TI C2000

Introducing Simulink Release 2012b for Control System Development Mark Walker MathWorks

Transcription:

Simulink 를이용한 효율적인레거시코드 검증방안 류성연 2015 The MathWorks, Inc. 1

Agenda Overview to V&V in Model-Based Design Legacy code integration using Simulink Workflow for legacy code verification 2

Model-Based Design With Legacy C/C++ Code? Hand Coding Full MBD 3

Why Using Simulink for Legacy Code Testing? Display Input Algorithm Simulink Vehicle Dynamics Blockset(R2018a) Simulink Stateflow MATLAB Function C/C++ 4

ISO26262 Road Vehicles - Functional Safety Functional safety standard for passenger cars Concerned with avoidance of unreasonable risks due to hazards caused by E/E systems Recommends tool certification, but offers little guidance Serves as an umbrella standard for industry specific adaptions including: ISO 26262 - Automotive EN 50128 - Rail IEC 62304 - Medical IEC 61511 - Process Control 5

Software Development Workflow for Embedded Applications Textual Requirements Executable Specification Model used for production code generation Generated C/C++ code Object code Requirements Authoring Modelling Code Generation Compilation and Linking Software architecture and design Handwritten C/C++ code Requirements Trace Documentation Version Control Tool Qualification 6

Legacy Code Verification Overview For Model-Based Design Textual Requirements Executable Specification Model used for production code generation Generated C/C++ code Object code Requirements Authoring Modelling Code Generation Compilation and Linking Unit(/Integration) testing Software architecture and unit design Coverage analysis / Test case generation Code review and Static analysis S-functions from Handed C/C++ code For legacy code development 7

Agenda Overview to V&V in Model-Based Design Legacy code integration using Simulink Workflow for legacy code verification 8

How to Import Legacy Code Legacy Code Tool C Caller Block Legacy code integration in Stateflow 9

What legacy C code integration in Simulink means? Legacy Code Tool enables existing C code to be used in Simulink models External C Functions Generating S-function 10

How to use Legacy Code Tool? General procedure for using Legacy Code Tool Modeling with S-Function S-function block 11

Prerequisite to use Legacy Code Tool What is wrapper code? Root-level C function having in/output variables for S-Function block s in/out ports double doubleit(double u1) { MainInp = u1; Wrapper code or void doubleit(double u1, double *y1) { MainInp = u1; double_main(); Main function of legacy code double_main(); } y1 = MainOutp; return y1; } *y1 = MainOutp; 12

MATLAB Script to Build and Generate S-Function Block m-script file: compiling C files and generate a S-Function Block Simulink.importExternalCTypes('ex_myTypes_LCT.h'); def = legacy_code('initialize'); def.sfunctionname = 'sfun_ex_mysrc_lct'; def.sourcefiles = {'ex_mysrc_lct.c'}; def.headerfiles = {'ex_mytypes_lct.h'}; def.outputfcnspec = 'void myfcn(sigstructtype u1[1], paramstructtype p1[1], sigstructtype y1[1])'; def.incpaths = {'rtwdemo_lct_src'}; def.srcpaths = {'rtwdemo_lct_src'}; 1 C files to integrate in Simulink 3 Include folders 2 S-Function block specification legacy_code('sfcn_cmex_generate', def); legacy_code('compile', def); 4 Compile and s-function generation legacy_code( slblock_generate', def); https://www.mathworks.com/help/releases/r2018a/simulink/sfg/integrating-existing-c-functions-into-simulink-models-with-the-legacy-code-tool.html?s_tid=doc_srchtitle 13

Generate Simulink Representations from C or C++ Code Import external C header file and generate available Simulink data types Simulink.importExternalCTypes('ex_myTypes_LCT.h ); Automatically generating to Simulink Bus Selecting generated Simulink Bus 14

Issues for Legacy Code Tool There are still technical challenges to make S-Function Block Conventional C code verification Difficult to build test cases Limited input variation Long lead time from development to test Hard work to improve test results Legacy Code Tool C code verification with Simulink No unified interfaces to interact with legacy code Hard to build S-Function Block No auto sync with custom C code change Still maintenance problem 15

Example Issue: Too Many Function Arguments Legacy code Wrapper code - Too many interface variables - Nested structure - Bitfield - etc. Script file 16

Maintenance Problem Legacy code Wrapper code Modeling Script file 17

Introducing C Caller Block C Caller Block makes it easier to call C Functions in Simulink It works for simulation and Code Generation 18

Key Features Automate the process Define Block Interface Build Simulation MEX Write Codegen TLC Tedious Error prone Hard to maintain Automate Synchronize with custom code changes types * functions* globals C/C++ Code 19

Using C Caller Block 1. Specify Custom Code in the Configuration Parameters Custom code is specified on the Configuration Parameters. The Header file section: Any code that needs to be inserted into the header file The Source files section: List of source files that needs to be compiled include custom header file add custom source file 20

Using C Caller Block 2. Select the function that you want to call 21

Using C Caller Block 3. Customize the function that you want to call Mapping inputs, outputs or parameters to C Caller Block 1) Change argument scope to Output 2) (Optional) Override with a better output name 3) Complete the test model with connecting signal ports 22

Demo: Simple C Caller 23

Library Workflow C Caller block can be configured as a library model Custom Code Settings can be accessed from View Menu Library Custom Code Settings include custom header file add custom source file 24

Demo: Reusable Library Workflow with OpenCV 26

Legacy Code Evaluation in Stateflow Using legacy code in Stateflow chart Step 1: Have C code Step 2: Put on Config. Set Step 3: Use in Stateflow 27

Agenda Overview to V&V in Model-Based Design Legacy code integration using Simulink Workflow for legacy code verification 28

Legacy Code Verification using Simulink V&V Test Cases Test harness model S-Function or C Caller Test case generation Code coverage analysis 29

Demo: Legacy C Code Verification 30

Needs for Test Automation Test automation/management Code coverage analysis Function/Function call coverage Report generation Test harness model 31

Test Automation with Test Manager Test automation Test case creation from template Customization View, share, report results 32

Static Code Analysis Run time error / MISRA rule check Polyspace report from Simulink Reducing Polyspace set-up efforts 33

Key Takeaways Textual Requirements Executable Specification Model used for production code generation Generated C/C++ code Object code Requirements Authoring SL Requirement Modelling Unit(/Integration) testing Simulink Requirement Simulink Test Software architecture and unit design Simulink Code Generation Polyspace Coverage analysis / Test case generation Review and Static analysis C Caller for legacy code Simulink Design Verifier Compilation and Linking Simulink Simulink Coder Embedded Coder Simulink Coverage 34

Thank You! 36