[Libre-soc-bugs] [Bug 713] PartitionedSignal enhancement to add partition-context-aware lengths

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Oct 6 05:36:11 BST 2021


https://bugs.libre-soc.org/show_bug.cgi?id=713

--- Comment #9 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
going back to what is needed:

* elwidth as input
   (or, an enum, or string)
* for each elwidth, an actual width (power of 2)
   (or, the number of subdivision)
* and a (nonp2) "use this many bits" width

this suggests a dict as the spec.  mantissa:

{ 0b00 : (64, 53),  # FP64
  0b01 : (32, 23),  # FP32x2
  0b10 : (16, 10),  # FP16
  0b11 : (16, 5),  # BF16
}

no types, no classes.

turning that into PartitionPoints, a simple
function creates a dict and a mask Signal.

this i would expect to be about... 30 lines.

a second function, assuming an Enum Signal (or elwidth
Signal of 2 bits) would return a list of comb
statements that:

* accept the enum as input
* performs a switch
* sets the relevant mask bits

that would again be no more than about... 25 lines.

could you do a quick hack prototype of the first of
those functions?  take dict as input (and width parameter)
and return part points dictionary?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list