0% found this document useful (0 votes)
31 views29 pages

Variant Handling

Uploaded by

longktmtk15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views29 pages

Variant Handling

Uploaded by

longktmtk15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Variants

Handling

HoangTT3 Tp.HCM, Mar/2020


43e-BM/HR/HDCV/FSOFT V1.2 - ©FPT SOFTWARE - Learning and Development Institute - Internal Use
1
Objective

• Introduce Configuration Classes


• Pre-Compile Time
• Link Time
• Post-build Time

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 2


pment Institute - Internal Use
Introduce Configuration Classes
In the AUTOSAR sense an ECU means a microcontroller plus peripherals and the
according software configuration. Therefore, each microcontroller requires its own
ECU Configuration.

The main activities include configuring and/or generating the BSW modules (including
the RTE) and building the executable. The BSW configuration can be done during
different steps of development.

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 3


pment Institute - Internal Use
Introduce Configuration Classes
SPEM DOC_IntegrateSoftwareForEcuNesting

Diagnostic ECU
BSW Module Delivered Atomic Software
ECU Extract Extract
Delivered Bundle Components

Scope of Integrate Software for ECU activity:


Prepare ECU Configuration
1..* 1..* 1 0..1

• Prepare ECU Configuration «nesting»

• Configure BSW and RTE «input» «input» «input»


«input» Configure BSW and RTE
«nesting»

• Generate BSW and RTE


• Build Executable «nesting»

Update ECU Configuration

«nesting»

Integrate Software
for ECU «nesting»
Model ECU Timing

«output»

«nesting»

Generate BSW and RTE

ECU Software Delivered

Build Executable

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 4


pment Institute - Internal Use
ECU Configuration
ECU Configuration Activities: SPEM DOC_ECUConfiguration

• Prepare ECU Configuration


• Configure BSW and RTE «input»

ECU Extract
1

Prepare ECU
ECU
«output»
1
BSW Module Configuration
Configuration

• Generate BSW and RTE


Data Source Code
Configuration Values
«input» «output»

1..* 1 «input»
«output»
1
1

Generate BSW and RTE


BSW Module
1
Delivered Bundle BSW Module
Configuration
«inoutput» «output» Header File

Configure BSW and RTE


RTE Source Code

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 5


pment Institute - Internal Use
ECU Configuration
Input sources for ECU Configuration

ECU Extract:
• The ECU Extract is a description in the same format as the System Configuration
Description, but with only those elements included that are relevant for the
configuration of one specific ECU. (refer next page)

BSW Module Delivered Bundle:


• Deliverable containing one or more BSW modules delivered for integration (code
and ARXML descriptions).
• It can still contain blueprints for some of the elements which need to be extended
during ECU integration.

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 6


pment Institute - Internal Use
ECU Configuration
Input sources for ECU Configuration

System Configuration Description:


The System Configuration Description contains all relevant system-wide
configuration, such as:
• ECUs present in the system
• Communication systems interconnecting those ECUs and their configuration
• Communication matrices (frames sent and received) for those communication
systems.
• Definition of Software Components with their ports and interfaces and
connections (defined in the SWC Description and referenced in the System
Configuration Description).
• Mapping of SWCs to ECUs

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 7


pment Institute - Internal Use
ECU Configuration
SPEM DOC_PrepareEcuConfiguration

Prepare ECU
Configuration

Prepare ECU Configuration: Diagnostic ECU


Extract
«input»

0..1

• Extend ECU Extract for the 0..1


«input»
«nesting»

specific ECU by the Software


«input»
ECU Extract 1
Generate Base Ecu
«input» Configuration

Components and BSW 1


«nesting»
«output»

Modules. 1

• For each BSW module that «inoutput»

shall be present in the ECU, «input» 0..*

the implementation must be Define


Integration
Variant
Postbuild Variant
Set
ECU Configuration
Values

chosen. «output»

0..1
«output»

Predefined Variant

Evaluated Variant Set

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 8


pment Institute - Internal Use
ECU Configuration
SPEM DOC_ConfigureBswAndRteNesting

Configure BSW and RTE

Configure BSW and RTE:


«nesting»
Configure
Memmap
Allocation «nesting»
«nesting»

• The complete configuration can be Configure ECUC


«nesting»
Create Service
Component

performed at this activity.


«nesting»

«nesting» «nesting»

• Supported by an editing tool.


«nesting»
«nesting»
Connect Service Component
«nesting»
«nesting» «nesting»
«nesting» «nesting»

Configure OS

Configure Transformer

Configure RTE

Configure Com

Configure Watchdog
Manager

Configure IO Hardware Configure MCAL


Configure Mode abstraction
Management

Configure Diagnostics
Configure NvM

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 9


pment Institute - Internal Use
ECU Configuration
SPEM DOC_GenerateBswAndRteNesting

Generate BSW and


RTE

Generate BSW and RTE: «nesting»


«nesting»

• After the ECU Configuration is Generate BSW


Configuration Code
Generate SWC

completed, the BSW modules, Memory Mapping


Header
«nesting»

RTE, and OS source files are


«nesting»

«nesting»

generated. «nesting»
«nesting»
«nesting» Generate Compiler
Configuration

Generate OS

Generate RTE Prebuild


Dataset

Generate Local MC Generate BSW


Data Support Memory Mapping
Header
Generate RTE

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 10


pment Institute - Internal Use
Build Executable
SPEM DOC_BuildExecutableNesting

Build Action Manifest

Build Executable:
0..1

0..1
«input»
0..1 0..1
«input»

• The source code is compiled «output» 1..* 1..* «input» «output» 1

and linked along with all the


Compile ECU
Source Code ECU Object Code Generate ECU 1
ECU
Executable
Executable
«output»

applications, libraries, object


«input»

1
«input»

code etc. to build the ECU


Generation of the
0..1 executable for
Postbuild 0..*
Configuration Data is 0..1 «output»
«input»
not modeled here.

Executable. ECU
Configuration 1
Values «input»
1 Map of the ECU
Executable
Atomic Software
Component
Implementation

• The executable image


Measure Resources
«output»
«input» «output» 1
«input»

containing all the fully


Generate RTE 0..*
Postbuild Dataset RTE Postbuild
Variants Dataset

integrated software ready to BSW Module


Implementation
Extension

download to an ECU. «input»


Generate A2L
«output»

How to update the ECU? A2L File

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 11


pment Institute - Internal Use
Configuration Classes
 The development of BSW modules involve the following development cycles:
compiling, linking and downloading of the executable to ECU memory.

 Configuration of parameters can be done in any of these process-steps: pre-compile


time, link time or even post-build time.

According to the process-step that does the configuration of parameters, the


configuration classes are categorized as below:
• Pre-compile time
• Link time
• Post-build time

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 12


pment Institute - Internal Use
Categorize Configuration Classes
 Based on the affect/consequences of configuration parameters.

• If a configuration parameter is defined as precompile


time, after compilation this configuration parameter
can not be changed any more.

• If a configuration parameter is defined at post-build time


the configuration parameter has to be stored at a known
memory location.

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 13


pment Institute - Internal Use
Categorize Configuration Classes
 The configuration class of a parameter depends on the chosen implementation
variants of the BSW module it belongs to.

There are 3 Variants available for select:


• VARIANT-PRE-COMPILE
• VARIANT-LINK-TIME
• VARIANT-POST-BUILD

 Different configuration classes can be combined within one module.

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 14


pment Institute - Internal Use
Configuration Information
Container:
In case BSW modules support post-build variant, container will have “Post-Build Variant
Multiplicity” and “Multiplicity Configuration Class” attribute

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 15


pment Institute - Internal Use
Configuration Information
Parameter:
In case BSW modules support
post-build variant, parameter
will have following attributes:
• “Post-Build Variant
Multiplicity”
• “Post-Build Variant Value”

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 16


