start filling in ElwidPartType switch/case and other info
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 25 Oct 2021 10:33:51 +0000 (11:33 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 25 Oct 2021 10:33:51 +0000 (11:33 +0100)
needed to get it functional and a drop-in replacement for the old
PartitionedSignal PartType behaviour

src/ieee754/part/partsig.py

index 3ba38a586ee572a67994c101757b83b839e7ec46..e38258be1716955f3f7b456511d45c71a961a146 100644 (file)
@@ -81,6 +81,7 @@ class PartType:  # TODO decide name
     def blanklanes(self):
         return 0
 
+
 # this one would be an elwidth version
 # see https://bugs.libre-soc.org/show_bug.cgi?id=713#c34
 # it requires an "adapter" which is the layout() function
@@ -93,19 +94,17 @@ class ElWidthPartType:  # TODO decide name
         self.psig = psig
 
     def get_mask(self):
-        ppoints = self.psig.scope.partpoints
-        return ppoints.values()  # i think
+        return self.psig.shape.partpoints.values()  # i think
 
     def get_switch(self):
-        return self.psig.elwidth
+        return self.psig.scope.elwid       # switch on elwid: match get_cases()
 
     def get_cases(self):
-        pbits = self.psig.scope.bitp
-        return pbits
+        return self.psig.shape.bitp.keys() # all possible values of elwid
 
     @property
     def blanklanes(self):
-        return 0  # TODO
+        return self.psig.shape.blankmask
 
 
 class SimdShape(Shape):