HKUSTGZ-MICS-LYU / FlattenRTL

This is a python repo for flattening Verilog
12 stars 0 forks source link

Compatibility issue with antlr4-python3-runtime version 4.13.2 #1

Open hanm2019 opened 2 weeks ago

hanm2019 commented 2 weeks ago

Hello,

First of all, thank you for open-sourcing such a fantastic tool! I encountered an issue while setting up the environment. When using conda install conda-forge::antlr4-python3-runtime, it defaults to installing version 4.13.2. However, this causes the following error:

Traceback (most recent call last):
  File "/Users/hanmeng/Documents/research/Remu2.0/FlattenRTL/main.py", line 4, in <module>
    import flatten
  File "/Users/hanmeng/Documents/research/Remu2.0/FlattenRTL/flatten.py", line 4, in <module>
    from antlr4_verilog.verilog import VerilogParser, VerilogParserVisitor
  File "/Users/hanmeng/Documents/research/Remu2.0/FlattenRTL/antlr4_verilog/verilog/__init__.py", line 16, in <module>
    from antlr4_verilog.verilog.VerilogLexer import VerilogLexer
  File "/Users/hanmeng/Documents/research/Remu2.0/FlattenRTL/antlr4_verilog/verilog/VerilogLexer.py", line 1499, in <module>
    class VerilogLexer(Lexer):
  File "/Users/hanmeng/Documents/research/Remu2.0/FlattenRTL/antlr4_verilog/verilog/VerilogLexer.py", line 1501, in VerilogLexer
    atn = ATNDeserializer().deserialize(serializedATN())
  File "/opt/miniconda3/lib/python3.9/site-packages/antlr4/atn/ATNDeserializer.py", line 28, in deserialize
    self.checkVersion()
  File "/opt/miniconda3/lib/python3.9/site-packages/antlr4/atn/ATNDeserializer.py", line 50, in checkVersion
    raise Exception("Could not deserialize ATN with version {} (expected {}).".format(ord(version), SERIALIZED_VERSION))
Exception: Could not deserialize ATN with version 3 (expected 4).

I was wondering if there are any plans to support a higher version of antlr4-python3-runtime in the future.

Thank you!

MrWater98 commented 9 hours ago

Please make sure to install the antlr version as specified in the README file.

python3 -m pip install antlr4-python3-runtime==4.7.2

Note that we are trying to maintain this tool in sv branch. You may refer to it.