Create a Variant DaVinci Project
A variant DaVinci Project in AUTOSAR enables you to define and manage multiple ECU configurations within a single DaVinci Project. This approach supports different feature sets, hardware variants, or software options by leveraging variant sets and conditional configurations.
Prerequisites
Before you start, make sure the following components are installed:
-
DaVinci-AUTOSAR-JSON to create evaluated varaint sets.
-
EcuXPro to generate variant ECU extracts.
-
IDE Extensions provides IDE support and additional functionality.
Workflow For Creating a Variant DaVinci Project
The workflow for creating a variant DaVinci Project involves several interactions:
Specify Evaluated Variant Sets
AUTOSAR standardizes evaluated variant sets. With DaVinci-AUTOSAR-JSON, you can easily create evaluated variant sets using a simple JSON template.
Specify Evaluated Variant Set
-
Open VS Code and use Open Folder to select the folder containing your input files. This helps keep all files organized in one place. The folder itself does not affect how the input files are processed.
-
To create a Json-based variant definition file, go to and select New DaVinci-AUTOSAR-JSON File or right-click in the Explorer and choose New DaVinci-AUTOSAR-JSON File from the context menu. Select evaluated-variant-set from the context menu to define variants.
-
Choose either the detailed or compact variant file template to begin designing.
-
Both templates support evaluated variant sets and allow specifying a variant name or path.
-
The detailed template additionally supports criterion definitions from the start.
-
-
The variant definition file will be created in your folder as compact or detailed .evs.json and will appear in the Explorer.
This file is automatically associated with the appropriate JSON schema, enabling editing with autocomplition and validation.
To preview the ARXML content of the JSON file, click on ARXML Preview in the file’s title menu.
Convert Evaluated Variant Set
-
To generate an ARXML file from a variant definition file, select the file in the Explorer in VS Code and choose Convert to ARXML… from the context menu.
-
You will be prompted to choose a destination path and specify a file name for the converted ARXML file.
-
After you confirm the destination path and file name, the ARXML variant definition file will be generated.
With the generated ARXML variant definition file, you can derive your ECUC configuration in DaVinci Configurator Classic.
Generate a Variant ECU Extract
To create a variant DaVinci Project, you need a variant extract file. This file is automatically generated based on your input files and the evaluated variant sets.
-
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.
-
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.
-
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>.
-
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.
Create a DaVinci Project
Create easily a DaVinci Project via Visual Studio Code:
-
Create a project folder on your disc.
-
Open your project folder in VS Code.
-
With right click in your project folder explorer the menu will be open and select New DaVinci Project.
-
Select a BSW package for your project and click Select.
-
Give your project a name and click Create.
-
You will see that the project with .dvjson file-extension will be created.
For other methods to create a DaVinci Project, see: Project Creation Methods.
Derive Variant ECU Extract
The variant ECU Extract must be derived to an ECU Configuration in your DaVinci Project.
-
Navigate into DaVinci Configurator installation.
-
Execute command derive-ecuc. Add path of project file, your BSW and the ECU extract which shall be derived.
dvcfg-b project derive-ecuc -p="/Path/To/Your/ProjectFile" -b="/Path/To/Your/BSW" ecu-extract -
The command line will display a successful after ECU is derived. In your /Output/Config/EcuConfig an ecuc.Initial.arxml and in /Output/Config/EcuExtract an EcuExtract.arxml will be created.
-
For applying all changes and fixing model inconsistency after deriving an ECU extract it is recommended to update your project. Execute project update for your created and enriched project.
dvcfg-b project update -p="/Path/To/Your/ProjectFile" -b="/Path/To/Your/BSW" -acrThe ECU configuration will now be updated, automatic correction of unresolved or inconsistent references will be resolved, RTE configuration changes and input file changes.
Verify Variant Project Creation
After successfully creating your variant DaVinci Project, you can verify it by checking that the project structure matches the expected layout:
| Folder | Description |
|---|---|
Config |
Description files collection |
Input |
Contains input files for the input file processing or for transformers |
Output |
Contains all outputs that were generated or derived |
Settings |
Contains the project configuration settings |
.editorconfig |
helps to define and maintain consistent coding styles between different editors and IDEs |
.gitgnore |
Directories to be ignored from version control |
MyNewProject.dvjson |
DaVinci project file |