Skip to content

[fcov] Add fcov for the interaction of pmp with debug module accesses #2279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hcallahan-lowrisc
Copy link
Contributor

Accesses to the debug module in debug mode should never be denied by the PMP unit. This commit implements fcov to confirm we have stimulated this particular behaviour in relevant related states.

Illegal bins are used for incorrect behaviour (e.g. denied access in debug mode). Other behaviours such as debug module accesses outside of debug mode are left as ignore_bins for now. This is not explicitly disallowed by the specification, and our implementation does not have any opinion about its validity, but external debug modules opine that it should not be allowed. We could possibly expand the stimulus in the future to test this condition, but it is low priority.

This PR does not include stimulus to hit the new coverage bins. That will come in another request.

Goes towards #2233

@hcallahan-lowrisc hcallahan-lowrisc added the Component:DV Design verification (DV) or testing issue label May 21, 2025
@hcallahan-lowrisc hcallahan-lowrisc force-pushed the pmp_debug_module_fcov branch 2 times, most recently from 3c117e2 to ab9bca0 Compare May 22, 2025 09:41
rtl/ibex_core.sv Outdated
// accesses-checked by it's PMP unit. If true we know that the current instruction at least
// attempted to make an access, and we can then cross this signal with the result of the pmp
// check and the current debug_mode state to capture all appropriate coverage.
logic [PMPNumChan-1:0] access_check_into_dm;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bind this in with an interface to avoid touching the RTL? (I think you'll want an "upwards hierarchical reference")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the new helper logic into the existing pmp_fcov_if. So no change needed to the existing ibex_core rtl.
By this logic though, there is a quantity of existing code in rtl/ that uses DV_FCOV_SIGNAL and DV_FCOV_SIGNAL_GEN_IF that should get the boot as well in a future cleanup PR.

Copy link
Contributor

@andreaskurth andreaskurth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the suggestions from @rswarbrick. Thanks @hcallahan-lowrisc!

Accesses to the debug module in debug mode should never be denied by the PMP
unit. This commit implements fcov to confirm we have stimulated this particular
behaviour in relevant related states.

Illegal bins are used for incorrect behaviour (e.g. denied access in debug mode)
Other behaviours such as debug module accesses outside of debug mode are left as
ignore_bins for now. This is not explicitly disallowed by the specification, and
our implementation does not have any opinion about its validity, but external
debug modules opine that it should not be allowed. We could possibly expand the
stimulus in the future to test this condition, but it is low priority.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:DV Design verification (DV) or testing issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants