AUTOSAR-AGENT-SKILLS ← Overview GitHub

dbc-matrix-audit

Static auditor for DBC communication matrices. 11 structural checks, two-revision diff, live frame decoding and CSV export — Python standard library only.

v1.3.111 checks14 diff codes 0 dependenciesMIT

Commands

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

Checks

CodeSeverityMeaning
ENC-001errorFile is not UTF-8 (typically GBK comments)
BIT-001errorTwo signals in one frame occupy the same bit
RNG-001errorSignal extends past the frame length
DLC-001errorIllegal DLC
ENU-001warnENUM attribute assigned a numeric index
SYM-001warnLeft/right signal sets (L/R, A/B, FL/FR…) are asymmetric
TYP-001warnSame signal spelled differently once the side token is removed
DUP-001warnSignal name reused across frames
STA-001infoMany signals have no GenSigStartValue
NOD-001infoTransmitting node not declared in BU_
VAL-001infoShort signal (≤4 bit) has no value table

Revision diff

Comparing two matrix revisions produces 14 distinct codes. Two miss patterns are handled deliberately:

Renames are matched by bit definition, so Bus_Off_Count → Bus_Off_Cnt is one DIF-REN, not a delete plus an add.

Example output

$ 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
Exit code is 1 when any error is reported, so the command drops straight into a CI step or a pre-commit hook.