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

Serialize an AST (question, not issue) #36

Open
nblei opened this issue May 15, 2021 · 1 comment
Open

Serialize an AST (question, not issue) #36

nblei opened this issue May 15, 2021 · 1 comment

Comments

@nblei
Copy link

nblei commented May 15, 2021

I need to modify gate level netlists by changing the input and output of individual gates. Currently, I'm doing this using PCRE. This is an inelegant and haphazard solution. I'd like to instead manipulate the AST generated by your parser, and then reserialize it. Is this currently supported? It does not seem to be.

If not, what do you think the best way to go about serializing the AST would be? My plan is to create tuple structs for each AST node struct which contains references to the the AST and to the node, and then implement the Display trait for these tuple structs.

I apologize if this was the wrong place to ask this question, but I did not see reference to mailing list, discord, etc.

@erihsu
Copy link
Contributor

erihsu commented Jun 24, 2021

@nblei
I think the basic goal of sv-parser is to help analyze SystemVerilog source code in the project. As it constructs full AST, basically you can get all information recorded in the source code. For easier use-case, you can define your self-use verilog parser(for low-level description) to get gate information and manipulate it then. I believe you'll get inspired from the repo https://github.com/eda-rs/netlist

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