Ingo Stürmer, Dietrich Travkin. Automated Transformation of MATLAB Simulink and Stateflow Models



Similar documents
Prüfung von Traceability Links -Workshop

SQMB '11 Automated Model Quality Rating of Embedded Systems

Using Model and Code Reviews in Model-based Development of ECU Software Mirko Conrad, Heiko Dörr, Ines Fey, Ingo Stürmer

Converting Models from Floating Point to Fixed Point for Production Code Generation

Product Information CANape Option Simulink XCP Server

Model-Based Development of Safety-Critical Software: Safe and Effi cient

AUTOSAR Seminar WS2008/ Assignment: Simulation of Automotive Systems in the Context of AUTOSAR

Software Production. Industrialized integration and validation of TargetLink models for series production

Introduction to MATLAB Gergely Somlay Application Engineer

Integrated Model-based Software Development and Testing with CSD and MTest

Model-based Testing of Automotive Systems

Software Development Principles Applied to Graphical Model Development

Simulink Modeling Guidelines for High-Integrity Systems

Power inverters: Efficient energy transformation through efficient TargetLink code

I can make just such ones if I had tools, and I could make tools if I had tools. -Eli Whitney

INTEGRATION OF THE CODE GENERATION APPROACH IN THE MODEL-BASED DEVELOPMENT PROCESS BY MEANS OF TOOL CERTIFICATION

Development of AUTOSAR Software Components within Model-Based Design

µfup: A Software Development Process for Embedded Systems

Making model-based development a reality: The development of NEC Electronics' automotive system development environment in conjunction with MATLAB

Overview of Existing Safeguarding Techniques for Automatically Generated Code

Reprint, also in extracts, without authorisation of the publisher forbidden.

Caterpillar Automatic Code Generation

Model Based System Engineering (MBSE) For Accelerating Software Development Cycle

Echtzeittesten mit MathWorks leicht gemacht Simulink Real-Time Tobias Kuschmider Applikationsingenieur

Integrating MATLAB into your C/C++ Product Development Workflow Andy Thé Product Marketing Image Processing Applications

Robot Control MRobot

Why Adopt Model-Based Design for Embedded Control Software Development?

Instrumentation-Based Verification for Medical-Device Software

idas Data Application and Documentation

Validating Diagnostics in Early Development Stages

Wiederverwendung von Testfällen bei der modellbasierten SW-Entwicklung

Verification and Validation According to ISO 26262: A Workflow to Facilitate the Development of High-Integrity Software

Proceedings of the 3 rd International Modelica Conference, Linköping, November 3-4, 2003, Peter Fritzson (editor)

Performance Study based on Matlab Modeling for Hybrid Electric Vehicles

Automatic ASAM MCD-3 supported test. PikeTec GmbH Dr. Jens Lüdemann

Development of Tool Extensions with MOFLON

Collaborating in California: Open HIL Test System Architecture uses the ASAM HIL API

Quality Assurance Methods for Model-based Development: A Survey and Assessment

GEDAE TM - A Graphical Programming and Autocode Generation Tool for Signal Processor Applications

Automotive Software Engineering

Dr.-Ing. Rainer Rasche dspace GmbH Rathenaustrasse Paderborn automotive testing expo June 22, 2010

EXAM FOR INFOTECH SOFTWARE ENGINEERING FOR REAL-TIME SYSTEMS. Suggested Solution WS 13/14. - Without Engagement -

Model-Based Development of Safety-Critical Systems

Best Practices for Verification, Validation, and Test in Model- Based Design

Introduction to Simulink & Stateflow. Coorous Mohtadi

Software House Embedded Systems

Mobia Modeler: An Adaptable Mobile Application Modeler for Non-Expert Users

MathWorks Automotive Conference 2015 Simon Fürst, 2015/09/24. MODEL-BASED SOFTWARE DEVELOPMENT: AN OEM S PERSPECTIVE.

Lecture 3 - Model-based Control Engineering

Software Module Test for an Electronic Steering Lock

Deployment of Model-based Software Development in Safety-related Applications: Challenges and Solutions Scenarios

MathWorks Products and Prices North America Academic March 2013

