Innovate with confidence – Functional Verification of Embedded Algorithms

27
1 © 2011 The MathWorks, Inc. Innovate with confidence – Functional Verification of Embedded Algorithms Dr. Joachim Schlosser Senior Team Leader Application Engineering MathWorks

description

For development of embedded systems Simulink and Stateflow are already widely used to simulate the system behavior. The graphical user interface allows quick and clear modeling of the system’s dynamics and structure. Since the models already represent a detailed mathematical description of the system, the way to automatically generate code is only the next logical step. This presentation provides an overview of the verification in Simulink and Stateflow. The methods range from the automatic review of modeling guidelines and the use of bidirectional links between requirements and model on the testing and measuring the achieved test coverage up to the use of formal methods to support test generation and correctness proof of a model. Optionally, the benefits of Stateflow modeling, variant handling on model and code level can be discussed.

Transcript of Innovate with confidence – Functional Verification of Embedded Algorithms

Page 1: Innovate with confidence – Functional Verification of Embedded Algorithms

1© 2011 The MathWorks, Inc.

Innovate with confidence – Functional Verification of Embedded Algorithms

Dr. Joachim SchlosserSenior Team Leader Application EngineeringMathWorks

Page 2: Innovate with confidence – Functional Verification of Embedded Algorithms

2© 2011 The MathWorks, Inc.

Innovation aber sicher – Funktionale Verifikation von Algorithmen in Embedded Systems

Dr. Joachim SchlosserSenior Team Leader Application EngineeringMathWorks

Page 3: Innovate with confidence – Functional Verification of Embedded Algorithms

3

Innovation aber sicher – Funktionale Verifikation von Algorithmen in Embedded SystemsZusammenfassung

Bei der Entwicklung von Embedded Systemen werden bereits vielfach Simulink und Stateflow zur Simulation des Systemverhaltens eingesetzt. Die grafische Bedienoberfläche erlaubt hierbei die schnelle und übersichtliche Modellierung des Systems. Da mit der Modellierung bereits eine detaillierte mathematische Beschreibung des Systems vorliegt, ist der Weg zum automatisch erzeugten Code nur der nächste logische Schritt.

Mit diesem Vortrag erhalten Sie einen Überblick über die Verifikation der Modellierung in Simulink und Stateflow. Das Methodenspektrum reicht dabei von der automatischen Überprüfung von Modellierungsrichtlinien und der Verwendung bidirektionaler Verknüpfungen zwischen Anforderungen und Modell über die Durchführung von Tests und der Messung der erzielten Testabdeckung bis hin zum Einsatz formaler Methoden zur unterstützenden Testgenerierung und dem Korrektheitsbeweis eines Modells.

Optional wird auf die Vorteile der Stateflow-Modellierung, Varianten-Handling auf Modell- und Code-Ebene eingegangen.

Page 4: Innovate with confidence – Functional Verification of Embedded Algorithms

4

Innovate with confidence – Functional Verification of Embedded AlgorithmsAbstract

For development of embedded systems Simulink and Stateflow are already widely used to simulate the system behavior. The graphical user interface allows quick and clear modeling of the system’s dynamics and structure. Since the models already represent a detailed mathematical description of the system, the way to automatically generate code is only the next logical step.

This presentation provides an overview of the verification in Simulink and Stateflow. The methods range from the automatic review of modeling guidelines and the use of bidirectional links between requirements and model on the testing and measuring the achieved test coverage up to the use of formal methods to support test generation and correctness proof of a model.

Optionally, the benefits of Stateflow modeling, variant handling on model and code level can be discussed.

Page 5: Innovate with confidence – Functional Verification of Embedded Algorithms

5

Page 6: Innovate with confidence – Functional Verification of Embedded Algorithms

6

Detect System Integration Issues In Simulation

Model:

Actuator(Ideal)Inputs System

(Include)

Actuator(Realistic)

System(Ignore)

Mechanical

Hydraulic

Electrical

Controls

Park

SpinSupervisory

Logic

LiftDrag

Wind

Aero-dynamics

Page 7: Innovate with confidence – Functional Verification of Embedded Algorithms

7

“Accurate modeling is essential not only for planning investments but also to detect situations that can cause an outage. With MathWorks tools, we can simulate power electronics, mechanics, and control systems in one environment, and our models respond like the turbines we have in the field.”

Richard GagnonHydro-Québec

Link to user storyTurbines on a wind farm

Page 8: Innovate with confidence – Functional Verification of Embedded Algorithms

8

INTEGRATION

IMPLEMENTATION

Model-Based Design – Early Verification

DESIGN

TEST & VER

IFICATIO

N

RESEARCH REQUIREMENTS

MCU DSP FPGA ASIC

Structured TextVHDL, VerilogC, C++

Environment Models

Physical Components

Algorithms

TEST SYSTEM

PLC

Page 9: Innovate with confidence – Functional Verification of Embedded Algorithms

10

Page 10: Innovate with confidence – Functional Verification of Embedded Algorithms

11

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Code

Model

Model-Based Design – Early Verification

