-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add riscv
section for RISC-V targets
#265
Conversation
I feel like this (or similar) should make it into the spec |
I think so too. I'm not sure who controls specification. Possibly those guys: https://github.com/Open-CMSIS-Pack/devtools/ We could move this under some |
This reverts commit 5b2de11.
I already have a proof of concept working for the E310x microcontroller. You can check the outcome here. While implementing this solution, I found a few things that could be changed:
This alternative would look like this: <peripherals>
<peripheral>
<name>PLIC</name>
<riscvPeripheral>PLIC</riscvPeripheral> <!-- Alternative to having it in the riscv section -->
<baseAddress>0x0C000000</baseAddress>
<groupName>PLIC</groupName>
<description>Platform Level Interrupt Control</description>
<interrupt>
<name>MachineExternal</name>
<value>11</value>
<riscvCoreInterrupt>true</riscvCoreInterrupt> <!-- Alternative to coreInterrupts section -->
</interrupt>
<registers>
<!-- Omitted -->
</registers>
</peripheral>
<!-- Omitted -->
</peripherals> However, we still need the Feedback is more than welcome. I'm new in this SVD world and probably there are easier ways to do what the RISC-V ecosystem needs. |
I tried to isolate all new stuff under a non-standard tag I would suggest defining a reasonable |
Alright, I'm ok with experimenting under a feature gate 👍🏼 |
I simplified the section. For now, I will just use a naming convention as done for Cortex-M core peripherals, so there is no need for a Also, all the |
This is a proposal to allow
svd2pac
to generate the corresponding code forriscv
targets using the newriscv-pac
andriscv-peripheral
crates. The main features that we need are:Identifying which peripherals can use a stardard implementation available atriscv-peripheral
(currently, CLINT or PLIC, in the near future, CLIC).riscv_pac::CoreInterruptNumber
trait. Interrupt sources defined in theperipherals
sections should be considered only external, and theriscv_pac::ExternalInterruptNumber
should be used for those.riscv_pac::PriorityNumber
trait.riscv_pac::HartIdNumber
trait.To do so, I think the easiest approach is adding a new section in the SVD files that contains all the relevant information. This PR uses the following extension:
Related issues and PRs:
svd2rust
riscv
Let me know what you think.