cortex-a
cortex-a copied to clipboard
Auto generate definition from Arm Exploration tools
Hello there,
I'm currently writing some EL2 code and came across some missing registers (MAIR_EL2, TTBR0_EL2, TTBR1_EL2 and TCR_EL2).
It could be interesting to auto generate registers definition from the Arm Exploration tools to be able to provide the full register set.
Hi,
indeed, we have brainstormed auto-generation from the ARM-supplied XML files in the past. Unfortunately, we haven't even made it past the proof-of-concept phase yet. The problem being, there is nobody who has time to do it.
In my opinion, auto-generation would be the best approach.
Still, there would be some things worth exploring first. Would it be trivial to generate rich commentary for each field like we manually do it at the moment. Because this is quite nice to have if you work with an IDE that gives you a means for quickly browsing the comments.
Would it even be possible to generate meaningful constant names to some extent as well?
This is even more important in my opinion, because it increases readability of the source code you write using cortex-a
a lot.
It is still not a deal breaker to manually maintain the constants. But an auto-generate tool would ideally inherit them from the previous version of cortex-a
when you a new version is generated.
That all being said, we're definitely open to try this approach, but the current cortex-a team (which is basically me) would need help to writing and testing the tool.
Are you interested?
Hi Andre, Mary!
I'd love to help with this!
I've had exactly this on a list to discuss with Andre but couldn't come around to it yet.
As a matter of pure coincidence there is a group here at Arm who has been looking at very similar things for an unrelated (non-Rust) internal project. They are a source of great insights for exactly the type of things that Andre has called out already (rich commentary for each field, meaningful constant names). I am more than happy to tap them as needed for guidance. Also to feed back stuff if and as needed.
I believe that the approach has generally been to use the relevant parts of the exploration tools to automate as much as is practically possible and fill in the rest manually.
How would you like to proceed ?
Thanks
On Sat, Feb 13, 2021 at 12:30 PM Andre Richter [email protected] wrote:
Hi,
indeed, we have brainstormed auto-generation from the ARM-supplied XML files in the past. Unfortunately, we haven't even made it past the proof-of-concept phase yet. The problem being, there is nobody who has time to do it.
In my opinion, auto-generation would be the best approach.
Still, there would be some things worth exploring first. Would it be trivial to generate rich commentary for each field https://github.com/rust-embedded/cortex-a/blob/master/src/regs/tcr_el1.rs#L202-L209 like we manually do it at the moment. Because this is quite nice to have if you work with an IDE that gives you a means for quickly browsing the comments.
Would it even be possible to generate meaningful constant names https://github.com/rust-embedded/cortex-a/blob/master/src/regs/tcr_el1.rs#L196-L199 to some extent as well? This is even more important in my opinion, because it increases readability of the source code you write using cortex-a a lot.
It is still not a deal breaker to manually maintain the constants. But an auto-generate tool would ideally inherit them from the previous version of cortex-a when you a new version is generated.
That all being said, we're definitely open to try this approach, but the current cortex-a team (which is basically me) would need help to writing and testing the tool.
Are you interested?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rust-embedded/cortex-a/issues/27#issuecomment-778612196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFMKYVHXLXU2OM223RE3CLS6ZWE3ANCNFSM4XSAG7OA .
As a quick update, I've been ramping up on this problem space using the excellent resources provided by Alastair Reid (a former colleague from Arm Research who's now with Google). Here are some very useful pointers:
https://alastairreid.github.io https://alastairreid.github.io/using-asli/ https://alastairreid.github.io/dissecting-ARM-MRA/
I am trying to see if I can generate a bare-bones 'minimal viable product' as a toy demonstrator of what I have in mind. If that gets somewhere, I'll share.
Howdy y'all,
I'm looking to include ARMv7-A low level access to this repo, specifically working with the Pocket Beagle which uses a Cortex-A8.
It seems like ARM doesn't want to publicly acknowledge they have ever made this chip though, when I search: https://developer.arm.com/tools-and-software/embedded/cmsis/cmsis-search - which apparently is supposed to be where the SVD files are now included (as part of their Device Packs) Cortex-A8 is never mentioned - so I have no refer to the TRM.
Was hoping anyone here would know where I could get an SVD file for the Cortex-A8?
While I'm going to attempt to manually start building out the core register access functions based on this: https://arm-software.github.io/CMSIS_5/Core_A/html/group__CMSIS__core__register.html#details and the Cortex-A8 TRM - i would be really interested in attempting to follow along with @raw-bin above in the hopes to auto-generate meaningful context for svd2rust
as well.
Thoughts welcome, appreciate y'all.
Hey, is there any update on this or a wip branch? I'm curious
Closing. This crate has been renamed and moved to https://github.com/rust-embedded/aarch64-cpu. Please continue there if needed.