cristian-mattarei / CoSA

CoreIR Symbolic Analyzer
Other
61 stars 15 forks source link

AttributeError: '_BVType' object has no attribute 'get_type' #100

Closed zhanghongce closed 5 years ago

zhanghongce commented 5 years ago

Hi

I encountered an error when using the latest CoSA (both the master branch on github and the latest from pip3 seems to produce the same error message).

Here is the error message (on the AXI example):

~/case-studies/axi$ CoSA --problems problem.txt
Parsing file "axi.vlist"... Reading source files from "axi.vlist"... Traceback (most recent call last):
  File "/home/hongce/cosaEnv/bin/CoSA", line 11, in <module>
    sys.exit(main())
  File "/home/hongce/cosaEnv/lib/python3.6/site-packages/cosa/shell.py", line 209, in main
    sys.exit(run_problems(problems_config))
  File "/home/hongce/cosaEnv/lib/python3.6/site-packages/cosa/shell.py", line 165, in run_problems
    psol.solve_problems(problems_config)
  File "/home/hongce/cosaEnv/lib/python3.6/site-packages/cosa/analyzers/dispatcher.py", line 364, in solve_problems
    modifier)
  File "/home/hongce/cosaEnv/lib/python3.6/site-packages/cosa/analyzers/dispatcher.py", line 315, in parse_model
    (hts_a, inv_a, ltl_a) = parser.parse_file(filepath, general_config, flags)
  File "/home/hongce/cosaEnv/lib/python3.6/site-packages/cosa/encoders/verilog_yosys.py", line 162, in parse_file
    ret = parser.parse_file(TMPFILE, config)
  File "/home/hongce/cosaEnv/lib/python3.6/site-packages/cosa/encoders/btor2.py", line 100, in parse_file
    return self.parse_string(f.read())
  File "/home/hongce/cosaEnv/lib/python3.6/site-packages/cosa/encoders/btor2.py", line 230, in parse_string
    output_symbol = Symbol(nids[1], original_symbol.get_type())
AttributeError: '_BVType' object has no attribute 'get_type'

I have CoSA installed in the virtual environment and the installed packages are:

bit-vector (0.39a0) coreir (2.0.19) CoSA (0.4) Cython (0.29.2) gmpy2 (2.0.8) hwtypes (1.0.13) Jinja2 (2.10) MarkupSafe (1.0) numpy (1.15.3) pip (9.0.1) pkg-resources (0.0.0) pyparsing (2.4.0) PySMT (0.8.0) pyverilog (1.1.2) setuptools (39.0.1) six (1.12.0) wheel (0.32.2) z3-solver (4.8.5.0)

I have Python 3.6.8 on Ubuntu 18.04

Please don't hesitate to tell me if there is any additional information that I can provide.

makaimann commented 5 years ago

Hi,

That looks like a version issue with Yosys actually. There were some updates to the btor output of Yosys, so I updated CoSA accordingly. However, you’ll need to update your version of Yosys so they match. Let me know if that still doesn’t fix your issue!