Replies: 6 comments 9 replies
-
|
Yes, I would like to have a FemtoRVMorph version, that implements some instructions in HW and some instructions in a trap handler. |
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure what you mean by "an RV32I core that implements RV32M in a trap handler" What I had in mind was a simple exception handling core that is able to detect ecalls, faulty instructions, branch targets, etc... and give standard insights to the user via standard CSRs to ease the debugging process. I saw that most of the femtoRV already handle interrupts so you may already have trap handler support and some example programs ? From there, detecting exceptions is mostly a matter of adding some CSR logic and make it compliant to the privileged specs. To run linux on top of that will be challenge for me as I never did that before though, but I can surely try, it shouldn't be that hard once the hardware is here... |
Beta Was this translation helpful? Give feedback.
-
|
What I have in mind with "an RV32I core that implements RV32M in a trap handler" is a RV32I core with logic to detect faulty instructions and a ROM that implements the RV32M instructions in the handler. It is interesting because it lets seemlessly move functionalities between hw and sw. |
Beta Was this translation helpful? Give feedback.
-
|
Nice to read you here! Back then Bruno and me were thinking of adding an exception on invalid instuctions, with the goal to allow a software handler to emulate these, but I could not find an elegant way to add these. For a start, the FemtoRV cores have no capability to detect invalid instructions at all. Next, and more difficult, is mixing interrupt handlers with invalid instruction exceptions, as this would need two layers of interrupts, for example to execute an emulated instruction within an interrupt handler, and the RISC-V privileged specs were shady and opaque to me in this regard, with a steep slope of complexity to do it right: #1 (comment) If we can sketch out an elegant way to add invalid instruction traps to one of the FemtoRV32 cores that already support interrupts, this would be great! |
Beta Was this translation helpful? Give feedback.
-
|
I suggest we do that step by step (and this will make a nice tutorial), for what I call the "FemtoRVMorph" core:
Regarding standard (RISC-V) vs non-standard exception mechanism, I have a preference for standard, but I'm also fine with non-standard (and I guess it will be much easier to start from a non-standard mechanism, gain some experience, and maybe morph it into the standard mechanism). The official documentation on the priviledged ISA is very hard to read (at least for me). There are some sw emulators that can be a source of inspiration (the second one is super compact):
Once we have a good experience with that, I'd be interrested in the following versions of FemtoRVMorph:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I was going around the FemtoRV codebase as I really was impressed by the elegance of the designs ! This is very inspiring !
I also noticed the cores support interrupts but not exceptions, which can be very useful when we need to debug things. But maybe you did not introduce it for a reason ?
I would like to participate by adding a core with basic exception support (which would result in adding mtval + some new CSR logic).
Would that be possible,
Best
Beta Was this translation helpful? Give feedback.
All reactions