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
svd2pacto generate the corresponding code forriscvtargets using the newriscv-pacandriscv-peripheralcrates. 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::CoreInterruptNumbertrait. Interrupt sources defined in theperipheralssections should be considered only external, and theriscv_pac::ExternalInterruptNumbershould be used for those.riscv_pac::PriorityNumbertrait.riscv_pac::HartIdNumbertrait.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:
svd2rustriscvLet me know what you think.