[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 13 15:29:37 BST 2021


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

--- Comment #102 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
this example is going wrong:

    # fixed_width=32 and no lane_widths says "allocate maximum"
    # i.e. Vector Element Widths are auto-allocated
    # elwidth=0b00 1x 32-bit    | .................32 |
    # elwidth=0b01 1x 32-bit    | .................32 |
    # elwidth=0b10 2x 12-bit    | ......16 | ......16 |
    # elwidth=0b11 3x 24-bit    | ..8| ..8 | ..8 |..8 |
    # expected partitions      (^)   |     |     |   (^)
    # to be at these points:   (|)   |     |     |    |

output:

maximum allocation from fixed_width=32
lane_shapes {0: 32, 1: 32, 2: 16, 3: 8}
vec_el_counts {0: 1, 1: 1, 2: 2, 3: 4}
width 128 32 4

what is happening is:

    cpart_wid = max(lane_shapes.values())     ==> 32
    part_count = max(vec_el_counts.values())  ==> 4

therefore 4x32 == 128 which is ridiculous and completely wrong,
the answer (as can be seen from the manual analysis) should be
32.

a first cut at a "fix" for this is to do something along
the lines of:

    cpart_wid = 0
    for i, ls in lane_shape.items():
        cpart_wid = max(cpart_wid, width // ls)

something like that.

i'll try to work through it.

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


More information about the libre-soc-bugs mailing list