10 / 10

ConnectX-6 Dx Zephyr Ethernet Driver

ISO 26262 Compliance Toolkit

Achieving Zero MISRA C:2023 Violations

From Scan โ†’ to Certification

Parasoft C/C++test Amp AI Fixing PyQt6 Dashboard MC/DC Coverage ISO 26262

Swipe or use arrows to navigate โ†’

The Three-Phase Workflow

๐Ÿ” PHASE 1: SCAN

Parasoft scans all source
against MISRA C:2023
Output: XML violation report

โ†’

โš–๏ธ PHASE 2: TRIAGE

Classify each violation:
Fix ยท Deviate ยท Suppress
Amp AI generates fixes

โ†’

โœ… PHASE 3: VERIFY

Re-scan confirms zero violations
Generate GCS + GRP docs
MC/DC coverage โ‰ฅ 80%

โ™ป๏ธ Iterate until: 0 Driver Violations + All Deviations Documented + Coverage Met

Phase 1 โ€” Scanning

Step 1: Generate BDF

cpptesttrace west build \
  -b native_sim /path/to/driver \
  -- -DCONFIG_ETH_CX6_DX=y \
     -DUSE_CCACHE=0

Step 2: MISRA Scan

cpptestcli \
  -config "builtin://MISRA C 2023 \
    (MISRA C 2012)" \
  -bdf cx6_build.bdf \
  -resource cx6_driver \
  -compiler gcc_13-64

โš ๏ธ Critical: ccache Interference

Zephyr's ccache.cmake wraps compiler calls, corrupting the BDF. Fix: always pass -DUSE_CCACHE=0.

BAD: ccache /usr/bin/gcc -DCONFIG... โ†’ "invalid option"
FIX: west build ... -- -DUSE_CCACHE=0

Source Classification

๐ŸŸข Driver

HIGH

Must reach zero violations

๐ŸŸฃ RTOS

LOW

Zephyr framework โ€” not our scope

โšช Build

Info

Excluded from metrics

Phase 2 โ€” The Dashboard

10-tab PyQt6 application (5,591 lines) for complete MISRA compliance management:

๐Ÿ“Š
Overview
Violation trends
๐Ÿ”
Violations
Filterable table
๐Ÿ“‹
Deviations
Formal permits
โœ…
Compliance
GCS / GRP docs
๐Ÿšซ
Suppressions
False positives
๐Ÿ“
Diff
Change tracking
๐Ÿงช
Unit Tests
JUnit XML
๐Ÿ“ˆ
Coverage
LC/SC/DC/MC-DC
๐Ÿ’ป
Terminal
Amp AI prompts
โš™๏ธ
Settings
Tool config

Key Features

Stacked Bar Charts

โ–  Driver bright segments, โ–ค RTOS dimmed with purple stripes. Delta indicators show scan-to-scan improvement.

Source-Aware Filtering

Filter by All, Driver, or RTOS. Subsystem dropdowns dynamically update (cx6_pcie, kernel, net/ip, etc.).

Fixing with Amp AI

๐Ÿค– How It Works

  1. Research the MISRA rule via CandleKeep skill (looks up rule text in the standard)
  2. Read the violating file and understand context
  3. Apply a minimal fix following coding conventions
  4. Verify the fix compiles with Zephyr build

โœ… Required Patterns

/* goto-cleanup single return */
int32_t func(args) {
    int32_t ret = 0;
    if (error) {
        ret = -EINVAL;
        goto out;
    }
out:
    return ret;
}

โŒ Prohibited

/* Multiple returns */
if (x) return -1;

/* Dynamic allocation */
buf = malloc(size);

/* Bare types */
int count;
unsigned len;

Example Prompt

Use candlekeep to research MISRA C:2023 Rule 10.3.
Fix violation in cx6_device.c line 148: "Value assigned to narrower essential type"
Constraints: goto-cleanup, fixed-width types, no malloc, verify with west build.

Formal Deviations

ISO 26262 allows deviations with documented safety rationale for unavoidable patterns.

