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))"
Thanks - this means also that the unit tests didn't cover this. How did you find this bug?
I discovered by converting my code to VHDL. If needed I may be able to send you the code.
A small example, or the offending code, is very useful, saves time to make a unit test.
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
Log in to post a comment.
Thanks - this means also that the unit tests didn't cover this. How did you find this bug?
I discovered by converting my code to VHDL. If needed I may be able to send you the code.
A small example, or the offending code, is very useful, saves time to make a unit test.
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