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

Extending support for DII execution mode #24

Open
kliuMsft opened this issue Jan 9, 2024 · 5 comments
Open

Extending support for DII execution mode #24

kliuMsft opened this issue Jan 9, 2024 · 5 comments

Comments

@kliuMsft
Copy link
Contributor

kliuMsft commented Jan 9, 2024

The following features when in DII mode are needed in order to use the sail model in the design verification flow.

  1. Handling interrupts. If an instruction packet is flagged with an interrupt, the sail model should perform interrupt handling (e.g., update MSTATUS.MIE if interrupt is taken) based on the current MIE status.
  2. Similar to Add github action to compile simulator. #1, it's also desirable to be able to model a bus error for the load/store and instruction fetch interfaces. Actually - if we can have a generalized way to make the sail model to talk to a volatile peripheral it would be great.
  3. Adding a status-dump pseudo-instruction so that we can dump all architecturally visible registers and use that as a checkpoint against RTL simulation.
@nwf-msr
Copy link
Contributor

nwf-msr commented Jan 21, 2024

I have been able to run some DII/TestRIG tests against the sail model with a handful of hacks in place:

Unfortunately, it is not particularly robust, as might be expected from heretofore untested code. The much less structured random test in TestRIG elicits "Assertion failed: invalid current privilege". I'll raise a separate issue for that.

@nwf-msr
Copy link
Contributor

nwf-msr commented Jan 22, 2024

  1. Adding a status-dump pseudo-instruction so that we can dump all architecturally visible registers and use that as a checkpoint against RTL simulation.

That might be tricky... for all the wires that RVFI does define (including all CSRs...), I think it doesn't define shipping out the entire (GP) register file, just those in use by the current instruction. Of course, we can do anything we want, model-wise, to fake it, but it's just... another shortcoming of RVFI.

@kliuMsft
Copy link
Contributor Author

kliuMsft commented Jan 22, 2024 via email

@nwf-msr
Copy link
Contributor

nwf-msr commented Jan 22, 2024

I see - is the trace generation in sail tied to RVFI? I am hoping we can just dump everything and do a trace file comparison rather than relying on RVFI packets..

AFAIK yes, there is no existing support for traces other than ad hoc textual printouts and RVFI. It's part of why I was looking at Nexus 5000 last week, because neither of those are very satisfactory answers.

@nwf-msr
Copy link
Contributor

nwf-msr commented Jan 22, 2024

  • "No support for RV32E" can be worked around by just commenting out the high register selector values

A better fix is 0c38f6b, which hackishly, but hopefully correctly, models these high selector values as raising illegal opcode traps, rather than crashing the simulator. :)

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

No branches or pull requests

2 participants