问题描述
我们知道我们可以获得Verilog代码的AST文本文件。现在,我想修改AST以获取一些新功能,ANTLR是否适合此工作,还是应该使用哪个软件?或该怎么办?然后,我要合成修改后的AST以生成Verilog代码? YOSYS可以完成这项工作吗?我该怎么办?您能详细告诉我吗?
感谢您的帮助!
We know that we can get AST textfile of Verilog code. Now I want to modify the AST to get some new features, Is ANTLR right for this job,or which software should I use? Or How should I do? Then, I want to synthesis the modified AST to generate Verilog code? Can YOSYS finish this Job? What should I do? Can you tell me in detail?Thanks for your help!
推荐答案
使用ANTLR 4进行AST转换,您可以使用通过重写 Visit
方法来生成 Visitor
类。所有的Visit方法都应返回您目标类型的AST节点。
With ANTLR 4 for AST transforming you can use generated class Visitor
by overriding Visit
methods. All Visit methods should return AST node of your target type.
这篇关于如何从YOSYS修改AST?以及如何将修改后的AST合成为Verilog代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!