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
[Bug Report] Incorret mask for mcontrol.action #1032
Comments
|
Following is the test case we use, in this program we add a breakpoint to the 0x80000178 and specify the size field is 3. |
|
This is definitely a bug, easily fixed by using the CSR_MCONTROL_ACTION macro instead of MCONTROL_ACTION (which is out-of-date) in triggers.cc. But I've got a bunch of other stuff going on and it will take a while before I get to this. |
|
I believe this misbehavior was fixed by 7965f25 as part of #1128 (even though @Phantom1003 can you please confirm? |
|
After testing, spike no longer exits due to the breakpoint. |
We found the mask for mcontrol.action is 0x3f, while this field is only 4 bits width.

riscv-isa-sim/riscv/triggers.cc
Line 44 in 89745ab
riscv-isa-sim/riscv/encoding.h
Line 102 in e6a2245
We triggered this bug by randomly writing data to csr.
If users try to set the sizelo field next to it (although it appears that spike does not yet support), it will cause an illegal action to be saved, and then the abort() will be triggered at line 337 below, causing the simulation to end.
riscv-isa-sim/riscv/execute.cc
Lines 327 to 337 in 89745ab
cc to @timsifive
The text was updated successfully, but these errors were encountered: