Embedded SoC Code Coverage via Compiler Hook Injection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional code coverage tools face challenges in embedded systems with real-time computing constraints, as the addition of instrumentation hooks and data collection can adversely affect program execution and performance due to memory and CPU resource limitations, increasing development time and performance overhead.
Innovation Solution
A code coverage method for embedded System on Chip (SoC) that detects utility functions, adds hook functions at entry and exit points, records properties in a bit array, and generates coverage reports, utilizing system debug Log traces to inject instrumentation code and existing target platform compiler options, reducing complexity and memory requirements.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If instrumentation hooks and data collection are added to achieve code coverage, then measurement precision is improved, but device complexity and memory requirements increase
Solution Approach 1:
The patent extracts the instrumentation overhead by using existing compiler infrastructure and build systems rather than adding separate instrumentation frameworks. The code coverage is achieved through compiler flags and existing build processes, removing the need for additional instrumentation libraries and reducing overall system complexity.
Solution Approach 2:
The patent makes existing compiler and build system components serve multiple functions: both compilation and code coverage instrumentation are achieved through the same compiler flags and build processes. This multi-functionality eliminates the need for separate instrumentation tools and reduces device complexity.
2Measurement precision
If instrumentation hooks are added to track code execution, then measurement precision is improved, but use of energy increases
Solution Approach 1:
The patent extracts heavy instrumentation logic from runtime execution by performing coverage tracking during the build and compilation phases. This shifts the energy-intensive operations to offline processing, significantly reducing CPU energy consumption during actual system operation.
Solution Approach 2:
The patent performs code coverage instrumentation and data collection during the compilation and build processes rather than during runtime execution. This preliminary action eliminates the need for continuous runtime monitoring, reducing energy consumption during system operation.
3Measurement precision
If separate libraries and buffer functions are added for instrumentation, then measurement precision is improved, but device complexity increases
Solution Approach 1:
The patent merges code coverage instrumentation with existing compiler and build system components. The same compiler flags and build processes that handle normal compilation also perform instrumentation, eliminating the need for separate libraries and buffer functions.
Solution Approach 2:
The patent makes existing compiler and build system components serve multiple functions: both compilation and code coverage instrumentation are achieved through the same compiler flags and build processes, eliminating the need for separate instrumentation libraries.
4Measurement precision
If bytecode instrumentation is added for Java projects, then measurement precision is improved, but development time increases
Solution Approach 1:
The patent extracts complex bytecode instrumentation logic and replaces it with simple compiler flags and build system configurations. This simplification eliminates the need for engineering and optimization efforts, significantly reducing development time.
Solution Approach 2:
The patent changes the approach from complex bytecode manipulation to simple compiler parameter changes. By using compiler flags and build system parameters, the system achieves code coverage without the complex engineering efforts required for bytecode instrumentation.
Data Source
AI summary
A code coverage method for an embedded System on Chip (SoC) includes detecting a presence of a utility function in target source code; adding a hook function to the target source code; and recording at least one property of the utility function based on the hook function in a bit array in a memory of the SoC. The method may further include extracting at least one recorded property from bit arrays in the memory; and generating a code coverage report based on an analysis of the extracted properties.


