Nic30 / hdlConvertorAst

Python library of AST nodes for SystemVerilog/VHDL, code generator, transpiler and translator
MIT License
27 stars 5 forks source link

Error when call visit_HdlContext NotImplementedError: Unexpected object of type #1

Closed jinfuchen closed 3 years ago

jinfuchen commented 4 years ago

Hi there, I am trying to call visit_HdlContext in class ToJson to generate json tree. However, I got an error:

I used the code from notebook in https://github.com/Nic30/hdlConvertor/blob/master/notebooks/01_parse_and_dump.ipynb Any solution for this? Thanks

Nic30 commented 4 years ago

Hello @jinfuchen, this very odd because the examples should be tested and if I run the current repo on my binder https://mybinder.org/v2/gh/Nic30/hdlConvertor/master?filepath=notebooks%2F01_parse_and_dump.ipynb

it works.

Did you install this library from github or from pip? The error basically means that to.json does not recognize HdlModuleDec object. Which part of code from notebook raises this error (which sv/vhdl file)?

jinfuchen commented 4 years ago

Thanks for your reply. Yeah I did install hdlConvertor and hdlConvertorAst from pip.

The part raised such error in which: j = tj.visit_HdlContext(d) And the trace stack is

Nic30 commented 4 years ago

Hello, the version of hdlConvertor package was not entirely compatible whith hdlConvertorAst. I fixed it.

Try upgrade your installataion using pip3 install --upgrade hdlConvertor

In pip3 list you should see hdlConvertor == 1.6, hdlConvertorAst == 0.2

Nic30 commented 3 years ago

Hello, this issue has been fixed please check if it works in your setup and optionally reopen this issue if the issue persists.

jinfuchen commented 3 years ago

Hello, Many thanks for the fix and the issue has been fixed now.