def eq(self, val):
return self.sig.eq(getsig(val))
+ @staticmethod
+ def like(other, *args, **kwargs):
+ """Builds a new PartitionedSignal with the same PartitionPoints and
+ Signal properties as the other"""
+ result = PartitionedSignal(other.partpoints)
+ result.sig = Signal.like(other.sig, *args, **kwargs)
+ result.m = other.m
+ return result
+
# unary ops that do not require partitioning
def __invert__(self):
- return ~self.sig
+ result = PartitionedSignal.like(self)
+ self.m.d.comb += result.sig.eq(~self.sig)
+ return result
# unary ops that require partitioning
``1`` otherwise.
"""
# amazingly, this should actually work.
- return ~premise | conclusion
+ return conclusion | ~premise