Static auditor for DBC communication matrices. 11 structural checks, two-revision diff, live frame decoding and CSV export — Python standard library only.
python skills/dbc-matrix-audit/scripts/dbc_analyze.py info matrix.dbc
python skills/dbc-matrix-audit/scripts/dbc_analyze.py messages matrix.dbc
python skills/dbc-matrix-audit/scripts/dbc_analyze.py lint matrix.dbc
python skills/dbc-matrix-audit/scripts/dbc_analyze.py decode matrix.dbc 0x1D2 1234052a00000000
python skills/dbc-matrix-audit/scripts/dbc_analyze.py export matrix.dbc --csv inventory.csv
python skills/dbc-matrix-audit/scripts/dbc_analyze.py diff old.dbc new.dbc
| Code | Severity | Meaning |
|---|---|---|
ENC-001 | error | File is not UTF-8 (typically GBK comments) |
BIT-001 | error | Two signals in one frame occupy the same bit |
RNG-001 | error | Signal extends past the frame length |
DLC-001 | error | Illegal DLC |
ENU-001 | warn | ENUM attribute assigned a numeric index |
SYM-001 | warn | Left/right signal sets (L/R, A/B, FL/FR…) are asymmetric |
TYP-001 | warn | Same signal spelled differently once the side token is removed |
DUP-001 | warn | Signal name reused across frames |
STA-001 | info | Many signals have no GenSigStartValue |
NOD-001 | info | Transmitting node not declared in BU_ |
VAL-001 | info | Short signal (≤4 bit) has no value table |
Comparing two matrix revisions produces 14 distinct codes. Two miss patterns are handled deliberately:
CM_ comment
(CRC16 checksum (DataID: 0x61D2)), so a plain comment diff
reports info. The tool regex-extracts it and escalates to
error — every receiver will reject the whole frame.
Renames are matched by bit definition, so Bus_Off_Count →
Bus_Off_Cnt is one DIF-REN, not a delete plus an add.
$ dbc_analyze.py lint demo_broken.dbc
[E] BIT-001 ACM_B_Supply_Voltage and ACM_B_Temperature occupy overlapping bits (0x201 ACM_B_Status)
[E] DLC-001 illegal DLC 13 (0x500 Log_Snapshot)
[E] ENC-001 file is not valid UTF-8 (detected: gbk)
[E] RNG-001 Log_Word_4 extends past the frame length (0x500 Log_Snapshot)
[W] DUP-001 signal name Node_Status_Counter appears in 2 frames
[W] ENU-001 1 ENUM attribute assignments use numeric indices
[W] SYM-001 ACM_A_Status / ACM_B_Status are not symmetric (0x200 vs 0x201)
[W] TYP-001 same signal spelled differently (beyond the side token)
ACM_X_Projection_State vs ACM_X_Projection_statE
summary: 4 error, 4 warn, 2 info