Simulink To Autosar Code Made Easy
Simulink To Autosar Code Made Easy
Simulink To Autosar Code Made Easy
김종헌 부장
Senior Application Engineer
MathWorks Korea
3
2.0
90 files
Components specification
2.1
120 files
Body and Interior Electronics APIs…
3.0
125 files
APIs for Powertrain, Chassis…
3.1
129 files
DCM, DEM Revisions...
3.2
136 files
Added safety concepts…
Application Interfaces...
198 files
Efficient NV Data
Handling via RTE…
4.2
227 files
Crypto Interface,
www.autosar.org
V2X support……..
238 files
4
4.3……….
AUTOSAR Adoption
5
6
What is AUTOSAR?
Application Layer
RTE
ECU Hardware
www.autosar.org 7
AUTOSAR Vision
Application Software
Application Software
Basic SW
Basic SW
Hardware Hardware
AUTOSAR Slogan-
www.autosar.org 8
AUTOSAR Members
11 Development
9 Core Partners
Members
88 Associate Members
57 Premium Member 17 Attendees
www.autosar.org 9
AUTOSAR Support from Embedded Coder and Simulink
Authoring Tools
Software Architecture Definition
BSW Configuration
ECU Abstraction Layer
& RTE Generation Complex Device
Services Layer
Basic Software Drivers
Basic SW Providers
ECU Hardware
10
Simulink Approach to AUTOSAR
No separate
Available via web
Simulink and Embedded Coder AUTOSAR
download + AUTOSAR Support package for Embedded Coder Blockset needed
C Code and
ARXML
Import Export
Code-generation
through Mapping
11
Supported AUTOSAR Design Workflows
AUTOSAR
SW-C
SIL/PIL Test
Embedded
Coder
Simulink
SW-C
Description
AUTOSAR
SW-C
Import/Update Export ARXML Bottom-Up Workflow
Round-Trip Workflow 12
Modeling AUTOSAR Communication
13
Runnable Entities
AUTOSAR SW-C
Receiver Sender
Port Runnable 1 Port
Server
Client Runnable 2 Port
Port
Function
Callers
14
Supported Events for a Runnable
Each Runnable should have at least one event attached
AUTOSAR
Software
AUTOSAR
Software … AUTOSAR
Software
SW-C Component 1 Component 2 Component n
Description
AUTOSAR
SW-C
1
AR: Port Virtual Functional Bus (VFB)
AR: Interface
16
Example Mapping to a Receiver Port
Add a New Simulink Port Add a New Data Element to the Interface
17
Using MATLAB for automating common tasks
model = ‘Average_VehicleSpeed_Calculation';
18
Modeling Multiple Entry-Point Functions
>> rtwdemo_autosar_multirunnables 19
Model AUTOSAR Components
Application Layer
AUTOSAR
Software … AUTOSAR
Software
Component 1 Component n
Import
SWC Description
AUTOSAR design
(Meta-model)
21
Launch AUTOSAR Configuration
>> rtwdemo_autosar_counter
22
Simulink-AUTOSAR Mapping Editor
View / Edit AUTOSAR Properties and Simulink Mappings
23
Editing AUTOSAR Properties View / Edit AUTOSAR Properties and Simulink Mappings
With the accordion control set to AUTOSAR Properties, the user can configure
AUTOSAR elements / attributes such as:
24
Mapping Inports to AUTOSAR Receiver Ports
25
Map Outports to AUTOSAR Sender Ports
26
Map Entry Point Functions for a Model
28
Select AUTOSAR Target
29
Overview of Generated ARXML
30
AUTOSAR Schema Versions
31
MISRA C:2012 for AUTOSAR target
32
33
Verification with Software- and Processor-In-The-Loop (PIL)
34
Top-Down Workflow (Starting from SWC Description)
AUTOSAR Authoring Tool
Export Merge
SWC Description SWC Description
Model Based
Design
35
Top Down Workflow
AUTOSAR Authoring Tool Top Down Workflow
Starts with Authoring Tool, then user
exports ARXML files from Authoring tool.
OR
36
Importing ARXML Files
%Import ARXML Files Top Down Workflow
importerObj = arxml.importer('rtwdemo_autosar_multirunnables.arxml') Commands to create a skeleton
model with no internal behavior
%Create new model with interfaces setup in the skeleton model (no
model = importerObj.createComponentAsModel('/pkg/swc/ASWC'); runnables)
37
Import with Internal Behavior
39
Update Existing Models from ARXML
40
41
http://www.mathworks.com/hardware-support/autosar.html 42
43
Thank You!
44