Efficient and Faster PLC Software Development Process for Automotive industry. Demetrio Cortese IVECO Embedded Software Design

Complexity Analysis of Simulink Models to improve the Quality of Outsourcing in an Automotive Company. Jeevan Prabhu August 2010

Model-Based Testing of Software Product Lines

MECE 102 Mechatronics Engineering Orientation

From Control Loops to Software

Part I. Introduction

Best practices for developing DO-178 compliant software using Model-Based Design

Development of a Continuous Process Test to Increase the Software Code Quality of a Engine Control System

Robotics and Automation Blueprint

OPC COMMUNICATION IN REAL TIME

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Demo: Real-time Tracking of Round Object

Challenges of Automation in Translation Quality Management

MODEL-BASED DEVELOPMENT OF AUTOMOTIVE EMBEDDED SOFTWARE IN COMPLIANCE WITH ISO 26262: CHALLENGES & EFFECTIVE SOLUTIONS 8 JUNE - 9 JUNE 2015

Multi-Konzeptionelle Verwendung von Low-Cost Hardware in der Lehre Dr.-Ing. Daniel Weida, MathWorks

Textual Modeling Languages

Model-Driven Software Development for Robotics: an overview

Quality Assurance of Models for Autocoding

Multi-domain Model-driven Development Developing Electrical Propulsion System at Volvo Cars

1. Enter Question Text directly into Bb Test Canvas. 2. Create test questions in Respondus and import into Bb

PRACTICAL EXPERIENCE IN USING CONTINUOUS INTEGRATION WITHIN THE DEVELOPMENT OF A NANOSATELLITE SOFTWARE

Product Development Flow Including Model- Based Design and System-Level Functional Verification

A Comprehensive Safety Engineering Approach for Software Intensive Systems based on STPA

Eli Levi Eli Levi holds B.Sc.EE from the Technion.Working as field application engineer for Systematics, Specializing in HDL design with MATLAB and

Automatic Generation of Consistency-Preserving Edit Operations for MDE Tools

WebSphere Business Modeler

A Model-based Methodology for Developing Secure VoIP Systems

An Overview of Hardware-In-the-Loop Testing Systems at Visteon

Control System Definition

Vehicle Off-Line GPS and Fuel Monitoring System (post trip vehicle monitoring system) Riga ; Latvia

Motorcycle application definition design

Advanced Electronic Platform Technologies Supporting Development of Complicated Vehicle Control Software

Application of UML in Real-Time Embedded Systems

EHOOKS Prototyping is Rapid Again

On Quantitative Software Quality Assurance Methodologies for Cardiac Pacemakers

Dials & Gauges Blockset

EBERSPÄCHER ELECTRONICS automotive bus systems. solutions for network analysis

Real Time Simulation for Off-Road Vehicle Analysis. Dr. Pasi Korkealaakso Mevea Ltd., May 2015

Dr. Ulrich Lauff, Dr. Kai Pinnow, and Dipl.-Ing. Florian Schmid. New Tools and Methods for Validation and Calibration

ADI Simulation Systems Help Speed Aircraft Development from Preliminary Design through Certification

Schnell und effizient durch Automatische Codegenerierung

SignalDraw: GUI Tool For Generating Pulse Sequences

Ryan F. Schkoda, Ph.D. Postdoctoral Fellow Wind Turbine Drivetrain Testing Facility Charleston, SC

Product Information Services for Embedded Software

Where Smart Data meets Data Security Siemens Cloud for Industry powered by SAP HANA. April 2015

TESSY Automated dynamic module/unit and. CTE Classification Tree Editor. integration testing of embedded applications. for test case specifications

Measuring, Controlling and Regulating with labworldsoft

Dynamic Process Modeling. Process Dynamics and Control

Transcription:

Ingo Stürmer, Dietrich Travkin Automated Transformation of MATLAB Simulink and Stateflow Models Ingo Stürmer Model Engineering Solutions Dietrich Travkin University of Paderborn Object-oriented Modeling of Embedded Real-Time Systems (OMER4) Paderborn, 31 October 2007 Presentation Outline 2 Motivation Modeling Guidelines MATE Model Transformation (Demo) Model analysis and repair Layout improvements Design pattern instantiation Conclusions

Motivation: Model-based Development 3 The way in which automotive embedded software is developed has undergone a change Shift from traditional programming to model-based development Use of MATLAB Simulink & Stateflow and TargetLink or RTW/EC (Some) significant advantages of model-based development Early testing Model-based code generation Software quality now strongly dependent on models used for software specification, simulation, and code generation Example: Why do we need Modeling Guidelines? 4 Crossed signal lines 1 throttle throttle (estimated) 2 speed speed (estimated) 0.01-0.01z -1 1-0.8z -1 Throttle transient correction Fixed-point product block with more than two operands 1 est_air_flow est. air flow. 3 EGO EGO (estimated) 4 MAP MAP (estimated) Pumping Constant Constant 0.5 FUNCTION Function Description of signal flow from left to right violated e1 Magical constant Hidden inport 6 mode 0.5 fuel_mode LOW <= e0 e0 EGO GT Threshold 5 fail_o2. fail_o2 NOR enable integration ~= not normal operation not normal operation enable integration Name of constant partially obscured hold integrator 0 czero T 2 z-1 feedback_correction feedback Discrete-Time correction. Integrator Signal name obscured

Example: Why do we need Modeling Guidelines? 5 FUNCTION Intake Airflow Estimation and Closed-Loop Correction Function 1 throttle throttle_ 0.01-0.01z -1 1-0.8z -1 Throttle transient speed correction est_air_flow_ 1 est_air_flow 2 speed speed_ speed DISP PC sum est_air_flow 3 MAP MAP MAP_ Pumping Constant CAL MAP DISP MAP x PC MAP x PC x speed Feedforward Control 4 EGO EGO_ Ramp Rate (Ki) 0.5 CAL CONST e1 0.5 <= e0 e0 e1 T z-1 feedback_correction_ 2 feedback_correction 5 fail_o2 6 fuel_mode Oxygen Sensor Switching Threshold CAL fail_o2_ fuel_mode_ EGO GT Threshold ~= not normal operation NOR enable integration 0 czero CONST hold integrator LOW not normal operation enable integration disablemode CONST Feedback Control Conclusion 6 What are the consequences of poor modeling? A model that is difficult to read/understand A model with only limited migration options A model that is hard to maintain Unsafe/faulty code Adoption of modeling guidelines can significantly increase the quality of the model (i.e. software) and result in: Fewer errors Greater comprehensibility (readability) Maintainability, testing, reuse, and expandability

Model-based Development: Challenges 7 The increasing complexity of electronic systems and vehicle software is reflected in the increasing complexity of models Modeling tools offer limited mechanisms to handle this complexity and support the developer This is particularly evident in the fact that: Support in checking and correcting models in respect to modeling guidelines is not yet sufficiently automated Presentation Outline 8 Motivation Modeling Guidelines MATE Model Transformation (Demo) Model analysis and repair Layout improvements Design pattern instantiation Conclusions

Daimler Modeling Guidelines 9 A collection of best practices/expert know-how: Autocode review Model-based testing Design of TargetLink MATLAB Simulink & Stateflow and TargetLink models e.g. for passenger car and truck divisions Currently over 200 guidelines and patterns for MATLAB Simulink & Stateflow and TargetLink models alone Central administration and publication on public-access e-guidelines Server http://www.e-guidelines.de Verifying Modeling Guidelines with Checks 10 90; 4% Manual change necessary Experience: Checking a complex MATLAB Simulink & Stateflow model (~20000 blocks) with model checks Nearly 2000 Guideline violations detected Unsettled 170; 8% Unmittelbare Reparatur Reparatur mit User-Feedback Manuelle Änderung notwendig ungeklärt Finding: ~90% of all guideline violations can be repaired with (interactive) transformations 900; 45% Direct (automatic) repair 870; 43% Repair with user feedback Tool Support needed for Model Analysis and Repair

