Run-Time Environment (RTE) Heart of The AUTOSAR ECU Architecture

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 49

Run-Time Environment (RTE)

Heart of the AUTOSAR ECU Architecture

28.04.2017
Trainer:
Mingkai Deng, Engineer
Topic
 Introduction
 Introduction of AUTOSAR
 Introduction of VFB
 Introduction of RTE

 arxml file
 Data Type
 Communication
 Interface/Port/DataElement
 Sender-Receive
 Client-Server

 AUTOSAR Software-components
 Application software component
 Sensor-actuator software component
 Internal Behaviour
 Implementation

 AUTOSAR&MATLAB
 Example of an turn light control

/2
Topic
 Introduction
 Introduction of AUTOSAR
 Introduction of VFB
 Introduction of RTE

 arxml file
 Data Type
 Communication
 Interface/Port/DataElement
 Sender-Receive
 Client-Server

 AUTOSAR Software-components
 Application software component
 Sensor-actuator software component
 Internal Behaviour
 Implementation

 AUTOSAR&MATLAB
 Example of an turn light control

/3
Introduction

What is AUTOSAR?

AUTOSAR – AUTomotive Open Systems ARchitecture

An open standard automotive software architecture, jointly developed


by automobile manufacturers, electronics and software suppliers and
tool vendors.
More than 100 members

Motto: “cooperate on standards, compete on implementations”

Target: facilitate portability, composability, integration of SW


components over the lifetime of the vehicle
Introduction

AUTOSAR Vision
AUTOSAR aims to improve complexity management of integrated E/E architectures through increased reuse
and exchangeability of SW modules between OEMs and suppliers.
Introduction

Aims and benefits of using AUTOSAR

• AUTOSAR aims to standardize the software architecture of Electronic Control Units


(ECUs).
• AUTOSAR paves the way for innovative electronic systems that further improve
performance, safety and environmental friendliness.

 Hardware and software will be widely independent of each other.


 Development can be de-coupled by horizontal layers, reducing
development time and costs.
 The reuse of software increases at OEM as well as at suppliers. This
enhances quality and efficiency during development.
Introduction

AUTOSAR – Core Partners and Partners (June 2016)


Introduction

AUTOSAR achievements and outlook (1/2)


Introduction

AUTOSAR achievements and outlook (2/2)


Introduction

comparison between AUTOSAR and OSEK solution


Introduction

VBF - Virtual Functional Bus


• VBF is the communication mechanism that allows the application software
components to interact;
• VBF allows for a strict separation between applications and infrastructure
Introduction

RTE – RunTime Environment


• The RTE is the realization (for a particular ECU) of the interfaces of the
AUTOSAR VFB.
Introduction

What does RTE do?


In principle the RTE can be logically divided into two sub-parts realizing:

• the communication between software components;


• the scheduling of the software components;
Topic
 Introduction
 Introduction of AUTOSAR
 Introduction of VFB
 Introduction of RTE

 arxml file
 Data Type
 Communication
 Interface/Port/DataElement
 Sender-Receive
 Client-Server

 AUTOSAR Software-components
 Application software component
 Sensor-actuator software component
 Internal Behaviour
 Implementation

 AUTOSAR&MATLAB
 Example of an turn light control

/ 14
ARXML file

.arxml files are a type of files used across autosar , to configure the autosar
software. ARXML stands for autosar XML, which is nothing but a schema with
certain parameters.

XML
ARXML AUTOSAR
Language

C:\Users\dengm\
Documents\course\turnlight
Topic
 Introduction
 Introduction of AUTOSAR
 Introduction of VFB
 Introduction of RTE

 arxml file
 Data Type
 AUTOSAR Software-components
 Application software component
 Sensor-actuator software component
 Internal Behaviour
 Implementation

 Communication
 Sender-Receive
 Client-Server

 AUTOSAR&MATLAB
 Example of an turn light control

/ 16
Data Type

 Application Data Type


Application Data Types support the application view of developing ECU software
(resp. the view of Software Components).
• ApplicationPrimitiveDataType
• ApplicationCompositeDataType
• ApplicationRecordDataType: Equivalent to a struct {} in C language.
• ApplicationArrayDataType: Equivalent to an array [] in C language.

 Implementation Data Type


Implementation Data Types let the integrator specify the implementation details
such as Software Base Types or endianness.

 Primitive Data Type


uint8, uint16, Boolean, etc.
Data Type

Example

Application Data Type

Map to

Implementation Data Type


Topic
 Introduction
 Introduction of AUTOSAR
 Introduction of VFB
 Introduction of RTE

 arxml file
 Data Type
 Communication
 Interface/Port/DataElement
 Sender-Receive
 Client-Server

 AUTOSAR Software-components
 Application software component
 Sensor-actuator software component
 Internal Behaviour
 Implementation

 AUTOSAR&MATLAB
 Example of an turn light control

/ 19
Communication

Interface/Port/DataElement
 Port:
• The ports of a component are the interaction points between
components.
• A port of a component is either a “PPort” or an “RPort”

 Interface:
• An interface is attached to a port and describes the data or operations
that are provided or required by a software component via that port.

 DataElement:
• Data elements are declared within the context of a Sender-Receiver
Interface.
• One Interface can have one or several DataElement.
• Data elements are information units that are exchanged between
provide ports and require ports via a Sender-Receiver Interface. They
represent the data flow.
Communication

Interface/Port/DataElement

PPort RPort
SWC_A SWC_B

DataElement

RTE Interface
Communication

Sender-Receiver

A communication pattern which offers asynchronous distribution of information


where a sender communicates information to one or more receivers, or a receiver
receives information from one or several senders

 Queued S/R communication

If the sender-receiver communication is configured as queued, then the sent data is


processed using a first-in-first-out (FIFO) queue with a specified length.

 Non-queued S/R communication

If the sender-receiver communication is configured as non-queued, then the


receiver always has access to the last sent data.
Communication

Sender-Receiver

 Queued S/R communication


• “event” (isQueued=True)
• RTE read Data from Quen

Function Format:
Std_ReturnType Rte_Receive_<p>_<d> (OUT <DataType> *data)
Std_ReturnType Rte_Send_<p>_<d> (IN <DataType> data)
Communication

Sender-Receiver

 Non-queued S/R communication


• “Last is Best”
• 1:n communication

Function Format:
Std_ReturnType Rte_Read_<p>_<d> (OUT <DataType> *data)
Std_ReturnType Rte_Write_<p>_<d> (IN <DataType> data)

Static DataType Variable_A;


