PC translation alerts show only when unhandled in simulated code#106
PC translation alerts show only when unhandled in simulated code#106rosenbergm wants to merge 2 commits into
Conversation
| alert("Fetching from unconvertable address!"); | ||
| if (machine_trace) { | ||
| // rv32_idump(cpu, cpu->pc, (rv_instr_t) 0U); | ||
| } |
There was a problem hiding this comment.
I think the dump should remain there if we eventually decide to revive that support?
There was a problem hiding this comment.
I added the commented code to system.c
|
|
||
| ### Fixed | ||
|
|
||
| * PC translation alerts show only when unhandled in simulated code (see #106, @rosenbergm) |
There was a problem hiding this comment.
I wonder: can we test this?
Or rather: when this really happens, it is game over, right? Because no one would be able to change the page tables, then?
Shouldn't we abort somehow? Maybe this would deserve a separate PR but it is probably something worth thinking about...
There was a problem hiding this comment.
Or rather: when this really happens, it is game over, right? Because no one would be able to change the page tables, then?
Yes, this is IMO true. Right now (before this PR), the simulator is just stuck in a loop and prints out the error message (if not handled, that was the case we saw int the NSWI199 lab).
Shouldn't we abort somehow? Maybe this would deserve a separate PR but it is probably something worth thinking about...
Yeah, I guess aborting is the best we can do here.
| if (cpu->csr.sepc == cpu->pending_fetch_fault_pc) { | ||
| ptr36_t phys; | ||
| if (rv_convert_addr(cpu, cpu->csr.sepc, &phys, false, true, false) != rv_exc_none) { | ||
| alert("Fetching from unconvertable address 0x%" RV_PRIXLEN "!", (uxlen_t) cpu->pending_fetch_fault_pc); |
There was a problem hiding this comment.
I know long messages are harder to read but telling the user "hey, there is no code for your exception handler" might be worth the effort to re-word the message?
There was a problem hiding this comment.
I reworded the message.
From now on, alerts when translating PC fire only when there was no meaningful handling of the exception. Update changelog
a6fc0ea to
c0f7ad1
Compare
No description provided.