7 Zephyr-Specific Categories

CodeCategoryUsed For
HWIHardware InterfaceMMIO pointer-integer casts
ZAPZephyr API PatternCONTAINER_OF, K_WORK_INIT
PERPerformanceData-path function-like macros
CEXCompiler ExtensionGCC __attribute__ (aligned, section)
ESMEquiv. Safety MeasureAlternative safety mechanisms
DRVDriver ArchitectureStatic single-device instance
DBGDebug OnlyLOG_* stdio-like formatting

Pre-Populated Deviations

RuleCatJustification
11.4HWIMMIO register access requires pointer-integer casts
11.3ZAPZephyr CONTAINER_OF() uses pointer-to-struct casts
20.7ZAPZephyr macros don't parenthesise all parameters
Dir 4.9PERData-path helpers use function-like macros
21.6DBGZephyr LOG_* uses stdio internally

Phase 3 โ€” Verification

๐Ÿ“‹ GCS

Guidelines Compliance Summary โ€” per-rule status:

  • Compliant โ€” no violations
  • Deviated โ€” formal permit filed
  • N/A โ€” rule doesn't apply

๐Ÿ“‘ GRP

Guidelines Re-categorization Plan โ€” re-classify Advisory rules:

  • Promote to Required based on risk
  • Disapply with documented justification

Coverage Requirements (ISO 26262 Table 12)

ASILMethodTarget
ASIL AStatement Coverageโ‰ฅ 80%
ASIL BBranch / Decision Coverageโ‰ฅ 80%
ASIL CMC/DCโ‰ฅ 80%
ASIL DMC/DCโ‰ฅ 80%

58 Unit Tests ร— 5 Modules

cx6_pcie ยท cx6_device ยท cx6_queue ยท cx6_interrupt ยท cx6_eth โ€” with fake MMIO stubs for host testing and gcov / cpptestct coverage collection.

Path to Zero Violations

๐Ÿ”ง

Fix

Code change resolves the violation

๐Ÿ“‹

Deviate

Formal permit with safety rationale

๐Ÿšซ

Suppress

False positive โ€” tool limitation

Violation Burndown

110
Scan 1
78
Scan 2
42
Scan 3
18
Scan 4
5
Scan 5
0
Final โœ…

๐ŸŽฏ Target: Zero Driver Violations

All flags documented ยท Coverage targets met ยท GCS/GRP generated

Setup & Quick Start

Prerequisites

  • Python 3.10+ with PyQt6
  • Parasoft C/C++test (Standard or Pro)
  • Zephyr SDK 0.16.8+ with west
  • GCC 13 for host testing
  • Driver project built at least once

Launch

pip install PyQt6

cd dashboard
python cx6_misra_dashboard.py

# First-time:
# Settings โ†’ Project Dir
# Settings โ†’ cpptestcli path
# Settings โ†’ ZEPHYR_BASE
# Overview โ†’ โ–ถ Run Scan

Project Structure

FilePurpose
dashboard/cx6_misra_dashboard.pyMain app โ€” 5,591 lines, 10 tabs, dark theme
dashboard/misra_rule_data.pyMISRA rules, severities, fix strategies
dashboard/app_logo.pngConnectX-6 Dx / NVIDIA logo
misra_compliance/config/Settings + MISRA overlay Kconfig
misra_compliance/deviations/Formal deviation database (JSON)
misra_compliance/reports/Parasoft XML scan results (auto)
misra_compliance/sessions/Session persistence (auto)

Summary

5,591
Lines of Dashboard Code
10
Dashboard Tabs
110
Violations Found (Scan 1)
7
Deviation Categories
58
Unit Tests
80%
MC/DC Coverage Target

Scan โ†’ Triage โ†’ Fix โ†’ Verify โ†’ Repeat

A complete, auditable workflow for achieving
Zero MISRA C:2023 Violations
on the ConnectX-6 Dx Zephyr Ethernet driver.

ISO 26262 Compliance Toolkit โ€” March 2026
Designed for automotive safety engineers and ISO 26262 auditors.