Std_ReturnType Rte_Read_<p>_<d> (OUT <DataType>
*data)
{
*data = Variable_A;
return xx;
}
Std_ReturnType Rte_Write_<p>_<d> (IN <DataType> data)
{
Variable_A = data;
return xx;
Communication

Client-Server

Client-server communication involves two entities, the client which is the


requirer (or user) of a service and the server that provides the service.

• Communication mechanism: n:1


• Function Format:
Std_ReturnType Rte_Call_<p>_<o>([IN | IN/OUT | OUT <param_1>],...
[IN | IN/OUT | OUT <param_n>])
Communication

Client-Server

 Example

Std_ReturnType Rte_Call_LeTurnLiCtrl_IoHwAbDOSet(uint8 IO)


{
Std_ReturnType rv;
rv = IoHwAbDOSet (IO);
return rv;
}
Topic
 Introduction
 Introduction of AUTOSAR
 Introduction of VFB
 Introduction of RTE

 arxml file
 Data Type
 Communication
 Interface/Port/DataElement
 Sender-Receive
 Client-Server

 AUTOSAR Software-components
 Application software component
 Sensor-actuator software component
 Internal Behaviour
 Implementation

 AUTOSAR&MATLAB
 Example of an turn light control

/ 27
AUTOSAR Software-components

Content
 Application software component

 Sensor-actuator software component


AUTOSAR Software-components

Application software component


 ECU independent
 Conceptually located above the AUTOSAR RTE
 Atomicity

RPort PPort

SWC
Runnable

RTE Interface TASK Interface


AUTOSAR Software-components

Application software component


 Example:

C:\Users\dengm\
Documents\course\turnlight
AUTOSAR Software-components

Sensor-actuator software component


 ECU dependent

 Conceptually located above the AUTOSAR RTE

Sensor Actuator
RPort PPort
SWC
Runnable RPort PPort
RPort PPort

RTE Interface TASK Interface

BSW Input Ouput

Remark: Input/Output include signal from Com, memory, IOHW, etc.


AUTOSAR Software-components

Sensor-actuator software component


 Example:

Sensor Actuator
AUTOSAR Software-components

Internal Behaviour

The Software Component internal behaviour represents the internal structure of an


Atomic Software Component. It is mainly characterized by its runnable entities, and
used RTEEvents.

The internal behavior is an element that represents the internal structure of an


Atomic Software Component. It is characterized by elements such as
 Runnable Entities
 RTE Events
 Data access definition
 Interrunnable variable
AUTOSAR Software-components

Internal Behavior
 Runnable Entities
A Runnable Entity is a part of an Atomic Software Component which can be
executed and scheduled independently from the other Runnable Entities of this
Atomic Software-Component.

ARXML file

C file
AUTOSAR Software-components

Internal Behavior
 RTE Events
An RTE event is part of an SW-C internal behavior. It defines situations and
conditions for starting or continuing the execution of a specific runnable entity.
Mainly include:

• Timing event: Triggers a runnable entity periodically


• Data received event: Triggers a runnable entity as soon as a variable
data prototype is received at the port
AUTOSAR Software-components

Internal Behavior
 Data access definition

• The data access definition defines a Runnable Entities read or write access
to communication data.
AUTOSAR Software-components

Internal Behavior
 Interrunnable variable
• An interrunnable variable is a variable data prototype that requires an
application data type which can have a compu method and a data constraint
element

Interrunnable variables can be:


• Implicit: which means the runnable entity works on a local copy of an
interrunnable variable. A copy of read interrunnable variables is created on
entry of the runnable. Changes are written back when the runnable entity
completes. This avoids concurrent access to interrunnable variables during
runnable entity execution.
IN_InterRunnable_Var = Rte_Iread_<r>_<p>_<d> (void);

• Explicit: which means the runnable entity can directly access an


interrunnable variable. Changes are immediately visible to other runnable
entities with explicit access to the interrunnable variable.
Rte_Read_<r>_<p>_<d> (&IN_InterRunnable_Var);
AUTOSAR Software-components

Internal Behavior
 Data access definition and Interrunnable variable

read

write
AUTOSAR Software-components

Implementation
 In the Implementation description an actual implementation of an AUTOSAR
software component is described including the memory consumption.

 the information from the Implementation part are only required for the RTE
Generation Phase.
AUTOSAR Software-components

Implementation
 Example
Topic
 Introduction
 Introduction of AUTOSAR
 Introduction of VFB
 Introduction of RTE

 arxml file
 Data Type
 Communication
 Interface/Port/DataElement
 Sender-Receive
 Client-Server

 AUTOSAR Software-components
 Application software component
 Sensor-actuator software component
 Internal Behaviour
 Implementation

 AUTOSAR&MATLAB
 Example of an turn light control

/ 41
AUTOSAR&MATLAB

Example of an turn light control

 Step 1 Create the module


AUTOSAR&MATLAB

Example of an turn light control

 Step 2 Set parameter in “Model Configuration Parameter”


AUTOSAR&MATLAB

Example of an turn light control

 Step 3 Configure AUTOSAR Interface


3.1 Define Interfaces and DataElements

3.2 Define “SenderPorts” and “ReceiverPorts” and mapping the interface


to the port.
AUTOSAR&MATLAB

Example of an turn light control

 Step 3 Configure AUTOSAR Interface

3.3 mapping the “AUTOSAR port” to the “Simulink Outport” and


“Simulink Inport”
•添加 Runnables TLRbl_20ms_Task 对应的 Events :

AUTOSAR&MATLAB

Example of an turn light control

 Step 4 Configure AUTOSAT Runnables

4.1 Adding Runnables

4.2 Adding Runnables Events


•添加 Runnables TLRbl_20ms_Task 对应的 Events :

AUTOSAR&MATLAB

Example of an turn light control

 Step 4 Configure AUTOSAT Runnables

4.3 Mapping the Runnables to “Entry Point Functions”


•添加 Runnables TLRbl_20ms_Task 对应的 Events :

AUTOSAR&MATLAB

Example of an turn light control

 Step 5 Generate Code


Q&A

You might also like