-
Notifications
You must be signed in to change notification settings - Fork 220
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
Instruction after pmpaddr0 csr write was not executed #122
Comments
As far as I know EH1 does not have PMP - CPU should take illegal exception on pmpaddr0 write ... You need to modify your test to avoid programming PMP and other facilities, unimplemented in this CPU. |
@algrobman Thank you for the information, however the situation is a little bit weird. Yes, I can see that core takes illegal operation on pmpaddr0 however I can see in the log that instruction is executed. After that one, there is one li instruction in the code but it is not logged on the trace and it is not executed. In the screenshot you can see the trace log from core(left) and from spike(right). |
the testbench / tracer are confusing in sense of printing trace log with exceptions. Really instructions #48, #49 are not executed, but trapped . You can't compare spike and EH1 traces - spike implements more CSRs than EH1 and EH1 has privet CSRs , spike does not have. You better compare the RTL with whisper ISS. you can enhance TB trace printing as :
To see if an instruction was trapped. trac_rv_i_ecause_ip bus can be printed in case of exception to show mcause, and trace_rv_i_tval_ip to show mtval |
@algrobman Okay, they are trapped, and not executed really, but I do not understand why the core is not executing the instruction address 0x0000010C. I also use whisper ISS, and whisper skips that "li" instruction too. Since the Veer EH-1 is a RISC-V core, it should cover the standards. As far as I know pmpaddr0 is a machine-level CSR and Veer EH-1 is supporting machine-level. So, it should support pmpaddr0 I guess. But for now, my main question is why the core not executing the "li" instruction. Thanks for the suggestion about trace printing, I'll add it to the testbench. |
The test code is a bit tricky - instead of having unimplemented instruction handler , the test presets mtvec to instruction, next to one, potentially could be trapped (which are all CSR writes ) just before each of these CSR access instructions. This makes the CPU to skip pieces of code related to unimplemented CSRs programming. The RISCV spec defines PMP as optional facility, so this core does not implement it. There is no sense in PMP for Machine mode only CPU. It more usable if U or/and S modes are implemented. BTW, trace with exceptions printing can look like:
|
the test sets up mtvec to 0x114 before programming PMP CSRs - once write to pmpaddr0 traps CPU goes directly to 0x114 |
@algrobman Thank you very much, I understand the situation now. |
Hello,
When I tried to run riscv-isa test rv32ui-p-add on Veer EH-1 core, I observed that the instruction after pmpaddr0 csr write operation is not executed and I cannot see it in the log file. However, when I run the same code with Spike ISS, I see the next instruction after csr write operation. You can find the executable, its dump, and logs from core and spike iss below. Can anyone help me figure out what going on in this situation?
rv32ui-p-add.zip
The text was updated successfully, but these errors were encountered: