46
1 © 2014 The MathWorks, Inc. From Design to Production An integrated approach Paolo Fabbri Senior Engineer

From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

1© 2014 The MathWorks, Inc.

From Design to Production

An integrated approach

Paolo Fabbri

Senior Engineer

Page 2: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

2

Do you know what it is?

Integration Test

System TestRequirements

Unit Test

Functional Spec

Detailed Design

Implementation

Page 3: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

3

Is the industry still using this approach

for Embedded Software Development?

Page 4: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 5: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 6: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

6

Project Management in Simulink

Page 7: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

7

Simulink ProjectCollaborative development

Source Control Integration

Support for svn and git

Model compare/merge

Data compare/merge

Files Management

Dependencies Analysis

Impact Analysis

Page 8: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

8

Source Control Integration

Page 9: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

9

Model Comparison

Page 10: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

10

Data Dictionary Comparison

Page 11: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

11

Dependency and Impact Analysis

Page 12: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

12

Manage Complexity in Simulink

Page 13: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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?

Page 14: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

14

Component-Based ModelingReuse models among different teams and projects

Control

Designer

Control

Designer

Modular Architecture

Reusable Models

Variants Management

IP Protection

Plant

Expert

Page 15: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

15

Model and Subsystem Variants

Page 16: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

16

Protected Models for IP Protection

Read-Only View Support

Simulation Support

Code Generation Support

Page 17: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 18: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

18

Simulink Data DictionaryEnsure data consistency across models

Design Data

Configuration Sets

Change tracking

Data partitioning

Scalability and performance

Simulink Projects Integration

Page 19: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

19

Simulink Data Management System

Define

Store

Partition

Access

Manage

Collaborate

101010

Simulink Data Objects

Simulink Data Dictionary

Model Explorer

Simulink Project

101010

+

+

Page 20: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

20

Model Verification and Validation

Page 21: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 22: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

22

Analyze Simulation Data with Simulation Data Inspector

Page 23: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

23

Simulation Comparison

Page 24: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

24

Model Coverage Analysis

Page 25: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

25

Embedded Code

Generation and Verification

Page 26: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 27: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

27

Unified Code

Generation

C++ Code

HDL Code

C Code

Stateflow

Simulink

MATLAB

PLC Code

Unified Code Generation Capabilities

Page 28: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 29: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 30: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 31: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

31

Objective-Based Code Generation

Page 32: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

32

Code Report and Code Metrics

Page 33: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 34: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

34

«In-the-Loop» Simulations

Page 35: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

35

MIL/SIL/PIL Simulation Comparison

Page 36: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

36

Code Execution Profiling

Page 37: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

37

Source Level Debugging in SIL

Page 38: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

38

Code Coverage Analysis

Page 39: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 40: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 41: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

41

System TestRequirements

That’s Model-Based Design

HIL Simulation

Code V&V

Model Design

Model V&V

Code

Generation

Page 42: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

42

What is the current industry maturity

in the adoption of Model-Based Design ?

Page 43: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

43

Model-Based Design Maturity Framework

Page 44: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 45: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

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

Page 46: From Design to Production · Usage Systems and software engineers Systems engineers Hardware Any processor Specific Hardware Kits or Boards Flexibility Higher Lower Ease of Use (Turnkey)

46

Thank you!