-
Notifications
You must be signed in to change notification settings - Fork 17
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
CSR Instruction #32
Comments
Acknowledged. I have to think about this one - originally we did this in RTL b/c ibex doesn't generate any CSR-related faults at EX time (illegal csr address is considered a decoder error). |
The benefit of an exception on invalid CSRs in general is that you can trap and emulate them. I don't see a huge value in doing that for CHERIoT, since we don't expect to guarantee binary compatibility between cores (or versions of the same core). I'm happy with the Ibex behaviour. @rmn30, is there a problem making the Sail the same here (and removing the CSRs that we don't need / have)? |
RTL commit 4a739b4 changed the behavior to throw a CHERI exception for CSR accesses without an ASR permission. Will have to check with upstream ibex about mcause/mstatus legalization. |
For MSTATUS legalization there is the following commit upstream that has changed: lowRISC/ibex@e53a02a What exact differences are you seeing with MSTATUS and MCAUSE? |
This almost verifies: I believe the below two lines also need cheriot-ibex/rtl/ibex_controller.sv Lines 239 to 240 in 4a739b4
Also, the Sail |
You are right - line 239 doesn't need the instr_valid_i since it's included in mret_insn already, but the csr_access_i on line 240 is straightly from the decoder and thus need to be qualified by instr_valid_i. I have to think about how to handle those "allowed" CSR's.. It's a bit of pain since we have to decode those individually and the decision goes into instr_kill -> instr_executing which fanout to many places. |
Good point, thanks. |
It is fairly difficult for me to verify the RTL for the CSR instruction against the Sail, since they are not really that related at the moment. I have done so, but it requires that I change a fairly large amount of the Sail. In particular:
access_system_registers
checks in the RTL clear the output bits, but do not raise an exception. This is fine but the Sail does not do this. Ideally either the RTL would throw an exception, or the Sail would look like the following:The text was updated successfully, but these errors were encountered: