module = ComparisonOpDriver(op_any, nops=1)
self.assertFormal(module, mode="bmc", depth=1)
+ def test_partsig_xor(self):
+
+ def op_xor(obj):
+ return obj.xor()
+
+ module = ComparisonOpDriver(op_xor, nops=1)
+ self.assertFormal(module, mode="bmc", depth=1)
+
if __name__ == '__main__':
unittest.main()
else:
self.partpoints = make_partition(mask, width)
self.modnames = {}
- for name in ['add', 'eq', 'gt', 'ge', 'ls']:
+ for name in ['add', 'eq', 'gt', 'ge', 'ls', 'xor']:
self.modnames[name] = 0
def set_module(self, m):
``1`` if an odd number of bits are set, ``0`` if an
even number of bits are set.
"""
+ width = len(self.sig)
pa = PartitionedXOR(width, self.partpoints)
setattr(self.m.submodules, self.get_modname("xor"), pa)
- self.m.d.comb += pa.a.eq(self)
+ self.m.d.comb += pa.a.eq(self.sig)
return pa.output
def implies(premise, conclusion):