Skip to content

Conversation

@sasdf
Copy link
Contributor

@sasdf sasdf commented Feb 10, 2026

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_test rules are implemented as tests, rather than standard build artifacts or runnable targets, to enable execution via bazel coverage. This approach avoids expensive test cache invalidations that typically result from dependency or configuration changes.

@sasdf sasdf force-pushed the mgT4605a876 branch 6 times, most recently from b6f9ef4 to aab0bee Compare February 11, 2026 15:57
@sasdf sasdf changed the title [cov] Add tool for generationg coverage view [cov] Add tool for generating coverage view Feb 11, 2026
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.

Change-Id: I1bf00be84a8f19b436ea4629c9d18832da324251
Signed-off-by: Yi-Hsuan Deng <[email protected]>
This change adds `coverage_view_test` targets for all `ROM_EXT`
variations and slots in the `rom_ext` BUILD file.

Change-Id: I1d1bbfd83982f46df5610dfa1fe71ed9d44e5065
Signed-off-by: Yi-Hsuan Deng <[email protected]>
This change adds a `coverage_view_test` target to the OTBN crypto BUILD
file for the `boot` binary. This allows for coverage
filtering of the boot code.

Change-Id: I4605a87677f1f198cadd34dbb5f65df5ed4332e8
Signed-off-by: Yi-Hsuan Deng <[email protected]>
@sasdf sasdf marked this pull request as ready for review February 11, 2026 19:05
@sasdf sasdf requested a review from a team as a code owner February 11, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant