From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any...

Preview:

Citation preview

1© 2014 The MathWorks, Inc.

From Design to Production

An integrated approach

Paolo Fabbri

Senior Engineer

2

Do you know what it is?

Integration Test

System TestRequirements

Unit Test

Functional Spec

Detailed Design

Implementation

3

Is the industry still using this approach

for Embedded Software Development?

4

Integration Test

System TestRequirements

Unit Test

Functional Spec

Detailed Design

Implementation

For Sure! But it’s more about Modeling and Simulation

HIL Simulation

Code V&V

Model Design

Model V&V

Code

Generation

5

0 10 20 30 40 50 6060

62

64

66

68

70

72

74

X: 10.9

Y: 71.1

Time

m/h

Speed limiter

Actual speed

Setpoint

Case Study: Vehicle Speed Limiter

HIL Simulation

System TestRequirements

Code V&V

Model Design

Model V&V

Code

Generation

6

Project Management in Simulink

7

Simulink ProjectCollaborative development

Source Control Integration

Support for svn and git

Model compare/merge

Data compare/merge

Files Management

Dependencies Analysis

Impact Analysis

8

Source Control Integration

9

Model Comparison

10

Data Dictionary Comparison

11

Dependency and Impact Analysis

12

Manage Complexity in Simulink

13

Typical challenges with large projects

Reuse models among different teams and projects

Manage multiple design options in a single-model workflow

Share models outside the team protecting IP

Ensure proper modeling rules and configuration

Ensure data consistency across models

...What else?

14

Component-Based ModelingReuse models among different teams and projects

Control

Designer

Control

Designer

Modular Architecture

Reusable Models

Variants Management

IP Protection

Plant

Expert

15

Model and Subsystem Variants

16

Protected Models for IP Protection

Read-Only View Support

Simulation Support

Code Generation Support

17

Model Advisor TechnologyEnsure proper modeling rules and configuration

Modeling Standards

MISRA-C:2004

MAAB Style Guidelines

IEC-61508/ISO-26262

EN-50128

DO-178C/DO-331

Specialized Advisor

Upgrade Advisor

Performance Advisor

Code Generation Advisor

18

Simulink Data DictionaryEnsure data consistency across models

Design Data

Configuration Sets

Change tracking

Data partitioning

Scalability and performance

Simulink Projects Integration

19

Simulink Data Management System

Define

Store

Partition

Access

Manage

Collaborate

101010

Simulink Data Objects

Simulink Data Dictionary

Model Explorer

Simulink Project

101010

+

+

20

Model Verification and Validation

21

Early Model Verification and ValidationSimulation, simulation, simulation...

Simulation Data Inspection

Simulation Comparison

Coverage AnalysisHIL Simulation

System TestRequirements

Code V&V

Model Design

Model V&V

Code

Generation

22

Analyze Simulation Data with Simulation Data Inspector

23

Simulation Comparison

24

Model Coverage Analysis

25

Embedded Code

Generation and Verification

26

Embedded Code Generation

Unified Code Generation

Objective-Based Workflow

Code Report and Code MetricsHIL Simulation

System TestRequirements

Code V&V

Model Design

Model V&V

Code

Generation

27

Unified Code

Generation

C++ Code

HDL Code

C Code

Stateflow

Simulink

MATLAB

PLC Code

Unified Code Generation Capabilities

28

Algorithm Export

A B C

M

I N P U T

B L U E G R E E N R E D

P O W E R

RGBSplit-4BLACK BOX

V R C S

Communication

Interfaces

Sensors

Actuators

Special

Interfaces

Controller

Model

Comm

DriversOutput

Drivers

Input

Drivers

Special

Device

Drivers

Generated

Algorithm

Code

Scheduler/Operating System

and Support Utilities

Included

Legacy

Code

Included

Target Optimized

Code

29

Full Executable

A B C

M

I N P U T

B L U E G R E E N R E D

P O W E R

RGBSplit-4BLACK BOX

V R C S

Communication

Interfaces

Sensors

Actuators

Special

Interfaces

Controller Model

Driver Blocks

Scheduler

Comm

DriversOutput

Drivers

Input

Drivers

Special

Device

Drivers

Generated

Algorithm

Code

Scheduler/Operating System

and Support Utilities

Included

Legacy

Code

Included

Target Optimized

Code

30

Code Integration Approaches

Algorithm Export Full Executable

Purpose Mass ProductionOn-Target Rapid Prototyping

Low Volume Production

Usage Systems and software engineers Systems engineers

Hardware Any processor Specific Hardware Kits or Boards

Flexibility Higher Lower

Ease of Use

(Turnkey)Works after one-time customization Works out-of-the-box

31

Objective-Based Code Generation

32

Code Report and Code Metrics

33

Embedded C Code Verification

“In-the-Loop” Simulations

Code Execution Profiling

Source Level Debugging

Code Coverage Analysis

Run-Time Error Detection

HIL Simulation

System TestRequirements

Code V&V

Model Design

Model V&V

Code

Generation

34

«In-the-Loop» Simulations

35

MIL/SIL/PIL Simulation Comparison

36

Code Execution Profiling

37

Source Level Debugging in SIL

38

Code Coverage Analysis

39

Polyspace Technology

Finds bugs

Checks coding rule conformance (MISRA/JSF/Custom)

Provides metrics (Cyclomatic complexity etc)

Proves the existence and absence of run-time errors

Certification help for Functional Safety standards

40

Run-time checks proven by Code Prover

C run-time checks

Unreachable Code

Out of Bounds Array Index

Division by Zero

Non-Initialized Variable

Scalar and Float Overflow (left shift on signed variables, float underflow versus

values near zero)

Initialized Return Value

Shift Operations (shift amount in 0..31/0..63, left operand of left shift is negative)

Illegal Dereferenced Pointer (illegal pointer access to variable of structure field,

pointer within bounds)

Correctness Condition (array conversion must not extend range, function pointer

does not point to a valid function)

Non-Initialized Pointer

User Assertion

Non-Termination of Call (non-termination of calls and loops, arithmetic

expressions)

Known Non-Termination of Call

Non-Termination of Loop

Standard Library Function Call

Absolute Address

Inspection Points

static void pointer_arithmetic (void) {

int array[100];

int *p = array;

int i;

for (i = 0; i < 100; i++) {

*p = 0;

p++;

}

if (get_bus_status() > 0) {

if (get_oil_pressure() > 0) {

*p = 5;

} else {

i++;

}

}

i = get_bus_status();

if (i >= 0) {

*(p - i) = 10;

}

}

Green: reliablesafe pointer access

Red: faultyout of bounds error

Gray: deadunreachable code

Orange: unprovenmay be unsafe for some

conditions

41

System TestRequirements

That’s Model-Based Design

HIL Simulation

Code V&V

Model Design

Model V&V

Code

Generation

42

What is the current industry maturity

in the adoption of Model-Based Design ?

43

Model-Based Design Maturity Framework

44

Profile of the industries in the benchmark

OEMs and Suppliers from all regions of the world

Automotive: Passenger, Commercial, Off-Highway

Aerospace:Commercial, Military, Space

Other: Industrial Automation, Medical,

Transportation, Electronics

45

Automotive vs. Aerospace: Leaders

0

20

40

60

80

100

Modeling

Simulation and Analysis

Implementation

Verification andValidation

Process, Toolsand Infrastructure

Enterprise Management

Aero

Auto

46

Thank you!

Recommended