Generate ECU Extract

Once the required components are in place and the tool is successfully installed, you’re ready to generate the ECU extract. For deriving an ECU Configuration (Derive ECU-C), you need an ECU Extract. The purpose of this section is to guide you through the generation of an ECU Extract using EcuXPro. The EcuXPro allows you to generate this ECU Extract out of one or multiple input files which might be of different types.

Follow the steps below to ensure a smooth and accurate generation process.

Analyze Input Files

Before starting the generation process, it’s crucial to analyze the input files you have. The EcuXPro provides the analyze command to help you with this task. This command inspects the provided input files and generates a detailed report about how to proceed further. The result of this analysis can either be saved in a shell script file (for windows command line or linux shell bash) or can be printed directly to the console. This way, the result consists of a set of commands that you can use to generate the ECU Extract.

How to use the Analyze Command

To generate an invariant ECU extract follow the steps below to create the extract correctly.

  1. Navigate into installation path of the DaVinci Configurator Classic into the folder EcuXPro. By adding all files and the output folder which shall contain the generated ECU Extract to be generated later, you will be provided as a result of this command a suggestion of commands. If legacy files are input as well, then you need to install the Legacy Converter tool, or you will have to provide its path using the option -c. Depending on the shell type you want, you must specify the output format you want, using the option --output-format. Currently, you can choose between shell_cmd (for Windows Command Line) and shell_bash (for Linux Shell Bash). Setting a value for the option save-script will save the generated commands into a script file instead of printing them to the console." Below is an example command structure:

    Analyze Command
    ecuxpro analyze -f file1.arxml,file2.arxml,file3.ldf,file4.arxml,file5.dbc -o="Path\To\Generated\Ecu\Extract" -c="Path\To\Legacy\Converter" --output-format=shell_cmd --save-script="Path\To\Save\ScriptFile.bat"

The input file order is relevant, because a strict order of processing is applied to the files in case of the merge command, which is suggested as a result of the analysis of several input files. So changing the order of input files might change the result of the merge. Only for legacy communication files that might be used grouped together with several DBC, LDF, FIBEX files, we would assume for the converted ARXML the file order of the first legacy communication file in the list.

  1. The result of this command will be a script file containing a set of ready-to-run commands that you can use to generate your ECU extract. Before running the script, you might need to set some variables in the script file, especially the ECU Instance Names.

  2. If you haven’t provided the option --save-script, then you have to copy suggested ready-to-run commands in the console output to generate an ECU Extract out of your input files. In this case, paste the ready-to-use commands from the console into your terminal or build task script and execute it to generate your ECU extract.

    Ready-to-use Commands
    ecuxpro merge -i="D:\DEV\Workspaces\VectorDemo\Input\OEMInput\Preprocessing\EthernetCluster.arxml" -i="D:\DEV\Workspaces\VectorDemo\Input\OEMInput\Preprocessing\DiagnosticData.arxml" -i="D:\DEV\Workspaces\VectorDemo\Input\OEMInput\Preprocessing\MyECU_LdCom_PW_Transformer.arxml" D:\DEV\Workspaces\MyProject\InvariantMerged.arxml

In both cases, the result is a generated ECU Extract which is now available in the specified output folder.

How does the input file order affect the suggested merge command result?

Considering the above Analyze Command example, the suggested merge command would look like this:

ecuxpro merge -i="file1.arxml" -i="file2.arxml" -i="file3.ldf" -i="file4.arxml" "Path\To\Generated\Ecu\Extract\InvariantMerged.arxml"

This means that the first ARXML file is considered as the base file, and the elements of the following files are merged into these base elements. Also, all legacy communication files are converted together and merged into the first legacy communication file in the list, which in turn is merged into the first ARXML file in the list. If the first legacy communication file is the first file in the list, then the converted ARXML of this legacy communication file is considered as the base file for the merge of all other files. Therefore, changing the order of input files might change the result of the merge, as there are four special elements which are allowed to exist only once in an ECU Extract model:

  • System

  • ECU-Instance

  • Root-Sw-Component-Prototype

  • Composition-Sw-Component-Type

Analyzing Input Files for Variant ECU Extract

  1. For the special use case of a variant ECU project (several Input File Sets), you need to provide additional information to correctly specify your variants, as the analyze command expects also the option -e to be set to specify an Evaluated Variant Set (EVS) file. This EVS contains among other information the Post-Build Variant names. See Create Evaluated Variant Set for more information about creating an EVS.

  2. Retrieve the information from your EVS file. If you have an EVS and don’t know all the Post-Build Selectable variants contained within it, you can use the following command to query Post-Build variant names within your EVS.

    ecuxpro evs-info -e="/Path/To/EVS.arxml"

    The console will display the possible variants in your EVS file, for example: FrontLeft and FrontRight.

  3. Run the analyze command to get suggestions for ready-to-run commands. Add your variant names along with the input files you want to include in each variant. Please note that here the additional option -e is used to specify the EVS file.

    ecuxpro analyze -f FrontLeft=<file1> -f FrontRight=<file2>,<file3> -o="/Path/To/Generated/Ecu/Extract" -c="/Path/To/Legacy/Converter" -e="/Path/To/EVS.arxml" --output-format=shell_cmd --save-script="/Path/To/Save/ScriptFile.bat"

    In this example, the variant FrontLeft is assigned to <file1>, and FrontRight is assigned to <file2> and <file3>.

  4. Executing the command will generate a script file containing ready-to-run commands for generating your variant ECU Extract. The execution of the script file will create the variant ECU Extract in the specified output folder. Please make sure that you set all variables in the script file before executing it.

How to use the Analyze-Migration Command

During the project migration, a file called file_preprocessing_data.json is generated and contains information about the input files of the migrated project. See Ecu Extract Producer Support for more information about this. If one wants to change or process the original input files of the migrated project and this way, to generate an ECU extract out of the original input files, then the EcuXPro can be used to analyze the input files and to generate a set of ready-to-run commands. The command can be used for generating variant as well as invariant ECU extracts, depending on the input files and the content of the file_preprocessing_data.json. This command is quite similar to the analyze command described in the section How to use the Analyze Command, with the only difference that it doesn’t require any input files to be provided with the -f option, as the input files are listed in the file_preprocessing_data.json file. This file is provided using the --migration-instruction option. Besides that, the same options for the output folder and the Legacy Converter tool as well as the output format and saving the generated commands in a script file are available as well. Like for the analyze-command, navigate into the installation path of the DaVinci Configurator Classic into the folder EcuXPro and execute the command with the options you need. Below is an example command structure for analyzing the input files of a migrated project:

Please make sure that the file_preprocessing_data.json file is used at the location where it was generated during the migration process, as this is relevant for the paths of the referenced input files to be resolved correctly. Also, do not modify the content of this file, as it contains information like processing order which is relevant for the result of the suggested commands and therefore, the generation of the ECU Extract.

Analyze-migration Command
ecuxpro analyze-migration --migration-instruction -o="Path\To\Generated\Ecu\Extract" -c="Path\To\Legacy\Converter" --output-format=shell_cmd --save-script="Path\To\Save\ScriptFile.bat"

The processing order of the files by the EcuXPro is almost the same as the in with the DaVinci Configurator Classic Version 5. Following describes how it is done in case of the merge command which is suggested as a result of the analysis of several input files:

  • The file file_preprocessing_data.json contains for each input file an attribute order which is taken from the <Display> section of the DPA and defines the order in which a file was added to the project. The input files are processed in the order of this attribute, starting with the lowest value, but with some other grouping criteria.

  • All the given legacy communication files are grouped together, converted into an ARXML file and placed at the very last position when merging all files. For legacy communication files, the order attribute is used to define which legacy communication file shall serve as the base file for conversion.

  • Each System Description file is processed separately into an ECU Extract and merged at the end, just before the legacy communication file. The order attribute is used for defining how System Description files are ordered among each other.

  • All other files are merged according to their order attribute only. Meaning that ECU Extract files for example are merged before System Description files and legacy communication files even if they have a higher order attribute.

  1. Like for the analyze command described in the section How to use the Analyze Command., the result of this command will be a script file containing a set of ready-to-run commands that you can use to generate your ECU extract. Before running the script, you might need to set some variables in the script file, especially the ECU Instance Names.

  2. If you haven’t provided the option --save-script, then you have to copy suggested ready-to-run commands in the console output to generate an ECU Extract out of your input files. In this case, paste the ready-to-use commands from the console into your terminal or build task script and execute it to generate your ECU extract.

