Zero Overhead Code Coverage via Hardware CRC Circuit

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing code coverage analysis methods for microcontrollers are invasive and resource-intensive, causing disruptions in timing-critical and resource-constrained systems, which prohibits effective testing of safety-critical code without adding overhead or altering program flow.

Innovation Solution

A cyclic redundancy check (CRC) circuit is implemented within or communicatively coupled to the microcontroller to perform code coverage analysis without using execution cycles, allowing for zero overhead validation of execution paths by generating and comparing CRC check values, thus ensuring valid code execution without disrupting the system.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If existing code coverage analysis methods are implemented, then code validation capability is improved, but system overhead and resource consumption increase

Engineering Contradiction:
Improvecode validation capabilityVSAvoidsystem overhead
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent replaces traditional software-based code coverage analysis mechanisms with a hardware CRC circuit. This substitution eliminates the need for software agents, hooks, or instrumentation code that would consume processor cycles and memory resources. The hardware circuit performs validation in parallel with code execution, providing zero-overhead monitoring of execution paths through cryptographic hash functions computed on program counter values and instruction data.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent introduces a CRC circuit as an intermediary component between the processor and the code coverage analysis function. This intermediary handles all validation computations independently, allowing the main processor to execute code without interruption. The CRC circuit receives program counter and instruction data, computes validation hashes, and compares them against expected values, thereby mediating the validation process without burdening the primary execution path.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If invasive code coverage methods are used, then code execution validation is achieved, but timing-critical operations are disrupted

Engineering Contradiction:
Improvecode execution validationVSAvoidinstruction timing
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent enables continuous code execution without interruption by performing validation operations in parallel. The hardware CRC circuit continuously computes and validates execution paths alongside the processor's normal operation, rather than pausing execution to perform checks. This continuous parallel operation ensures that timing-critical instructions maintain their original execution timing while validation occurs simultaneously through dedicated hardware computation of cryptographic hashes on the fly.

Inventive Principle:
Principle #20Continuity of useful action

Solution Approach 2:

By replacing software-based validation with hardware-based CRC computation, the patent eliminates the time penalty associated with software context switches, function calls, and instruction execution overhead. The hardware circuit performs validation computations in dedicated logic paths that do not compete with the processor's instruction pipeline, thereby maintaining original instruction timing while achieving continuous validation coverage.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

3Measurement precision

If traditional code testing instruments are added, then code coverage measurement is improved, but resource availability decreases

Engineering Contradiction:
Improvecode coverage measurementVSAvoidresource availability
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent implements self-service validation where the system validates its own execution paths using intrinsic information already present during code execution. The CRC circuit utilizes the processor's own program counter values and instruction data as input for validation computations, eliminating the need for external test instruments, separate measurement hardware, or additional sensor components. This self-referential approach provides precise code coverage measurement using only the resources already consumed by normal code execution.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The hardware CRC circuit serves multiple functions simultaneously: it validates execution paths, measures code coverage, detects unauthorized modifications, and provides security verification. By consolidating these functions into a single multi-functional hardware component that operates in parallel with the processor, the patent achieves comprehensive measurement capabilities without proportionally increasing resource consumption. The same circuit that validates execution also provides coverage metrics and security verification.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS10331513B2Zero overhead code coverage analysis
Publication Date: 2019.06.25 MICROCHIP TECHNOLOGY INC
  • US10331513B2 patent drawing
  • US10331513B2 patent drawing
  • US10331513B2 patent drawing

AI summary

An integrated circuit includes comprising a cyclic redundancy check (CRC) circuit configured to read data identifying an execution path from code executed by a processor, determine a CRC check value for the data, and, based upon the CRC check value, determine whether the execution is valid.