fhdl: support negation operator
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 8 Dec 2011 20:15:44 +0000 (21:15 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 8 Dec 2011 20:15:44 +0000 (21:15 +0100)
migen/fhdl/structure.py

index 802e1cd2dff571ffeae2e9b87e9b9190b708c23c..6097c243372d5564461cb1b629f7e4ce190cd04c 100644 (file)
@@ -19,6 +19,9 @@ class BV:
                return r
 
 class Value:
+       def __invert__(self):
+               return Operator("~", [self])
+
        def __add__(self, other):
                return Operator("+", [self, other])
        def __radd__(self, other):