Page 11: Innovate with confidence – Functional Verification of Embedded Algorithms

12

“Polyspace enabled us to dramatically reduce our workload per analysis — from several man-months to a matter of days.”

Svetoslav StoyanovELESYS North America

Airbag deployment during a frontal crash test

Link to user story

Page 12: Innovate with confidence – Functional Verification of Embedded Algorithms

13

Page 13: Innovate with confidence – Functional Verification of Embedded Algorithms

14

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Code

Model

Model-Based Design – Early Verification

Page 14: Innovate with confidence – Functional Verification of Embedded Algorithms

15

“When Alstom delivered a Pendolino train to Czech Railways, the railway application was the first with automatically generated code to receive TÜV certification.”

Han GeerligsAlstom

Pendolino tilting train, w/ Safety-Critical Power Converter Control System

Link to user story

Page 15: Innovate with confidence – Functional Verification of Embedded Algorithms

16

Page 16: Innovate with confidence – Functional Verification of Embedded Algorithms

17

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Code

Model

Model-Based Design – Early Verification

Page 17: Innovate with confidence – Functional Verification of Embedded Algorithms

18

“Developing an HVAC system as complex as ours by hand-coding in C would not be possible. Model-Based Design not only made development possible, it also made it faster while enabling us to verify and test months earlier than we could before.”

Johan HägnanderGM Engineering Europe

Link to user story

One of 54 types of GM vehicle dashboard with the HVAC control system installed

Page 18: Innovate with confidence – Functional Verification of Embedded Algorithms

19

Page 19: Innovate with confidence – Functional Verification of Embedded Algorithms

20

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Code

Model

Model-Based Design – Early Verification

Page 20: Innovate with confidence – Functional Verification of Embedded Algorithms

21

“Everyone knows that errors are much less expensive to fix when you find them early. With Simulink Design Verifier, we build on the advantages of Model-Based Design by performing formal testing in the first phases of development.”

Christoph HellwigTRW

TRW Electric Parking BreakLink to user story

Page 21: Innovate with confidence – Functional Verification of Embedded Algorithms

22

Start really using Simulink now! Browse mathworks.com/model-based-design/

Reach me at @schlosi

And a final one:live now!

Page 22: Innovate with confidence – Functional Verification of Embedded Algorithms

23

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Code

Model

Model-Based Design – Early Verification

Page 23: Innovate with confidence – Functional Verification of Embedded Algorithms

24

Backup / References

Page 24: Innovate with confidence – Functional Verification of Embedded Algorithms

25

Alstom Generates Production Code for Safety-Critical Power Converter Control Systems

ChallengeDesign and implement real-time power conversion and control systems for trams, metros, and railways

SolutionUse MathWorks tools for Model-Based Design to design, simulate, and automatically generate production code for safety-critical transportation systems

Results Development time cut by 50% Defect-free, safety-critical code generated and certified Common language established

“When Alstom delivered a Pendolino train to Czech Railways, the railway application was the first with automatically generated code to receive TUV certification.”

Han GeerligsAlstom

Pendolino tilting train.

Link to user story

Page 25: Innovate with confidence – Functional Verification of Embedded Algorithms

26

GM Engineering Europe Develops HVAC Controller for GM Vehicles Using Model-Based Design

ChallengeDesign an advanced HVAC embedded controller for GM vehicles worldwide

SolutionUse MathWorks tools and Model-Based Design to develop and implement a real-time controller with reusable components

Results System models reused across 54 vehicles Quality improved through early verification Team communication improved

“Developing an HVAC system as complex as ours by hand-coding in C would not be possible. Model-Based Design not only made development possible, it also made it faster while enabling us to verify and test months earlier than we could before."

Johan HägnanderGM Engineering Europe

Link to user story

GM vehicle dashboard with the HVAC control system installed.

Page 26: Innovate with confidence – Functional Verification of Embedded Algorithms

27

ELESYS North America Speeds Verification of Safety-Critical Embedded Software with Polyspace Products for C/C++

ChallengeAccelerate the verification of airbag suppression systems

SolutionUse Polyspace to detect run-time errors in safety-critical embedded software

Results Verification in days, not months Hard-to-find bugs located Testing efficiency increased

"Polyspace enabled us to dramatically reduce our workload per analysis — from several man-months to a matter of days."

Svetoslav StoyanovELESYS North America

Airbag deployment during a frontal crash test.

Link to user story

Page 27: Innovate with confidence – Functional Verification of Embedded Algorithms

28

TRW Automotive Develops and TestsElectric Parking Brake Using Simulinkand Simulink Design Verifier

ChallengeDesign tests for an electric parking brake control system

SolutionUse Simulink Design Verifier to automatically generate tests that maximize model coverage and enable systematic design verification

Results Test development time reduced from days to hours 100 percent model coverage achieved Formal testing begun two months into the project

“Everyone knows that errors are much less expensive to fix when you find them early. With Simulink Design Verifier, we build on the advantages of Model-Based Design by performing formal testing in the first phases of development."

Christoph HellwigTRW

Link to user story

Electronic parking brake control system.