-
Notifications
You must be signed in to change notification settings - Fork 2
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
Verilog/VHDL parser #11
Comments
@Thomasb81 I am thinking about major update of hdlConvertor. I would like to implement full process parsing FIRRTL, separate python/c++ part and finalize preprocessor and comment parsing. Do you know about some better c++ compatible library for parsing of HDL languages? |
Hi Nic, FIRRTL is unknown to me. This will be an additional parser that would live concurrently to verilog and vhdl ? I would as a first step limit the FIRRTL work to the interface as it is yet more or less for verilog and vhdl. But I don't know your requirement and motivation regarding FIRRTL... Actually I still work on verilog/systemVerilog preprocessor to be able to process UVM code, and then systemVerilog support, I think sv grammar is in a good shape but I really need an sv preprocessor to pickup code from anywhere on the net. I don't use the tool yet, so you won't break anything, except if you consider to completely revisit the json structure... Thomas |
Yes it is much more simple HDL than Verilog/VHDL, it is used by risc-v community. (Maybe you heard about chise3, the FIRRTL is used in it.) I also do not need it I just think that it would be nice to have compatibility with the chisel3 based tools.
OK, I will see how much time will remain and what can be done. |
Actually the code is there : https://github.com/Thomasb81/hdlConvertor/tree/sv |
Do you know exactly what operation is slow? |
I did not yet investigate too much on what is slow.
The test(tests/test_thomas.py not available in not publish) is about to read about 17 files (through `include directive) representing a little bit more than 312Ko of text source code. I am not expert on antlr4. I saw a response from @mike-lischke on antlr4 mailing list saying that "left hand predicate, in all lexer rules" is performance killer. I use left hand predicate in the parser... I need to do additional test... |
Ok I got my issue. |
It seems the slow part is the tree build : I am wondering if it is not the NEWLINE token that I mention everywhere in grammar rules and only required to be not ignored for `define end rule... |
That usually means that the grammar is backtracking a lot. |
There are some parsers for HDL however all of them have some ridiculous weakness.
I would like to use hdlConvertor because I know that the Python dependency is not tied with the parsing code and potential missing features can be implemented and there are ANTLR4 grammars that can be used as a map to code.
However netlistDB compatibility will cost 100+ M/H of work for sure.
The text was updated successfully, but these errors were encountered: