Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

RFC: generate ioregs! macros from SVD files #327

Open
niclashoyer opened this issue Jul 4, 2015 · 6 comments
Open

RFC: generate ioregs! macros from SVD files #327

niclashoyer opened this issue Jul 4, 2015 · 6 comments

Comments

@niclashoyer
Copy link
Contributor

After discussion here it seems that we could save a lot of work if we generate ioregs! macros from SVD files.

Based on the great work of @posborne I threw together a python script, that generates register definitions for STM32F4. It does not handle more complex cases with enumerated values, though.

One caveat is, that one has to be careful regarding the licenses of the SVD files and check if they are compatible with the Apache license or at least allow derivates to be Apache licensed.

Any ideas on how to integrate such a python generator in the zinc build system?

@niclashoyer
Copy link
Contributor Author

related: #326

@farcaller
Copy link
Member

there's little sense to not commit the generated files in tree, really (like I did in #318).

@niclashoyer
Copy link
Contributor Author

ah, so we already got the ruby implementation of the svd parser/generator. I'll take a look at it in support/.

@posborne
Copy link
Contributor

posborne commented Jul 4, 2015

This is also in-progress: https://github.com/posborne/zinc/tree/svd-generator-python. Haven't been able to find much time lately to work on it more.

@farcaller
Copy link
Member

Recapping the discussion we had here and in 326, I guess this is how we should proceed.

  • we don't modify SVD files to store them in zinc tree
  • every platform gets a dedicated regs.rs with all the ioregs, generated either manually, or from svd (whatever that is, a few people still need to cross-check it with docs)
  • ioreg macro becomes our source of truth for a platform, we can always compile it into whatever descriptive format we want if need
  • it is fine to modify those regs.rs files to get better readability and constant naming

@niclashoyer
Copy link
Contributor Author

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants