Skip to content
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

"rvfi_dbg" wrong cause #248

Closed
silabs-robin opened this issue Jul 8, 2022 · 4 comments
Closed

"rvfi_dbg" wrong cause #248

silabs-robin opened this issue Jul 8, 2022 · 4 comments
Labels
Component:Other Non-RTL, non-documentation (e.g. bhv, sva) Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation Type:Bug For bugs in any content (RTL, Documentation, etc.)

Comments

@silabs-robin
Copy link
Contributor

Component:RTL: For issues in the RTL (e.g. for files in the rtl directory)
Component:Other: For any other issues

Description

On the first instr in dmode, rvfi_dbg "contains the debug cause".
Also, dcsr.cause "Explains why Debug Mode was entered"
AFAICT, they should be the same on the first instr in dmode.
Problem: They are not. (See screenshot below.)

image

The trace above shows the core entering dmode because of debug_req_i.
This cause is correctly reflected in dcsr.cause (3 is "haltreq").
But rvfi incorrectly shows the cause to be "1", because it has some special handling of "ebreak".

Steps to Reproduce

  1. Use my fork and branch https://github.com/silabs-robin/core-v-verif/tree/rvfi_assert, hash f9b040d4.
  2. Run formal and check a_dbg_cause.
@Silabs-ArjanB Silabs-ArjanB added Component:Other Non-RTL, non-documentation (e.g. bhv, sva) Type:Bug For bugs in any content (RTL, Documentation, etc.) labels Jul 18, 2022
@Silabs-ArjanB
Copy link
Contributor

This is both an RVFI issue and an assertion issue.

The RVFI issue should be solved by #258.

The assertion issue relates to a misunderstanding of the rvfi_dbg signal. It does not always have to be equal the debug cause in dcsr as shown in Table 27 Table of scenarios for first instruction of exception/interrupt/debug handler. Further clarification has been added in the user manual via openhwgroup/cv32e40x#621.

Resolving this issue (as it tracks the design repos and not core-v-verif that still requires an assertion update).

@Silabs-ArjanB Silabs-ArjanB added the Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation label Jul 18, 2022
@silabs-robin
Copy link
Contributor Author

an ebreak in debug mode will be reported via rvfi_dbg

Why?
"For the first instruction after entering debug, the rvfi_dbg signal contains the debug cause".
An ebreak in debug mode goes from D-mode to D-mode, so I don't see why that is "entering debug".

@Silabs-ArjanB
Copy link
Contributor

@silabs-robin This scenario is considered 'entering debug' because a branch is performed to dm_halt_addr_i.

@silabs-robin
Copy link
Contributor Author

The RVFI issue appears to have been fixed. CEXes now point to the need to update the assertion itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:Other Non-RTL, non-documentation (e.g. bhv, sva) Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation Type:Bug For bugs in any content (RTL, Documentation, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants