-
Notifications
You must be signed in to change notification settings - Fork 149
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
Use riscv
section for RISC-V targets
#856
base: master
Are you sure you want to change the base?
Conversation
This PR shows how an updated PAC would look like over e310x chips |
Added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good start! should probably be marked as a draft, I see a bunch of todos
Yes! I'm currently working on a bunch of changes to use standard peripherals when possible, so it will take a few more iterations until it is ready to merge |
As shown in this PR, now it is possible to use riscv_peripheral :: clint_codegen ! (base 0x2000000 , mtimecmps [mtimecmp0 = (crate :: interrupt :: Hart :: H0 , "[0](crate::interrupt::Hart::H0)")] , msips [msip0 = (crate :: interrupt :: Hart :: H0 , "[0](crate::interrupt::Hart::H0)")] ,);
riscv_peripheral :: plic_codegen ! (base 0xC000000 , ctxs [ctx0 = (crate :: interrupt :: Hart :: H0 , "[0](crate::interrupt::Hart::H0)")] ,); To do list
Regarding the second point: what do you think about providing the CLINT clock frequency via a configuration parameter? |
I started with the configuration parameters... and decided to explore using configuration parameters only, leaving the SVD file untouched. For the E310x chip, the configuration file would look like this. |
Makes sense. But why a TOML? YAML should looks much cleaner for such things. Also what should we do with svd-rs changes and released crates? |
I converted the TOML file to YAML and the following command fails:
From here, it looks like
If we prefer this isolated configuration file approach (which I do), then all the stuff under the |
I think this should not be in |
I addressed your suggestions. I'm not sure if my independent YAML file implementation is the best approach, let me know what you think. You can see how I use it for E310x chips here |
|
This PR uses my proposed
riscv
SVD section to generate RISC-V PACs using the new set of traits inriscv-pac
.In this PR, the
mod interrupt
in RISC-V targets is handled differently, and includes:ExternalInterrupt
s (very similar to currentInterrupt
s)CoreInterrupt
s (this is new, previously it just assumed the peripheral follows the RISC-V standard)Priority
levels (necessary for interfacing standard peripherals with trait bounds)HartId
s (necessary for interfacing standard peripherals with trait bounds).Also, the PAC does not directly generate all the handlers array and so on. Instead, it relies on macros exposed in
riscv-pac
.I still need some time to pollish everything, but feedback is more than welcome :)
Solves #786