-
Notifications
You must be signed in to change notification settings - Fork 81
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
difftest-as-dut: allow ref model to advance one more step on mismatch #407
Conversation
197089e
to
64376bb
Compare
Current implementation will corrupt the site of CPU_state during second checking |
64376bb
to
47c2f05
Compare
resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Can we do regression on difftest for bugs detection? Because current CI only ensure `` no difference ''. If I mistakenly modify NEMU to never report difference in difftest, it will also pass current CI. |
I think that is useful, but how to do that? |
I know few about NEMU as DUT. Generally, we need a failure testcase to test the functionality? |
Yes, for example, use a buggy Spike as ref, and check output. I am thinking about this because I am afraid that this patch (or similar patches) silently breaks NEMU as DUT (never report difference) but passes CI |
This feature looks important. The difftest repo also lacks this CI feature.
false || exit_code=$?
if [[ ${exit_code} -ne 0 ]]; then echo ${exit_code}; fi
|
I can have a try for these in the difftest repo as well. We may need to add the similar feature to other repos. It's really important |
ae591cc
to
9fbc0df
Compare
- When trapping on exception, occasionally, NEMU has executed `csrrw tp,mscratch,tp`, but Spike has not. After advancing Spike for one more step, Spike's architectural state will match with NEMU again.
9fbc0df
to
77291e5
Compare
Because my CI guard for NEMU as DUT depends on misa.rvb, I will add it in RVB patch |
This is actually because when certain exceptions occur, NEMU does not let Spike continue executing the instruction that caused the exception. As a result, Spike falls one instruction behind NEMU, leading to a mismatch. After letting Spike execute one more instruction, they match again. I think all exceptions (excluding interrupts) are caused by the instructions themselves, so I decided that whenever an exception occurs, NEMU should let Spike execute one instruction, which is the instruction that cause the exception. |
This is how difftest should work. Upon exception/interrupt, should tick one step. |
csrrw tp,mscratch,tp
, but Spike has not.After advancing Spike for one more step,
Spike's architectural state will match with NEMU again.