🇻🇳 Tiếng Việt
Compare two AUTOSAR MATLAB/Simulink code-generation snapshots and focus on the changes that need review.
The tool filters generator noise that it can prove is harmless, then summarizes changes to generated C/C++, ARXML, RTE access and A2L objects.
If a difference cannot be proven to be noise, it remains a real change.
Download compare-tool.exe or compare_tool.pyz from the latest release. Both accept the options shown below.
To run from source:
git clone https://github.com/longvo92/codegen-compare-tool.git
cd codegen-compare-toolFor downloaded builds, replace python -m compare_tool with compare-tool.exe or python compare_tool.pyz.
Create a self-contained HTML report:
python -m compare_tool baseline current --report report.htmlPrint only a terminal summary:
python -m compare_tool baseline current --no-reportThe terminal mode shows a per-model Overview, AUTOSAR/A2L changes, consistency warnings, effective compare settings, hunk-classification totals and one summary for each non-identical file. Add --check-consistency to validate CURRENT generated RTE calls against CURRENT ARXML declarations. It does not print individual hunks, source diffs or create HTML.
Open the desktop viewer:
python -m compare_toolThe viewer requires PySide6. The CLI and compare_tool.pyz use only the Python standard library.
Folders and ZIP archives are accepted as inputs.
| Output | Use it for |
|---|---|
| Desktop viewer | Interactive side-by-side review |
| HTML report | Sharing or publishing as a CI artifact |
--no-report |
Detailed terminal review and diagnostics without generated files |
--json |
Structured pipeline processing |
--sarif |
Code-scanning annotations |
The comparison engine also reports:
- model/SWC ownership;
- ports, port interfaces, runnables and events;
Rte_*access points;- A2L
CHARACTERISTICandMEASUREMENTobjects; - possible incomplete regeneration across ARXML, A2L and generated C;
- generated RTE calls that disagree with CURRENT ARXML access declarations when
--check-consistencyis enabled.
Old/new regeneration warnings remain advisory. The optional CURRENT-tree check is disabled by default; when enabled, a fail finding exits 1, an incomplete consistency scan exits 2, and a warn finding does not change the exit code. No consistency result changes a file verdict.
| Verdict | Meaning |
|---|---|
| Modified | A real change needs review |
| Comment | Only comments changed |
| Unimportant | Only proven generator noise changed |
| Added / Deleted | The file exists on one side only |
| Identical | No difference |
| Not compared | The file could not be read or compared |
| Code | Meaning |
|---|---|
0 |
No real changes |
1 |
Real changes found |
2 |
Comparison incomplete or failed |
--exit-zero converts exit code 1 to 0. It never suppresses exit code 2.
- Python 3.8 or newer
- No server, database or network access at runtime
- PySide6 only for the desktop viewer
- Self-contained HTML reports with no CDN or external assets
- Usage Guide — commands, viewer controls, noise rules and CI
- Vietnamese documentation
Run python -m compare_tool --help for the complete CLI reference.
MIT © 2026 Long Vo Thien
