Skip to content
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

Have a public API so that svd2pac can be used as a lib #45

Open
corco opened this issue Oct 16, 2024 · 1 comment
Open

Have a public API so that svd2pac can be used as a lib #45

corco opened this issue Oct 16, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@corco
Copy link

corco commented Oct 16, 2024

Is your feature request related to a problem? Please describe.

It is inconvenient to require a SVD file when it is not readily available. When registers are available in another format, for example YAML or a custom internal representation, having to generate and save the SVD prior to using svd2pac is bothersome.

Also, calling svd2pac::main from a tool application with string arguments is not idiomatic.

Describe the solution you'd like

If svd2pac was available as a library, with a public IR and generate functions, it would be possible to use it without explicitly requiring a SVD / call to main.

Describe alternatives you've considered

Using svd-encoder crate to generate SVD, saving the file than calling svd2pac::main.

Additional context

In our (very) specific case, we have an internal register representation that we use to generate FPGA logic as well as software access layer. Converting to svd2pac's IR is more natural than generating a throwaway SVD to serve as middleman.

@pellico pellico added the enhancement New feature or request label Oct 17, 2024
@pellico pellico added this to the Release 0.4.0 milestone Oct 17, 2024
@pellico
Copy link
Contributor

pellico commented Oct 17, 2024

@corco Thank you for request.
This is nice enhancement but in order to have a decent interface I see the following steps:

  • IR interface definition, just direct access to struct or setter/getter
  • IR documentation
  • Polish GenPackSettings. It is quite ugly
  • Polish generate_rust_package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants