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

HDL to SVD? #739

Open
rmsyn opened this issue Jul 18, 2023 · 2 comments
Open

HDL to SVD? #739

rmsyn opened this issue Jul 18, 2023 · 2 comments

Comments

@rmsyn
Copy link
Contributor

rmsyn commented Jul 18, 2023

I'm interested in creating a PAC crate for a chip that only seems to have RTL files available (https://github.com/T-head-Semi/openc910).

Is there any way to convert these files to SVD, and then use svd2rust to generate the PAC crate?

I know they are different purpose-built levels of abstraction, just hoping to not have to wait for the vendor to release SVD files.

Apologies if this is a noobish question that is obvious to others in this community.

@adamgreig
Copy link
Member

I don't think there's any general-purpose existing thing, because the RTL will be quite different for each chip. Some RTL generators like LiteX can output suitable metadata automatically, but if you don't already have that you'll probably have to write something to parse that specific chip's RTL and emit an SVD.

@rmsyn
Copy link
Contributor Author

rmsyn commented Jul 19, 2023

Some RTL generators like LiteX can output suitable metadata automatically, but if you don't already have that you'll probably have to write something to parse that specific chip's RTL and emit an SVD.

Looks like I just got another project to work on 😅 Thanks for the advice, I'll start working on something.

Edit: Small update, after looking into HTL-to-SVD translation, it seems to require annotating the HDL files to get the required info for SVD.

Ultimately, I don't think it's worth the effort, so I've transitioned to expanding SiFive's cmsis-svd-generator tool. Since a lot of these hardware vendors have some form of u-boot/linux support, the included DTS files seem like a better starting point. Especially when the vendors supply register information for board peripherals.

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

No branches or pull requests

2 participants