Considering the above Analyze-migration Command example and assuming that the file_preprocessing_data.json contains the following input files:

File name Order Content type

fileA.dbc

1

Legacy Communication

fileB.arxml

2

System Description

fileC.arxml

3

ECU Extract

fileD.arxml

4

System Description

fileF.ldf

5

Legacy Communication

fileF.arxml

6

ECU Extract

The suggested merge command would look like this:

Merge command
ecuxpro merge -i="fileC.arxml" -i="fileF.arxml" -i="fileB_Extracted.arxml" -i="fileD_Extracted.arxml" -i="fileA_Converted.arxml" "Path\To\Generated\Ecu\Extract\VariantMerged.arxml"

For more information about the result of the analyze-migration command, the suggested commands and how the file order might affect the merge command result, please refer to the section How to use the Analyze Command.

The EcuXPro supports various input file formats. The table below gives an overview of the supported formats.

Allowed Input File Formats

Table 1. Allowed Input Files Formats in EcuXPro
Format Name

arxml

AUTOSAR XML Format

dbc

Database CAN

ldf

LIN Description File

fibex

Field Bus Exchange Format

vsde

Vector System Description Extension

  • Please note that Legacy Diagnostic data formats (.odx, .pdx, .cdd, .data, .csv) cannot be processed by the EcuXPro but require the use of the DDM (see How to Create a DDM ECU Configuration) instead.

  • The Legacy Communication data formats (.ldf, .dbc, .fibex, .vsde) can be processed by the EcuXPro only when the Legacy Converter is installed or its path is provided during the analysis. For more information about the Legacy Converter. You will find the Technical Reference for the Legacy Converter tool within its installation directory, under Documentation.

Run Individual Features

If you already know what you need, you can call the commands directly. Common features include:

  • extract-sysd: Extract all elements related to a single ECU out of the System Description given by the input file and save the result in the specified output file. For this command, you need to provide the ECU Instance Name using the option -e.

    Example Command
    ecuxpro extract-sysd -i <file1> -e=Ecu /Path/To/Generated/Ecu/ExtractedEcu.arxml
  • merge: Merge the given input files into one ECU Extract which is saved into the specified output file. The order of the input files is relevant, as the elements of the first one are considered the base elements, and the elements of the following input files are merged into these base elements. So changing the order of input files might change the result of the merge.

    Example Command
    ecuxpro merge -i <file1> -i <file2> -i <file3> /Path/To/Generated/Ecu/MergedEcu.arxml
  • run-script: Execute the given script file(s) on the given input file and save the result in the specified output file. With the option -l, you can specify either a script file or a directory containing one or more script files. Only scripts with the task type DV_ON_ECU_EXTRACT_PRODUCER are considered. You might define multiple tasks and arguments in one script file and pass them as option to this command.

    Example Command
    ecuxpro run-script -i <file1> -l /Path/To/ScriptLocation -t taskName -a "taskName" -a "-nameArgument argumentValue" /Path/To/Modified/File.arxml
  • variant-merge: Merge the given input files into one variant ECU Extract which is saved into the specified output file. The option -f allows you to specify as many file sets as there are Post-Build variants in the project. You can define more than one file for each variant (file set) by separating the input files paths with a comma. The option -e allows you to specify the EVS file which contains the Post-Build variant names and you can define the Merge Configuration file using the option -m.

    Example Command
    ecuxpro variant-merge -f <variant-name1>=<file1> -f <variant-name2>=<file2> -e /Path/To/EVS.arxml -m /Path/To/Merger/Config/File.xml /Path/To/Variant/Ecu/Extract/File.arxml

Next Steps

You have successfully generated an ECU Extract. To continue, proceed with the next step:

This will allow you to derive the corresponding ECU Configuration and integrate it into your project.