fhdl/verilog: fix signed constant conversion
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 6 Mar 2012 15:45:44 +0000 (16:45 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 6 Mar 2012 15:45:44 +0000 (16:45 +0100)
migen/fhdl/verilog.py

index e68071aece9b807c0bfde033f49c214d74ba34e4..854da372d46a944fea51c53b4cece028ef3b04a3 100644 (file)
@@ -21,7 +21,7 @@ def _printexpr(ns, node):
                if node.n >= 0:
                        return str(node.bv) + str(node.n)
                else:
-                       return "-" + str(node.bv) + str(-self.n)
+                       return "-" + str(node.bv) + str(-node.n)
        elif isinstance(node, Signal):
                return ns.get_name(node)
        elif isinstance(node, _Operator):