def __ne__(self, other):
width = self.sig.shape()[0]
- invert = ~self.sig # invert the input before compare EQ. TODO: NE op
- return self._compare(width, invert, other, "eq", PartitionedEqGtGe.EQ)
+ eq = self._compare(width, self, other, "eq", PartitionedEqGtGe.EQ)
+ ne = Signal(eq.width)
+ self.m.d.comb += ne.eq(~eq)
+ return ne
def __gt__(self, other):
width = self.sig.shape()[0]
(test_ge_fn, "ge"),
(test_lt_fn, "lt"),
(test_le_fn, "le"),
- #(test_ne_fn, "ne"), # NE not actually working at the moment
+ (test_ne_fn, "ne"),
):
yield part_mask.eq(0)
yield from test_binop("16-bit", test_fn, mod_attr, 0b1111)