shuffle order of functions (whitespace) to same order as ast.Value
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 5 Oct 2021 17:20:52 +0000 (18:20 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 5 Oct 2021 17:20:52 +0000 (18:20 +0100)
src/ieee754/part/partsig.py

index 1ebf3326e9aa588b6861813a0ecba332acc76870..a3365d3124a1ea871ed18f6c1fe6e39039254f0d 100644 (file)
@@ -88,22 +88,12 @@ class PartitionedSignal(UserValue):
 
     def lower(self):
         return self.sig
-    # now using __Assign__
-    #def eq(self, val):
-    #    return self.sig.eq(getsig(val))
 
     # nmigen-redirected constructs (Mux, Cat, Switch, Assign)
 
-    def __Mux__(self, val1, val2):
-        # print ("partsig mux", self, val1, val2)
-        assert len(val1) == len(val2), \
-            "PartitionedSignal width sources must be the same " \
-            "val1 == %d, val2 == %d" % (len(val1), len(val2))
-        return PMux(self.m, self.partpoints, self, val1, val2)
-
     # TODO, http://bugs.libre-riscv.org/show_bug.cgi?id=458
-    #def __Switch__(self, cases, *, src_loc=None, src_loc_at=0,
-    #                               case_src_locs={}):
+    #def __Part__(self, offset, width, stride=1, *, src_loc_at=0):
+    #def __Repl__(self, count, *, src_loc_at=0):
 
     def __Cat__(self, *args, src_loc_at=0):
         args = [self] + list(args)
@@ -113,10 +103,21 @@ class PartitionedSignal(UserValue):
                 "a PartitionedSignal. %s is not." % repr(sig)
         return PCat(self.m, args, self.partpoints)
 
+    def __Mux__(self, val1, val2):
+        # print ("partsig mux", self, val1, val2)
+        assert len(val1) == len(val2), \
+            "PartitionedSignal width sources must be the same " \
+            "val1 == %d, val2 == %d" % (len(val1), len(val2))
+        return PMux(self.m, self.partpoints, self, val1, val2)
+
     def __Assign__(self, val, *, src_loc_at=0):
         # print ("partsig ass", self, val)
         return PAssign(self.m, self, val, self.partpoints)
 
+    # TODO, http://bugs.libre-riscv.org/show_bug.cgi?id=458
+    #def __Switch__(self, cases, *, src_loc=None, src_loc_at=0,
+    #                               case_src_locs={}):
+
     # no override needed, Value.__bool__ sufficient
     # def __bool__(self):