Closed mndstrmr closed 5 months ago
Hmmm, so this is also an issue in the upstream RISC-V Sail model? Might be worth reporting there if so.
As per #10 there's still the issue of potentially creating an unrepresentable PCC which is a bit awkward. Seems like another reason not to support vectored interrupts...
See comments in issue #10. We now only allow mtvec[1:0] == 2'b00, otherwise tag will be cleared at legalization (cspecialw) time.
Thanks, looks good to me.
In the instruction fetch stage of CherIoT-ibex the trap address for exceptions (for example) is calculated like so:
According to the Sail however the trap vector address should be
base
(i.e. just{csr_mtvec_i[31:2], 2'b00}
) for bothTV_Direct
andTV_Vector
(i.e. regardless ofcsr_mtvec_i[0]
).The same issue is present for interrupts.
The RISC-V spec suggests that stricter alignment requirements are allowed, so in this case I would suggest that CherIoT-ibex is correct, and the Sail needs updating to reflect that that is OK.
A correct implementation of the Sail function
tvec_addr
would be