Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI...

38
1 © 2015 The MathWorks, Inc. Sebastien Dupertuis Application Engineer Applications Engineering Group MathWorks Switzerland June 11, 2015 Model to Code, Made Simple and Easy

Transcript of Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI...

Page 1: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

1© 2015 The MathWorks, Inc.

Sebastien Dupertuis

Application Engineer

Applications Engineering Group

MathWorks Switzerland

June 11, 2015

Model to Code, Made Simple and Easy

Page 2: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

2

Challenges to bring an idea into real hardware

People

Software Developers

Specifications

Schematics

Diagrams

Algorithms

…Hardware Engineers

Mechanical Engineers

Tools?

Investments?

ROI?

Manager

Page 3: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

3

switch(idea)

{

Page 4: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

4

case ‘Applications’:

Page 5: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

5

Philips Healthcare MRI scannerAirSonea device, which connects

to a patient’s smartphone

Sonova’s hearing aid and

cochlear implant solutions

Toyota engine

Alstom Grid’s HVDC demonstrator system

with power converter modules

http://nl.mathworks.com/company/user_stories/

The HB-SIA aircraft on a test

flight over San Francisco Bay Photo © Solar Impulse | Revillard | Rezo.ch

Page 6: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

6

case ‘Programming’:

Page 7: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

7

ASCIIMATLAB

C

C++

ASSEMBLYVHDL

Page 8: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

8

case ‘Hardware’:

Page 9: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

9

MCU /

DSP

ARM®

Analog Devices®

Atmel®

Freescale™

Infineon®

Intel®

Microchip®

NXP™

Renesas®

STMicroelectronics®

Texas Instruments™

Xilinx®

ALTERA®

Page 10: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

10

case ‘Operating Systems’:

Page 11: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

11

OS Embedded Linux®

VxWorks®

OSEK-OSMicrosoft® Windows Embedded

Android™

Page 12: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

12

case ‘Standards’:

Page 13: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

13

STANDARDS

AUTOSARMISRA AC AGC

ISO 26262

IEC 61508

EN 50128

DO-178B/C

Page 14: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

14

default :

printf(“Wrong session?”);

}

Page 15: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

15

MBD_Overview();

Page 16: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

16

TE

ST

&

VE

RIF

ICA

TIO

N

INTEGRATION

IMPLEMENTATION

ANALYSIS – SPECIFICATION- DESIGN

MODEL

RESEARCH

ACTIVITIES

REQUIREMENTS

DOCUMENTS

MCU DSP FPGA ASIC

Structured

TextVHDL, VerilogC, C++

Architecture

Algorithms

Schematics

TEST

CASES

Environment

Constraints

Physical Domains

TEST

CASES

PLC PAC

Page 17: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

17

IMPLEMENTATION

MCU DSP FPGA ASIC

Structured

TextVHDL, VerilogC, C++

PLC

TE

ST

&

VE

RIF

ICA

TIO

N

INTEGRATION

ANALYSIS – SPECIFICATION- DESIGN

MODEL

RESEARCH

ACTIVITIES

REQUIREMENTS

DOCUMENTS

MCU DSP FPGA ASIC

Structured

TextVHDL, VerilogC, C++

Architecture

Algorithms

Schematics

TEST

CASES

Environment

Constraints

Physical Domains

TEST

CASES

PLC PAC

Page 18: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

18

Model2Code();

Page 19: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

19

Simulink

Modelling Languages

MATLAB

Stateflow

Page 20: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

20

MATLAB

Unified

representation

C++ Code

HDL Code

C Code

PLC Code

Mathematical

enginesTest cases

Find design

errors

Fixed-point

autoscaling

Code Generation Common Internal Architecture

Simulink

Stateflow

Page 21: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

21

case ‘Code Generation – Top 5’:

Page 22: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

22

In-the-Loop Verification Methodologies

Page 23: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

23

Non-Real-Time Synchronization

with Host at Each Time Step

Execution History

• Logged signal results comparison

• Code coverage

• Execution timing

Communication

Gateway

Software- and Processor- in-the-LoopSIL and PIL

Page 24: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

24

Code

Generation

Hard Real-Time Execution

Logging and

Tuning via Host

Hardware-in-the-LoopHIL, Rapid Prototyping

Page 25: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

25

FPGA-in-the-LoopFIL, Test Bench Simulation

Page 26: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

26

Incremental Build Process

Page 27: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

27

Incremental Build Process

Significantly saves time

Only build blocks that have changed

Helps with partitioning and

componentization

Scalability!

Page 28: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

28

Simulink Data Dictionary

Page 29: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

29

Componentization

Scalability and performance

Change tracking and

differencing

Integration with Simulink

Projects

Code generation

Manage data outside of base workspace

Code Generation for Simulink Data Dictionary

Simulink

Model 1

Model 2

Model 3

SLX

FileSLX

FileSLX

File

SLDD

FileSLDD

FileSLDD

FileGlobal Data

Page 30: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

30

Profiling of Generated Code

Page 31: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

31

Measure Execution Time

Supports

– SIL and PIL

– Tasks and functions

– HTML reports

Identify hot spots, worst-case execution

Page 32: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

32

Intellectual Property Protection

Page 33: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

33

Password Protected Models

Support options

– Simulation: Allow Accelerator mode

– Code generation:

Include obfuscated code to support

code generation

– Read-only view: Web view of model

– Password protection: Access

protected by password

Protect design IP for models and

generated code

Page 34: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

34

case ‘Targets’:

Page 35: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

35

Hardware Support Packages

HW Support Packages are:

– Downloadable from

MathWorks websites

– Available for free with required

base product

– Supported by technical support

HW Support Package

manages:

– Licenses

– 3rd-party software installation

– Hardware setup

Page 36: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

36http://nl.mathworks.com/services/consulting/proven-solutions/developing-embedded-targets.html

Services

Automate compile, build, and download

Integrate device drivers and RTOS with Simulink

Optimize code replacements to your target

Verify and validate code execution results

Page 37: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

37

case ‘Getting FREEd’:

}

Page 38: Model to Code, Made Simple and Easy · 5 AirSonea device, which connects Philips Healthcare MRI scanner to a patient’s smartphone Sonova’s hearing aid and cochlear implant solutions

38

Programming an heterogeneous systemZynq Platform

ARM

FPGAAXI AXI