Presentation Outline 11 Motivation Modeling Guidelines MATE Model Transformation (Demo) Model analysis and repair Layout improvements Design pattern instantiation Conclusions MATE Project Partners 12 MATE: MATLAB Simulink and Stateflow Analysis and Transformation Environment: (Dr. Ingo Stürmer) Software Engineering Group (Prof. Wilhelm Schäfer) Real-Time Systems Lab (Prof. Andy Schürr) University of Kassel (Prof. Albert Zündorf) MATE University of Siegen (Prof. Udo Kelter)

MATE Main Features 13 Model analysis Find guideline violations Complex analyses, e.g. data-flow analysis Model Transformation Model repair operations (automatic / interactive) Design pattern instantiation Model polishing (e.g. layout improvements) Analysis Repair MATE Approach: Graph Transformations 14 Apply graph transformations Graph representation of the model needed Graph representation of the model in focus Concrete Syntax......... outports :OutPort block source :ProductBlock name = Product1 line line :Line :ConstantBlock line :Line name = Constant3 type = int16 line value = 4 block source :OutPort outports inports target :InPort no = 1 block :ProductBlock block name = Product2 block target :InPort no = 2 inports Abstract Syntax (Graph) outports :OutPort...

MATE Approach: Graph Transformations 15 Abstract Syntax Graph Pattern Specification Specification of Graph Transformations Generated Model Analysis and Transformation Code Presentation Outline 16 Motivation Modeling Guidelines MATE Model Transformation (Demo) Model analysis and repair Layout improvements Design pattern instantiation Conclusions

MATE Features NOT shown during the demo 17 Automatic generation of model checks and transformations Model difference calculation Calculation of model metrics Offline (Batch) transformations Report generation Conclusions 18 Modeling guidelines are an important and appropriate means of guaranteeing the quality of both model and generated code The high number of rules that must be verified makes manual checking (of guideline compliancy) a timeconsuming and error-prone process Even when employing a static analysis tool, the modeler must still review the model High-level checks with graph transformations make model analyses easier, that were difficult and laborious to realize with previous means (e.g. m-scripts)

Contact 19 Model Engineering Solutions Dr.-Ing. Ingo Stürmer Friedrichstraße 50 10117 Berlin Germany Tel +49(0)30 20659-173 Fax +49 (0)30 20659-200 E-mail: stuermer@model-engineers.com Internet: http://www.model-engineers.com Backup Slides 20

MATE Tool-Architecture Calculation of Model Differences Model 1 Model 2

Data-flow Analysis X= A x ((C-B)-(A-B)) A B B Data type: sfix(16) Scaling: 2^(-11) X Data ty pe:sf ix(16) Scaling: 2^(-11) X C B MATE X outputerror_max = 2.44140625E-4 Data type: sfix(16) Scaling: 2^(-11) Data type: sfix(16) Scaling: 2^(-11) output_min = -5.499437180625 output_max = -5.498948899375 D B Data type: sfix(16) Scaling: 2^(-11) 2 Data type: sfix(16) Scaling: 2^(-11) Data type:sfix(32) Scaling: 2^(-16) Y E Data type: sfix(32) Scaling: 2^(-16) Y Data ty pe:sf ix(16) Scaling: 2^(-9) MATE Y Data ty pe:sf ix(32) outputerror_max = 0.0011238956451416016 Scaling: 2^(-16) 2 Data ty pe:sf ix(16) Scaling: 2^(-10) output_min = 2.049329624296875 output_max = 2.0502628157031255 F Data ty pe:sf ix(16) Scaling: 2^(-9) M-Script Implementation of Rule tl_0009

Example of a Modeling Guideline: tl_0009 25 Limitations with Regard to Operand Numbers for the Product Block Description If a fixed-point data type is specified for the output of the Product block, the number of inputs must not exceed two. If a vector signal is fed into a Product block, the number of elements of the vector must not exceed two. Remark The generation of proper fixed-point code for the Product block with more than two operands requires the specification of scaling information for intermediate results. TargetLink therefore requires the number of input variables not to exceed two for fixed-point data types. Example of a Modeling Guideline (cont.)

Flowchart Design Pattern: if-then-else if (condition1) { action1; } else if (condition2) action2; } else if (condition3) action3; } else { action4; } Design pattern Pseudo code