-
Notifications
You must be signed in to change notification settings - Fork 256
Description
Description
Nutshell does not check whether mepc[0] is zero.
Described in the privileged specification 3.1.14:
The low bit of mepc (mepc[0]) is always zero.
Environment
Implementation: Nutshell
Test case: See attachment
Expected Behavior
When attempting to write a value to mepc, it is required that mepc[0] must be 0.
Observed Behavior
In Spike: when writing to mepc, the last bit is forcibly set to 0.
In Nutshell: It is not forcibly set to 0. This violates the specification.
Potential Impact
Not sure.
Result log display:
The assembly code context for 'mret' is as follows(Note:for more details, please refer to the attachment):
- la x14, 0 #To check
- addi x14,x14,1 #To check
- csrw 0x341, x14
mepc different at pc = 0x00800001a8, spike = 0x0000000000000000, Nutshell= 0x0000000000000001
I am looking forward to your insights and resolution on this matter. If I have any inaccuracies, please point them out. If you also consider this to be an issue, please let me know.