revert to using self == Const(-1) for now in PartitionedSignal.all()
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 2 Oct 2021 17:37:41 +0000 (18:37 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 2 Oct 2021 17:37:41 +0000 (18:37 +0100)
src/ieee754/part/partsig.py

index e6939422ecc57270f9a369d7c5d191edfce9baa8..0cb9051287d4779214caa6935d6ff9ddcbf1ba5c 100644 (file)
@@ -356,11 +356,13 @@ class PartitionedSignal(UserValue):
         Value, out
             ``1`` if all bits are set, ``0`` otherwise.
         """
-        width = len(self.sig)
-        pa = PartitionedAll(width, self.partpoints)
-        setattr(self.m.submodules, self.get_modname("all"), pa)
-        self.m.d.comb += pa.a.eq(self.sig)
-        return pa.output
+        # something wrong with PartitionedAll, but self == Const(-1)"
+        #width = len(self.sig)
+        #pa = PartitionedAll(width, self.partpoints)
+        #setattr(self.m.submodules, self.get_modname("all"), pa)
+        #self.m.d.comb += pa.a.eq(self.sig)
+        #return pa.output
+        return self == Const(-1) # leverage the __eq__ operator here
 
     def xor(self):
         """Compute pairwise exclusive-or of every bit.