Model Merge Conflicts

On project load, DaVinci Configurator loads all referenced ARXML files into its internal model. When several files define the same AUTOSAR element, different conflict types can arise, especially if some ARXML files are not AUTOSAR-conformant.

DaVinci Configurator reports these conflicts in the Model Merge Report and categorizes each one as solvable or non-solvable. Every conflict needs either manual resolution or automatic resolution. DaVinci Configurator resolves solvable conflicts automatically only if you activate the optional feature.

DaVinci Configurator always treats non-solvable conflicts as errors that abort project load. The Model Merge Report lists both non-solvable and resolved conflicts.

Conflict Types

Table 1. Overview of Model Merge Conflict Types
Type Description Requires Manual Resolution

Invalid Model Split

An AUTOSAR element (splitable or non-splitable) is defined in multiple files, but the split is invalid.

Missing Variation Point

A splitable AUTOSAR element is defined multiple times, but one instance misses a (post-build) variation point.

Yes

Missing or Conflicting Short Labels in Variation Point

A splitable AUTOSAR element is defined multiple times, but the variation points differ in their short label.

Yes

Conflict Message Structure

The general structure of a conflict message in the Model Merge Report is as follows:

Outline of a conflict message
[AUTOMATIC MERGE APPLIED] "<winning value>" from <winning file> (1)

<conflict description> for "<AUTOSAR path>" (<element details>). (2)

Cause: <cause reason>. (3)

Priority (descending): [
 #<prio> <type>: <file path>: <startLine>[<column>] - <endLine>[<column>] (<info>) (4)
 ...
]
1 Resolution tag (if applied). One of:
  • [AUTOMATIC MERGE APPLIED]: DaVinci Configurator resolved the conflict automatically because Automatic Conflict Resolution is active.

  • [IMPLICITLY RESOLVED]: DaVinci Configurator resolved the conflict implicitly.

2 The Conflict Types and details about the conflicting element. The DefRef shows the definition reference, or - if it does not apply. For parameters and reference values, DaVinci Configurator also shows a multi-instance ID that distinguishes repeated instances of the same definition.
3 The cause of the conflict, with more detail depending on the type.
4 Information about every file involved in the conflict. For each file, from left to right:
  1. Priority number and source type

  2. File path (relative to the project root)

  3. Line and column range of the section that contains the conflicting element or its parent

  4. Optional extra information, for example the read-only state

The line and column information is a best-effort computation and has some limitations.

Example conflict message for an Invalid Model Split
[AUTOMATIC MERGE APPLIED] "baseTypeDefinition" from Output/Config/EcuExtract/EcuExtract.arxml
Invalid model split detected for "/DataType/uint32" (DefRef: -).
Cause: Element "baseTypeDefinition" is not splitable but has different child object in multiple files.
Priority (descending): [
 #9 IFP HarmonizedExtract EcuC: Output/Config/EcuExtract/EcuExtract.arxml: 24159[9] - 24164[24] (read-only)
 #3 DvDevC: Config/AppConfig/DataTypes.arxml: 1099[9] - 1112[24] (read-only)
]
Example conflict message for a parameter with a multi-instance ID
Invalid model split detected for "/ActiveEcuC/Can/CanGeneral" (DefRef: /AUTOSAR/Can/CanGeneral/CanDevErrorDetect, ID: "user;0").
Cause: The parameter is contained with different values (true <-> false).
Priority (descending): [
 #17 User-Authored EcuC: Config/EcuC/A.arxml: 14[17] - 25[46]
 #17 User-Authored EcuC: Config/EcuC/B.arxml: 14[17] - 33[46]
]

Resolve Conflicts

When a project load aborts, you must resolve the reported Model Merge conflicts. To avoid data loss, resolve them manually in the ARXML files whenever possible.

Manual Resolution

Resolve every conflict with the same general approach, then apply the type-specific fix below:

  1. Identify the AUTOSAR element and read the reported cause.

  2. Open each ARXML file listed in the conflict message and compare the conflicting instances.

  3. Apply the fix for the conflict type.

  4. Save the ARXML files and reload the project to verify that the conflict is gone.

If the conflicting element has a unique name or value, use your text editor’s search to find all instances. Variation points are hereditary, so check the parent elements as well.

Invalid Model Split

Invalid Model Split is the most common conflict. It arises when an AUTOSAR element (splitable or non-splitable) is defined in multiple files, but the split is invalid. DaVinci Configurator can solve this conflict with Automatic Conflict Resolution.

In the following example, the same ECUC-CONTAINER-VALUE is defined in two files, but its child ECUC-NUMERICAL-PARAM-VALUE has a different value in each.

File 1
<ECUC-CONTAINER-VALUE>
  <SHORT-NAME>test</SHORT-NAME>
  <DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/MICROSAR/.../ContainerX</DEFINITION-REF>
  <PARAMETER-VALUES>
    <ECUC-NUMERICAL-PARAM-VALUE>
      <DEFINITION-REF DEST="ECUC-PARAM-CONF-NUMERICAL-DEF">/MICROSAR/.../ContainerX/ParamA</DEFINITION-REF>
      <VALUE>1</VALUE>
    </ECUC-NUMERICAL-PARAM-VALUE>
  </PARAMETER-VALUES>
</ECUC-CONTAINER-VALUE>
File 2
<ECUC-CONTAINER-VALUE>
  <SHORT-NAME>test</SHORT-NAME>
  <DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/MICROSAR/.../ContainerX</DEFINITION-REF>
  <PARAMETER-VALUES>
    <ECUC-NUMERICAL-PARAM-VALUE>
      <DEFINITION-REF DEST="ECUC-PARAM-CONF-NUMERICAL-DEF">/MICROSAR/.../ContainerX/ParamA</DEFINITION-REF>
      <VALUE>2</VALUE>
    </ECUC-NUMERICAL-PARAM-VALUE>
  </PARAMETER-VALUES>
</ECUC-CONTAINER-VALUE>

Fix:

  • If the element is non-splitable, keep the correct data in one file and remove the other occurrences.

  • If the element is splitable, make sure each fragment holds only its allowed child elements and repeats no attributes or sub-elements that must be unique. Where needed, make shared values equal.

  • If the element is generated, correct the generating source.

Missing Variation Point

Missing Variation Point arises when a splitable element is defined in multiple ARXML files but one instance misses a (post-build) variation point, so DaVinci Configurator cannot decide which instances to merge.

This conflict is non-solvable and needs a manual fix.

The following example shows a missing variation point for the AUTOSAR element DELEGATION-SW-CONNECTOR in one of the ARXML files.

File 1
<DELEGATION-SW-CONNECTOR>
  <SHORT-NAME>Connector1</SHORT-NAME>
  <VARIATION-POINT>
    <SHORT-LABEL>VP_cf30ea21</SHORT-LABEL>
    <POST-BUILD-VARIANT-CONDITIONS>
      ...
    </POST-BUILD-VARIANT-CONDITIONS>
  </VARIATION-POINT>
  ...
</DELEGATION-SW-CONNECTOR>
File 2
<DELEGATION-SW-CONNECTOR>
  <SHORT-NAME>Connector1</SHORT-NAME>
  ...
</DELEGATION-SW-CONNECTOR>

Fix: Add the missing variation point to the incomplete instance, or remove the fragment if you do not need it.

Missing or Conflicting Short Labels in Variation Point

Missing or Conflicting Short Labels in Variation Point arises when a splitable element is defined in multiple ARXML files but its variation points differ in their short label, so DaVinci Configurator cannot decide which instances to merge.

This conflict is non-solvable and needs a manual fix.

The following example shows a variation point with the same matching criterion but different short labels in two ARXML files.

File 1
<VARIATION-POINT>
<SHORT-LABEL>A</SHORT-LABEL>
<POST-BUILD-VARIANT-CONDITIONS>
  <POST-BUILD-VARIANT-CONDITION>
    <MATCHING-CRITERION-REF DEST="POST-BUILD-VARIANT-CRITERION">/VariantDefinition/Criterion/A</MATCHING-CRITERION-REF>
    <VALUE>0</VALUE>
  </POST-BUILD-VARIANT-CONDITION>
</POST-BUILD-VARIANT-CONDITIONS>
</VARIATION-POINT>
File 2
<VARIATION-POINT>
<SHORT-LABEL>B</SHORT-LABEL>
<POST-BUILD-VARIANT-CONDITIONS>
  <POST-BUILD-VARIANT-CONDITION>
    <MATCHING-CRITERION-REF DEST="POST-BUILD-VARIANT-CRITERION">/VariantDefinition/Criterion/A</MATCHING-CRITERION-REF>
    <VALUE>0</VALUE>
  </POST-BUILD-VARIANT-CONDITION>
</POST-BUILD-VARIANT-CONDITIONS>
</VARIATION-POINT>

Fix: Give all matching variations the same short label, and remove or rename any conflicting labels.

Automatic Conflict Resolution

Automatic Conflict Resolution is a best-effort feature that you turn on per project. DaVinci Configurator then resolves solvable conflicts with a priority-based strategy: the value from the location with the higher priority wins, non-solvable conflicts still require manual resolution.

Automatic Conflict Resolution can overwrite data, which can lead to data loss. Check every automatic resolution carefully before you save the project.

Activation

Turn on this optional feature in the DaVinci Project Settings file General.json:

  {
     "allowMergeConflicts": true
  }
  1. Turn on the setting (see Activation) and reload the DaVinci Project. DaVinci Configurator creates a new Model Merge report.

  2. Review the automatically resolved conflicts in the report for correctness.

  3. If project load still aborts, resolve the remaining non-solvable conflicts manually, then reload.

  4. Save the DaVinci Project.

While Automatic Conflict Resolution is active, the Model Merge Report lists automatically resolved conflicts as warnings, implicitly resolved conflicts as notes, and non-solvable conflicts as errors.

Read-Only Files

The next DaVinci Project save writes automatically resolved values into the corresponding ARXML files, but only if those files are not read-only. DaVinci Configurator treats all files from the BSW Package and from other tools, such as DaVinci Developer Classic, as read-only.

A DaVinci Project save can only update internal files, because it cannot change read-only files.

If conflicts reoccur, fix external files manually or in the source tool (for example, DaVinci Developer Classic).

Some DaVinci Configurator CLI tasks can also trigger an automatic project save. For this reason, do not enable automatic conflict resolution by default for your projects.