[cov] Add tool for generating coverage view #29287
Open
+698
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This tool generates a "coverage view" bitmap for OpenTitan firmware, allowing generating coverage reports accurately represent only the code physically present in a specific binary (e.g. ROM_EXT). It's achieved by filtering out functions discarded during the compilation or linking processes.
For Ibex binaries, the coverage view is constructed by cross-referencing LLVM coverage metadata with DWARF debug information to identify and exclude stripped functions.
For OTBN binaries, the coverage view is derived exclusively from DWARF debug information, as these binaries are not stripped.
This
coverage_view_testrules are implemented as tests, rather than standard build artifacts or runnable targets, to enable execution viabazel coverage. This approach avoids expensive test cache invalidations that typically result from dependency or configuration changes.