pment Institute - Internal Use
Pre-Compile Time
This type of configuration is a standalone configuration done before compiling the
source code:

• Parameter values for those configurable elements are selected before compiling
and will be effective after compilation time.
• The value of the configurable parameter is decided in earlier stage of software
development process and any changes in the parameter value calls for a re-
compilation.
• The contents of pre-compile time parameters can not be changed at the
subsequent development steps like link time or post-build time.

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 17


pment Institute - Internal Use
Pre-Compile Time
SPEM DOC_OverviewPreCompileConf

No existence of
unbound Pre-Compile

Approaches:
Possible existence of time variation points.
unbound Pre-Compile All Pre-compile time Link-time and post-
time variation points. variation points are build variation points
bound. may still be unbound.
1 1
Source code is
«input»

• Generating header completely


generated
«output»
BSW Module
Completely
Generated Source

files only. Generate BSW


Code

Compile «output»
1
Generated 1
Source Code BSW
«output» «input»
«input» 1..*
«output» Basic
Software
Module
1 1 Object Code
1
«input» «input»
1

• Generating header 1 1
BSW Module
Compile Configured BSW

and source files. «input» Configuration «input»


ECU Header File
«output» Link ECU Code after
Configuration
Values Precompile Configuration
1
«output» 1

Generate BSW
Only Precompile Possible existence of Basic
Configuration Configuration Header unbound Pre-Compile Software
header is time variation points. Module Core
generated Source Code
ECU Executable

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 18


pment Institute - Internal Use
Link Time
This type of configuration is done for the BSW module during link time:

• The object code of the BSW module receives parts of its configuration from another
object code file or it is defined by linker options.
• Link time parameters are typically used when delivering object code to the
integrator.

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 19


pment Institute - Internal Use
Link Time
SPEM DOC_OverviewLinkTimeConf

Possible existence of

Approach:
unbound Link time
variation points.

1 «input» «output» 1
Compile Unconfigured BSW

• Generation and compilation Basic Software


Module Core
«input»
Basic Software
Module Object Code
1..*

Source Code

of BSW Configuration Code. No existence of


unbound Link time
variation points.
Unbound Post-build

• Definition of configuration 1

1
variation points may
still exist.

data. Basic Software


Module Core
«input» «input»

• Separate compilation of
Header

module source and «input» 1 1 «input» «output» 1


1 «output»
Generate BSW
Configuration Code

configuration file.
BSW Module BSW Module 1..*
Compile BSW
Configuration Configuration No existence of
Configuration Data
Header File Data Object Code unbound Link time
ECU Configuration «output» variation points. Post-
Values «input»

• Linking process.
build variation points
may still be unbound.
«input»
1 1

• Re-generation in case of All Link time variation


points are bound.

configuration value changes. BSW Module


«output» 1
Configuration
Data Source Link ECU Code during
Code Link Time Configuration ECU Executable

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 20


pment Institute - Internal Use
Post-build Time
This type of configuration is possible after building the BSW module or the ECU
software:

• The BSW module gets the parameters of its configuration by downloading


a separate file to the ECU memory, avoiding a re-compilation and re-build of the
BSW module.

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 21


pment Institute - Internal Use
Post-build Time
SPEM DOC_OverviewPostBuildConf

Approach:
1 «input» «output» 1 1 «input» «output» 1

Generate BSW Postbuild Compile BSW


Configuration Code Configuration Data
ECU BSW Module BSW Module 1..*
Configuration Configuration Configuration
Values «output» Header File Data Object
«input»
Code «input»

• Generate BSW Post-build Configuration 1 1

Code.
Link ECU
Code during
Post-Build
«output»
Time
1
BSW Module
Configuration
Data Source
Code

«input»
1
Possible existence of BSW Module
unbound Post-build Configuration Data
time variation points. Loadable to ECU
Memory

