Академический Документы
Профессиональный Документы
Культура Документы
Durvesh Kulkarni
Senior Application Engineer
MathWorks India
▪ Introduction to AUTOSAR
▪ Simulink for Classic Platform
– Automatic modeling and code generation
– Simulation of AUTOSAR ECU software
– Blocks for AUTOSAR Library routines
– Importing and exporting AUTOSAR descriptions artifacts (ARXML files)
▪ Simulink for Adaptive Platform
– A closer look at the Adaptive layers
– Motivation for Simulink to support Adaptive
– Mapping Adaptive platform to Simulink
– Code Generation for Adaptive components
▪ Polyspace for AUTOSAR
▪ Additional Resources
2
Agenda
▪ Introduction to AUTOSAR
▪ Simulink for Classic Platform
– Automatic modeling and code generation
– Simulation of AUTOSAR ECU software
– Blocks for AUTOSAR Library routines
– Importing and exporting AUTOSAR descriptions artifacts (ARXML files)
▪ Simulink for Adaptive Platform
– A closer look at the Adaptive layers
– Motivation for Simulink to support Adaptive
– Mapping Adaptive platform to Simulink
– Code Generation for Adaptive components
▪ Polyspace for AUTOSAR
▪ Additional Resources
3
Introduction to AUTOSAR
Attendees
Associate Partners
Development
Partners
Premium
Partners
Core Partners
4
AUTOSAR Platforms
N Non - AUTOSAR
C Classic - AUTOSAR
A Adaptive - AUTOSAR
N
A
N
C
N
A N
C
N
C N
N
ARA
RTE
Basic Software Services
Basis
Infotainment Platform
GENIVI members
Audiobuild and integrate compliant products, and
their differentiating features, tools, services
System Architecture
Linux operating system, drivers and libraries
x86 or ARM-based processor
MIPs: Million Instructions per Second Source: AUTOSAR Adaptive Platform Joint Meeting May 2017 6
AUTOSAR Support Transition AUTOSAR Blockset
*Requires MATLAB
**Requires MATLAB Coder and Simulink Coder
7
Agenda
▪ Introduction to AUTOSAR
▪ Simulink for Classic Platform
– Automatic modeling and code generation
– Simulation of AUTOSAR ECU software
– Blocks for AUTOSAR Library routines
– Importing and exporting AUTOSAR descriptions artifacts (ARXML files)
▪ Simulink for Adaptive Platform
– A closer look at the Adaptive layers
– Motivation for Simulink to support Adaptive
– Mapping Adaptive platform to Simulink
– Code Generation for Adaptive components
▪ Additional Resources
8
AUTOSAR Support from Embedded Coder and Simulink
Authoring Tools Software Architecture Definition
ECU Hardware
9
Automatic modeling and code generation
▪ Show quick start demo, edit in code perspective UI and AUTOSAR dict,
code gen
10
Functional simulation of AUTOSAR basic software is critical
for AUTOSAR ECU development
AUTOSAR ECU
layered architecture Many calls between application software and basic
software
Application Software
Basic Software
11
Basic software library makes functional simulation of
AUTOSAR basic software as easy as pressing the play
button
Encapsulated in
13
AUTOSAR Library Routines
14
Importing and exporting AUTOSAR descriptions (ARXML files)
SW-C
Description
AUTOSAR
SIL/PIL Test
SW-C
Embedded
Coder
Simulink and AUTOSAR Blockset
Round Tripping
SW-C
Embedded
Description
Coder
AUTOSAR
SW-C
15
Import AUTOSAR XML to Simulink
ThrottlePositionControlComposition.arxml
16
AUTOSAR Software Components
NvBlockSW
Component Type RTE
ECUAbstractionSW ComplexDeviceDrive
ServicesSW
Component Type rSW Component
Component Type
Type
Basic Software
17
AUTOSAR Composition-Software-Component
▪ Compositions purely
architectural element
Composition Component
– Do not impact how
components interact with
Composition Component
RTE, and code
ComplexDevice
DriverSwComponent
Type
▪ Introduction to AUTOSAR
▪ Simulink for Classic Platform
– Automatic modeling and code generation
– Simulation of AUTOSAR ECU software
– Blocks for AUTOSAR Library routines
– Importing and exporting AUTOSAR descriptions artifacts (ARXML files)
▪ Simulink for Adaptive Platform
– A closer look at the Adaptive layers
– Motivation for Simulink to support Adaptive
– Mapping Adaptive platform to Simulink
– Code Generation for Adaptive components
▪ Polyspace for AUTOSAR
▪ Additional Resources
20
AUTOSAR Layered software architecture
21
Key Concept #1
Everything is a process .. as in “OS process”
OS Process #1 OS Process #2 OS Process #3 OS Process #4
Process life-cycle
Process scheduling management.
23
Key Concept #2
Service-oriented inter-process communication
Linux Machine 1 Linux Machine 2
IPC Network
24
Key Concept #2
Service-oriented communication
▪ Service Interface can contain <<interface example>>
RadarService
– Events (Messages)
• BrakeEvent
– Fields (Data)
• UpdateRate
25
Key Concept #3: Everything is C++
Adaptive Application Adaptive Application Adaptive Application Adaptive Application ASW::XYZ ASW::ABC
Non-PF Service Non-PF Service
User Applications
ara::phm
(local)
ara::per
DDS
IPC
26
Motivation for Simulink to support Adaptive
27
Adaptive SW Architecture Concepts
28
Mapping AUTOSAR AP Concepts to
Simulink
Adaptive
Application
RequiredPort
"Radar" : {
// events
"event" : {
“brakeEvent"
"parkingBrakeEvent"
},
// methods
"method" : {
"Calibrate"
"Adjust"
},
// fields
"field" : {
“updateRate"
}
}
29
Mapping AUTOSAR AP Concepts to Simulink
Adaptive
Application
ProvidedPort
"Radar" : {
// events
"event" : {
“brakeEvent"
"parkingBrakeEvent"
},
// methods
"method" : {
"Calibrate"
"Adjust"
},
// fields
"field" : {
“updateRate"
}
}
30
Generate Production AUTOSAR Adaptive C++ Code
31
Develop Adaptive AUTOSAR Components
32
Agenda
▪ Introduction to AUTOSAR
▪ Simulink for Classic Platform
– Automatic modeling and code generation
– Simulation of AUTOSAR ECU software
– Blocks for AUTOSAR Library routines
– Importing and exporting AUTOSAR descriptions artifacts (ARXML files)
▪ Simulink for Adaptive Platform
– A closer look at the Adaptive layers
– Motivation for Simulink to support Adaptive
– Mapping Adaptive platform to Simulink
– Code Generation for Adaptive components
▪ Polyspace for AUTOSAR
▪ Additional Resources
33
Polyspace for AUTOSAR
34
What if…?
Check if…
▪ Implementation of Software Components Follow Specifications
▪ Edits to Specifications Impact
▪ Implementation for Run-time Errors and Mismatch with Specifications
▪ Implementation Against Specification Update
35
ARXML
Polyspace and AUTOSAR
ARXML provides
specification
of Application Layer Polyspace verifies
and link with RTE the match between
code and ARXML
AUTOSAR architecture
ECU Hardware
36
Polyspace for AUTOSAR(R2018a)
AUTOSAR software
swcA.c
swcA.h
…
swcB.c
ARXML
polyspace-autosar
38
Polyspace for AUTOSAR
39
Polyspace checks AUTOSAR C++14 Rules
https://www.autosar.org/fileadmin/user_upload/standards/adaptive/17-03/AUTOSAR_RS_CPP14Guidelines.pdf -autosar-cpp14 40
Benefits of using Polyspace for AUTOSAR
41
Summary
AUTOSAR Blockset :
▪ Model AUTOSAR Classic and Adaptive
software components
▪ Simulate AUTOSAR compositions and ECUs
▪ Generate optimized AUTOSAR C/C++ code,
roundtrip ARXML, and perform SIL and PIL
verification (requires Embedded Coder®)
▪ Is well-suited for applications involving
embedded production deployment
▪ Is key part of Model-Based Design by providing
detailed specification of embedded software
43
AUTOSAR Support Transition AUTOSAR Blockset
AUTOSAR Support
Package
AUTOSAR
Embedded Coder** Blockset Embedded
Embedded Coder**
Coder**
Simulink* Simulink*
*Requires MATLAB
**Requires MATLAB Coder and Simulink Coder
44
User Articles/Presentations
Simulink
for Classic
and
Adaptive
Platform
46