Menu

#28 Error in isinstance call

MyHDL_0.7
closed-fixed
5
2013-06-01
2011-01-02
No

line 596 _toVHDL.Py:

"if isinstance(op, ast.Add, ast.Sub, ast.Mod, ast.FloorDiv):" should be
"if isinstance(op, (ast.Add, ast.Sub, ast.Mod, ast.FloorDiv))"

Discussion

  • Jan Decaluwe

    Jan Decaluwe - 2011-01-10
    • assigned_to: nobody --> jandecaluwe
     
  • Jan Decaluwe

    Jan Decaluwe - 2011-01-10

    Thanks - this means also that the unit tests didn't cover this. How did you find this bug?

     
  • Julien Pauty

    Julien Pauty - 2011-01-10

    I discovered by converting my code to VHDL. If needed I may be able to send you the code.

     
  • Jan Decaluwe

    Jan Decaluwe - 2011-01-10

    A small example, or the offending code, is very useful, saves time to make a unit test.

     
  • michiel

    michiel - 2012-04-23

    Same bug detected by porting MyHDL-0.6 code to MyHDL-0.7
    file-path: /usr/local/lib/python2.7/dist-packages/myhdl/conversion/_toVHDL.py line 596

    error: /usr/local/lib/python2.7/dist-packages/myhdl/conversion/_toVHDL.pyc in inferBinaryOpCast(self, node, left, right, op)
    594 raise AssertionError("unexpected op %s" % op)
    595 elif isinstance(left.vhd, vhd_int) and isinstance(right.vhd, vhd_vector):
    --> 596 if isinstance(op, ast.Add, ast.Sub, ast.Mod, ast.FloorDiv):
    597 right.vhd.size = ns
    598 node.vhdOri.size = ns

    TypeError: isinstance expected 2 arguments, got 5

    Resolution : ad brackets as jpauty also suggested

     
  • Jan Decaluwe

    Jan Decaluwe - 2013-06-01
    • status: open --> closed-fixed
     

Log in to post a comment.

Auth0 Logo