1
Basic Software
«input»
Module Core
Header

«input»
«output»
«output» 1 0..* 1
Compile Unconfigured BSW
Generate
ECU
«input» Basic Software ECU Executable
Executable
1 Module Object
Code

Basic Software
Module Core
Source Code

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 22


pment Institute - Internal Use
Post-build Time
#include “Can.h”

/* for getting Can_ConfigType */


Post-build Handling: const Can_ConfigType MySimpleCanConfig_001 [2]= {
{
Can_BitTiming=0xDF,
Can_AcceptanceMask1=0xFFFFFFFF,
• Generating multiple post- Can_AcceptanceMask2=0xFFFFFFFF,
Can_AcceptanceMask3=0x00034DFF,
build configuration variants. Can_AcceptanceMask4=0x00FF0000
},
{

• Including different post-build }
};
variants.
/* for getting Can_ConfigType */
const Can_ConfigType MySimpleCanConfig_002 [2]= {
{
Can_BitTiming=0xDD,
Can_AcceptanceMask1=0xFFFFFFFF,
Can_AcceptanceMask2=0xFFFFFFFF,
Can_AcceptanceMask3=0x00034DFF,
Can_AcceptanceMask4=0x00FF0000
},
{

}
};

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 23


pment Institute - Internal Use
Update ECU Configuration
We consider primary ECU information are represented as configuration parameters.

 If value configuration class of parameter is Pre-compile time => follow Pre-Compile


approaches

 If value configuration class of parameter is Link time => follow Link approaches

 If value configuration class of parameter is Post-build time => follow the next pages
for approaching

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 24


pment Institute - Internal Use
Update ECU Configuration
SPEM DOC_OverviewPostBuildConfUpdate

Post-build scenario: (post-build


loadable) 1 «input» «output» 1 1 «input» «output» 1

Generate BSW Postbuild Compile BSW

• Initial ECU Configuration are Configuration Code Configuration Data


ECU BSW Module BSW Module 1..*
Configuration Configuration Configuration
Values «output» Header File Data Object
«input»

exist, “ECU Executable” and


Code

«input»

“BSW Module Configuration 1 1

Data Loadable to ECU


Memory” were built and BSW Module
Configuration
Data Source
Link ECU
Code during

loaded to ECU.
Code
Post-Build
Time
«output»

• Base of exist Initial ECU 1


«input»
1

Configuration, update post-


build time parameters. Possible existence of
unbound Post-build
time variation points.

• Re-compile and link the Basic Software


Module Core
BSW Module
Configuration Data
Header

Configuration Data Code.


Loadable to ECU
Memory

• Download to specific address


09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 25
pment Institute - Internal Use
Methodology
Following files should be available in Pre-compile variant:
File Information Example

<Msn>_Cfg.h - This file contain all preprocessor information #include “<Msn>.h”


(macros) #define LINIF_SPORADIC_BIT_ARR_SIZE 3
- This file contain variable/struct’s declaration, VAR(uint8, LINIF_VAR_NOINIT)LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE];
without extern

<Msn>_Cfg.c - Define variable/struct information #include “<Msn>_Cfg.h”


VAR(uint8, LINIF_VAR_NOINIT) LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE] = {
0x01, 0x02, 0x03
}

<Msn>.c - This file contain execution code #include “<Msn>_Cfg.h”


- Need to include the <Msn>_Cfg.h void Msn_SomeFunc (void) {
- User Configuration Data directly …
- Init API can be passed by NULL Pointer if (0x01 != LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE - 1]) {

}

}

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 26


pment Institute - Internal Use
Methodology
Following files should be available in Link Time variant:
File Information Example

<Msn>_Cfg.h - This file contain all preprocessor information #include “<Msn>.h”


(macros) that have value configuration class = #define LINIF_SPORADIC_BIT_ARR_SIZE 3
Pre-compile Time VAR(uint8, LINIF_VAR_NOINIT)LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE];

<Msn>_LCfg.h - This file contain all other configuration #include “<Msn>_Cfg.h”


variable/struct’s declaration that have value VAR(uint8, LINIF_VAR_NOINIT)LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE];
configuration class = Link Time
- Declare without extern

<Msn>_LCfg.c - Define all other configuration variables/structs #include “<Msn>_LCfg.h”


information that have value configuration class VAR(uint8, LINIF_VAR_NOINIT) LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE] = {
= Link Time 0x01, 0x02, 0x03
}

<Msn>.h - This file contain configuration variable/struct’s extern VAR(uint8, LINIF_VAR_NOINIT)LinIf_GaaBitData[];


declaration that have value configuration class
= Link Time
- Declare with extern

<Msn>.c - This file contain execution code #include “<Msn>_Cfg.h”


- Need to include the <Msn>_Cfg.h void Msn_SomeFunc (void) {
- No need to include the <Msn>_LCfg.h …
- Use Configuration Data directly if (0x01 != LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE - 1]) {
- Init API can be passed by NULL Pointer …
}

}

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 27


pment Institute - Internal Use
Methodology
Following files should be available in Post-Build Time variant:
File Information Example

<Msn>_Cfg.h - This file contain all preprocessor information #include “<Msn>.h”


(macros) that have value configuration class = #define LINIF_CHANNELS_COUNT 2
Pre-compile Time #define LINIF_SPORADIC_BIT_ARR_SIZE 3
VAR(uint8, LINIF_VAR_NOINIT)LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE];

<Msn>_LCfg.h - This file contain variable/struct’s declaration #include “<Msn>_Cfg.h”


that have value configuration class = Link Time VAR(uint8, LINIF_VAR_NOINIT)LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE];
- Declare without extern

<Msn>_LCfg.c - Define variable/struct information that have #include “<Msn>_LCfg.h”


value configuration class = Link Time VAR(uint8, LINIF_VAR_NOINIT) LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE] = {
0x01, 0x02, 0x03
}

<Msn>_PBCfg.h - May exclude because typedef of -


<Msn>_ConfigType already defined at
<Msn>.h

<Msn>_PBCfg.c - Contain definition of <Msn>_ConfigType struct #include “<Msn>.h”


data and its related information #include “<Msn>_Cfg.h”
CONST (LinIf_ChannelType, LINIF_CONFIG_DATA) LinIf_Channels[LINIF_CHANNELS_COUNT] = {

};
CONST(LinIf_ConfigType, LINIF_CONFIG_DATA) LinIf_ConfigSet = {
/* ChannelsConfig_ptr */ LinIf_Channels ,

};

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 28


pment Institute - Internal Use
Methodology
Following files should be available in Post-Build Time variant:
File Information Example

<Msn>.h - This file contain configuration variable/struct’s extern VAR(uint8, LINIF_VAR_NOINIT)LinIf_GaaBitData[];


declaration that have value configuration class
= Link Time. Those information will be
declared with extern

<Msn>.c - This file contain execution code #include “<Msn>_Cfg.h”


- Need to include the <Msn>_Cfg.h Msn_ConfigType * GpConfigPtr;
- No need to include the <Msn>_LCfg.h
- No need to include the <Msn>_PBCfg.h Void Msn_Init (Msn_ConfigType * ConfigPtr) {
- Use Link Time Configuration Data directly …
- Use Post-build Time Configuration Data via GpConfigPtr = ConfigPtr;
Config Pointer that has passed via Msn_Init() …
};
void Msn_SomeFunc (void) {
LinIf_ChannelType * LpChannelsConfig;

if (0x01 != LinIf_GaaBitData[LINIF_SPORADIC_BIT_ARR_SIZE - 1]) {

}

LpChannelsConfig = GpConfigPtr->ChannelsConfig_ptr;

}

09e-BM/DT/FSOFT - ©FPT SOFTWARE - Learning and Develo 29


pment Institute - Internal Use

You might also like