©20
08 T
he M
athW
orks
, Inc
.
® ®
Development of AUTOSAR Software Components with Model-Based Design
Dr. Joachim Schlosser Application Engineering The MathWorks GmbH
2
® ®
3 things to remember about AUTOSAR, Model-Based Design with Simulink and Real-Time Workshop Embedded Coder
Ease of use: No structural modelchanges. Switch between AUTOSARand other target without modifying the model. Easy workflows for new and legacymodels, keeping it simple for the user.AUTOSAR is seamlessly integrated in Simulink and Real-Time Workshop environment.
3
® ®
Automotive Open System Architecture
MotivationManagement of E/E* complexity associated with growth in functional scope Flexibility for product modification, upgrade and update Scalability of solutions within and across product lines Improved quality and reliability of E/E systems
GoalThe objective of the partnership is the establishment of an open standard for automotive E/E architecture
*Electric/Electronic
from: www.autosar.org
4
® ®
5
® ®
Agenda
Introduction to Model-Based DesignIntroduction to CodegenerationAUTOSAR
OverviewThe MathWorks approach to AUTOSAR
Applying Simulink to AUTOSAR: What‘s New in R2008aCommon Workflows
6
® ®
©20
08 T
he M
athW
orks
, Inc
.
Introduction to Model-Based Design
7
® ®
Traditional development processes prevent errors from being caught early in the program
Design
Implement
Mechanical
EmbeddedSoftware
Electrical
ControlDesign
Integrate
System TestingSystem Testing
System
Architecture
Requirements
Specifications
8
® ®
Model-Based Design enforces continuous testing and verification throughout the design process Design
Implement
System
Architecture
Requirements
SpecificationsEnvironmentEnvironment SystemSystem
Exec
utio
n H
arne
ssEx
ecut
ion
Har
ness
Subsystem ASubsystem A Subsystem BSubsystem B
Component AComponent A Component BComponent B
C, C++
MCU DSP FPGA ASIC
HDL(VHDL, Verilog)
Embedded Software Digital ElectronicsG
enerate
Generate
Integration
Real-TimeSoftware
Prototypes
Continuous V
erification &
Validation
Rapid PrototypingHW-in-the-LoopSW-in-the-Loop
Generate:• Assertions• Test results• Documentation
Perform:• Simulation• Verification• Design Analysis• Traceability
Analysis
9
® ®
Benefits of Model-Based Design
CostMinimize prototypes and re-workFacilitates design reuse
ScheduleShortens time-to-marketEnhances team communication
PerformanceFosters innovationImproves quality
10
® ®
©20
08 T
he M
athW
orks
, Inc
.
Introduction to Code Generation
11
® ®
Core Code Generation Building BlocksReal-Time Workshop®
Generates code from Simulink that is easy to interact and experiment with
Real-Time Workshop® Embedded Coder™
Generates extremely efficient code that can be customized to look and perform like hand code
Embedded IDE Link for <embedded toolchain>Communication with compiler IDE
Target Support Package™ <microprocessor>Makes it easy to deploy generated code on particular microprocessors includingYou can deploy code on any microprocessor using Real-Time Workshop and Real-Time Workshop Embedded Coder because they generate standard C (ANSI/ISO-C).
12
® ®
EmbeddedDeployment
On-Target Rapid Prototyping Embedded Code Generation• ANSI/ISO-C• Embedded Targets• Links for IDEs
Functional Rapid
Prototyping and HIL
Rapid Prototyping• xPC Target• Real-Time Windows Target• VxWorks Example
Modelingand
Simulation
Simulation Acceleration• Simulink Accelerator• S-Function• GRT/ERT/RSIM
Real-Time Workshop® / Stateflow Coder
SimulinkStateflow®
Real-Time Workshop Embedded Coder
Multiple Domain Code Generation
13
® ®
©20
08 T
he M
athW
orks
, Inc
.
AUTOSAR
14
® ®
Core Members
Premium Members
Associate Members
Membership
+ 50 other companies
15
® ®
Architecture
ECU-Hardware
AUTOSAR Runtime Environment (RTE)
ActuatorSoftware
Component
AUTOSARInterface
ApplicationSoftware
Component
SensorSoftware
Component
ApplicationSoftware
Component
..............
AUTOSARSoftware
Basic SoftwareStandardized
Interface
AUTOSARInterface
AUTOSARInterface
AUTOSARInterface
MicrocontrollerAbstraction
AUTOSARSoftware
Component
Interface
ECUFirmware
StandardSoftware
StandardizedAUTOSARInterface
Services
StandardizedInterface
ECUAbstraction
AUTOSARInterface
StandardizedInterface
ComplexDeviceDrivers
AUTOSARInterface
API 2VFB & RTErelevant
StandardizedInterface
Communication
StandardizedInterface
StandardizedInterface
OperatingSystem
API 1RTErelevant
API 0
StandardizedInterface
API 3 PrivateInterfaces inside Basic Software
possible ECU-Hardware
AUTOSAR Runtime Environment (RTE)
ActuatorSoftware
Component
AUTOSARInterface
ApplicationSoftware
Component
SensorSoftware
Component
ApplicationSoftware
Component
..............
AUTOSARSoftware
Basic SoftwareStandardized
Interface
AUTOSARInterface
AUTOSARInterface
AUTOSARInterface
MicrocontrollerAbstraction
AUTOSARSoftware
Component
Interface
ECUFirmware
StandardSoftware
StandardizedAUTOSARInterface
Services
StandardizedInterface
ECUAbstraction
AUTOSARInterface
StandardizedInterface
ComplexDeviceDrivers
AUTOSARInterface
API 2VFB & RTErelevant
StandardizedInterface
Communication
StandardizedInterface
StandardizedInterface
OperatingSystem
API 1RTErelevant
API 0
StandardizedInterface
API 3 PrivateInterfaces inside Basic Software
possible
Basic Software
16
® ®
Key Features
Modularity and configurability
Modular software architecture for automotive ECUsConsideration of HW dependent and HW independent SW modulesIntegration of SW modules provided by different suppliersTransferability of functional SW-modules within a particular E/E-systemScalability of the E/E-system across the entire range of vehicle product lines
from: www.autosar.org
17
® ®
Applying Simulink to AUTOSAR New in R2008a
Simulink to import and exportAUTOSAR Software Component (SW-C) Descriptions, in XML
Software-in-the-Loop supportAutomatic S-Function configuration and generation for routing simulation data using AUTOSAR RTE API calls
Real-Time Workshop® Embedded Coder to generateAUTOSAR SW-C Implementations (runnables) compliant with AUTOSAR Run Time Environment, in C code
Supports:AUTOSAR v2.0 and v2.1
18
® ®
Mapping between AUTOSAR SW-C Meta Model and Simulink
AUTOSAR SoftwareComponents
Virtual Functional Bus
AU
TOSA
RSW
-C1
AU
TOSA
RSW
-C2
AU
TOSA
RSW
-C3
AU
TOSA
RSW
-Cn...
SW-CDescription
SW-CDescription
SW-CDescription
SW-CDescription
19
® ®
Mapping between AUTOSAR SW-C Meta Model and Simulink
Ports andInterfaces
Virtual Functional Bus
AU
TOSA
RSW
-C1
AU
TOSA
RSW
-C2
AU
TOSA
RSW
-C3
AU
TOSA
RSW
-Cn...
SW-CDescription
SW-CDescription
SW-CDescription
SW-CDescription
AU
TOSA
RSW
-C1
SW-CDescription
20
® ®
Common Workflows
Importing AUTOSAR SW Component Descriptions
AU
TOSA
RSW
-C1
SW-CDescription
Import
21
® ®
Common Workflows
Controller Design
Development of controller behavior
22
® ®
Common Workflows
Implementing and publishing Software Components by generating AUTOSAR compliant code
AU
TOSA
RSW
-C1
SW-CDescription
23
® ®
Volkswagen use of Production Code Generation for AUTOSAR
MAC 2007: http://www.mathworks.com/industries/auto/mac2007/proceedings/
24
® ®
3 things to remember about AUTOSAR, Model-Based Design with Simulink and Real-Time Workshop Embedded Coder
Ease of use: No structural modelchanges. Switch between AUTOSARand other target without modifying the model. Easy workflows for new and legacymodels, keeping it simple for the user.AUTOSAR is seamlessly integrated in Simulink and Real-Time Workshop environment.
25
® ®
3 things to remember about AUTOSAR, Model-Based Design with Simulink and Real-Time Workshop Embedded Coder
Ease of use: No structural modelchanges. Switch between AUTOSARand other target without modifying the model. Easy workflows for new and legacymodels, keeping it simple for the user.
26
® ®
3 things to remember about AUTOSAR, Model-Based Design with Simulink and Real-Time Workshop Embedded Coder
Ease of use: No structural modelchanges. Switch between AUTOSARand other target without modifying the model.
27
® ®
The one thing to remember about AUTOSAR, Model-Based Design with Simulink and Real-Time Workshop Embedded Coder
Ease of use: No structuralmodel changes. Switchbetween AUTOSAR and other target withoutmodifying the model.