From: Luke Kenneth Casson Leighton Date: Sun, 10 Oct 2021 10:33:23 +0000 (+0100) Subject: add some more comments for the elwidth-adapter X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c6fa259688b9a1bc21cc06a520e5cdd4f6331ec3;p=ieee754fpu.git add some more comments for the elwidth-adapter https://bugs.libre-soc.org/show_bug.cgi?id=713#c34 --- diff --git a/src/ieee754/part/partsig.py b/src/ieee754/part/partsig.py index bf9fa100..d6e39f48 100644 --- a/src/ieee754/part/partsig.py +++ b/src/ieee754/part/partsig.py @@ -56,7 +56,11 @@ for name in ['add', 'eq', 'gt', 'ge', 'ls', 'xor', 'bool', 'all']: modnames[name] = 0 - +# Prototype https://bugs.libre-soc.org/show_bug.cgi?id=713#c53 +# this provides a "compatibility" layer with existing PartitionedSignal +# behaviour. the idea is that this interface defines which "combinations" +# of partition selections are relevant, and as an added bonus it says +# which partition lanes are completely irrelevant (padding, blank). class PartType: # TODO decide name def __init__(self, psig): self.psig = psig @@ -70,6 +74,28 @@ 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 +# where the PartitionPoints was *created* by the layout() +# function and this class then "understands" the relationship +# between elwidth and the PartitionPoints that were created +# by layout() +class ElWidthPartType: # TODO decide name + def __init__(self, psig): + self.psig = psig + def get_mask(self): + ppoints, pbits = layout() + return ppoints.values() # i think + def get_switch(self): + return self.psig.elwidth + def get_cases(self): + ppoints, pbits = layout() + return pbits + @property + def blanklanes(self): + return 0 # TODO + class PartitionedSignal(UserValue): # XXX ################################################### XXX