How to compare two ARXML files
A new ECU extract arrives and you must say what changed before integrating it: which signals moved, which PDUs grew, which frame IDs changed. A text diff is the wrong tool for that. Here is why, and how to get the real list.
Why a text diff is the wrong tool
Exporting tools regenerate UUIDs, reorder elements, change indentation and timestamps. Between the two sample extracts of ARXML Compare (an ECU extract, version 1 and version 2, with new UUIDs), git diff --no-index --numstat counts 1,140 changed lines: 605 added, 535 removed.
The real changes are 23. And a text diff cannot tell you that a signal moved from one PDU to another: it shows a block removed in one place and a block added elsewhere.
Compare by AR-PATH, not by line
- Match each element by its AR-PATH, the path of SHORT-NAMEs from the root, so the order of the file does not matter.
- Ignore UUIDs, ADMIN-DATA and timestamps, and by default descriptions: they change at each export.
- Compare numbers by value: 0x2A1 and 673 are the same CAN ID, 0x10 and 16 the same value.
- Follow the references: a signal's PDU and start bit live in the mapping of the PDU, a frame's ID in its triggering.
- Know the limits: a renamed or moved element shows as removed and added, and variants are compared as written.
Step by step in VS Code
- Install ARXML Compare, free, from the VS Code Marketplace.
- Select the old and then the new file in the Explorer, right-click, “Compare Selected ARXML Files”. For an extract split into several files, open each folder as one model.
- The free version shows how many signals, PDUs, frames, ports and components were added, removed or modified, or that nothing changed.
- Pro shows each change with its before and after values, opens it at its line in either file, lists the ports affected by a changed interface, and writes the report to Excel, CSV or HTML.
A real example
The mapping of the signal DoorLockSts_FL in version 1, inside PDU BCM_Status_01:
<I-SIGNAL-TO-I-PDU-MAPPING UUID="u-00000096"> <SHORT-NAME>DoorLockSts_FL_ISM</SHORT-NAME> <I-SIGNAL-REF DEST="I-SIGNAL">/NovairSample/Signals/DoorLockSts_FL</I-SIGNAL-REF> <PACKING-BYTE-ORDER>MOST-SIGNIFICANT-BYTE-LAST</PACKING-BYTE-ORDER> <START-POSITION>12</START-POSITION> <TRANSFER-PROPERTY>TRIGGERED-ON-CHANGE</TRANSFER-PROPERTY> </I-SIGNAL-TO-I-PDU-MAPPING>
The same mapping in version 2, with a new UUID, now inside PDU BCM_Status_02:
<I-SIGNAL-TO-I-PDU-MAPPING UUID="v-000000a2"> <SHORT-NAME>DoorLockSts_FL_ISM</SHORT-NAME> <I-SIGNAL-REF DEST="I-SIGNAL">/NovairSample/Signals/DoorLockSts_FL</I-SIGNAL-REF> <PACKING-BYTE-ORDER>MOST-SIGNIFICANT-BYTE-LAST</PACKING-BYTE-ORDER> <START-POSITION>4</START-POSITION> <TRANSFER-PROPERTY>TRIGGERED-ON-CHANGE</TRANSFER-PROPERTY> </I-SIGNAL-TO-I-PDU-MAPPING>
What ARXML Compare counts between the two files (free):
Before: novair-sample-body-ecu_v1.arxml
After: novair-sample-body-ecu_v2.arxml
291 elements compared by AR-PATH
Signals 4 added 2 removed 6 modified
PDUs 1 added 0 removed 2 modified
Frames 0 added 0 removed 3 modified
Ports and interfaces 1 added 0 removed 1 modified
Components 0 added 0 removed 1 modified
Other 0 added 1 removed 1 modified
Total: 23And the first changes it lists, with their before and after values (Pro):
modified AmbLightDimLvl Factor: 0.4 -> 0.5
modified DoorLockSts_FL PDU: BCM_Status_01 -> BCM_Status_02; Start bit: 12 -> 4
removed FogLampRearSts PDU: BCM_Status_02 -> -; Start bit: 48 -> -
modified HornReq Transfer property: PENDING -> TRIGGERED-ON-CHANGE
modified IntLightDimLvl Factor: 0.4 -> 0.5
removed KeyFobBattLow PDU: BCM_Status_01 -> -; Start bit: 24 -> -
added RearDefrostSts PDU: - -> BCM_Comfort_03; Start bit: - -> 0
added SeatHeatLvl_FL PDU: - -> BCM_Comfort_03; Start bit: - -> 8
added SeatHeatLvl_FR PDU: - -> BCM_Comfort_03; Start bit: - -> 16So: DoorLockSts_FL moved from BCM_Status_01 to BCM_Status_02, start bit 12 to 4; frame FR_BCM_Lights_01 changed its ID from 0x2A1 to 0x2A4; and in the ports, interface If_SR_0 changed a data element type from uint8 to uint16, which affects one port that did not change itself.
What is compared, and what is not
Compared: signals, PDUs, frames (CAN, CAN FD, LIN, FlexRay), ports and interfaces, software components, and every other element that has a SHORT-NAME, by AR-PATH and in any order. Ignored: UUIDs, ADMIN-DATA, timestamps and, by default, descriptions. Not compared: ECUC configuration values. A renamed or moved element shows as removed and added. Variants are compared as written, not resolved. Tables read AUTOSAR 4 files (schema r4.0); AUTOSAR 3 files open in the tree only. Ethernet: PDUs only, with no table for sockets or SOME/IP services (their changes appear under Other).
Errors and warnings during a comparison
The messages ARXML Compare shows, produced by its own code from its test files:
- One side is not well-formed XML: “Comparison stopped: malformed.arxml is not well-formed XML at line 290, column 17. A partial file is never compared.”
- The same file on both sides: “Before and after are the same files. Choose two different versions.”
- Before and after use different AUTOSAR schemas: “Before and after use different schemas (AUTOSAR_323 → AUTOSAR_00051). Elements are compared by AR-PATH: an element type renamed between schemas shows as removed and added.”
- An extract split into files that disagree: “/Conf/Shared is defined differently in a.arxml (line 9) and b.arxml (line 9). The comparison uses a.arxml.”
A comparison never runs on a partial file: if one side is not well-formed, it stops and says where.
Frequently asked questions
Can I compare two ARXML files online?
Yes: https://arxml-compare.novair.app/tools/compare-arxml-online/ compares two files in your browser, up to 60 MB each, and counts the changes by domain. Your files are not sent anywhere.
Can I compare ECUC configuration files?
Not their values: ECUC configuration values are not compared. The comparison covers signals, PDUs, frames, ports and interfaces, components and every other element with a SHORT-NAME.
Can I compare an AUTOSAR 3 file with an AUTOSAR 4 file?
Elements are still matched by AR-PATH, and ARXML Compare warns that the schemas differ: an element type renamed between schemas shows as removed and added.
Open your own extract in VS Code
ARXML Compare is free in VS Code: tree, AR-PATH search, references, tables of signals, PDUs and frames, and the number of changes between two versions. Pro lists each change with its before and after values and writes the report to Excel, CSV or HTML. Your files stay on your machine.