[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 13:27:58 BST 2021


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

--- Comment #100 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
that's it.  that does the job.

     for i, c in vec_el_counts.items():
+        # calculate part_wid based on overall width divided by number
+        # of elements.
+        part_wid = width // c
         def add_p(p):
             dpoints[p].append(i)  # auto-creates list if key non-existent
-        for start in range(0, part_count, c):
+        # for each elwidth, create the required number of vector elements
+        for start in range(c):

commit a52b594062be6fd16d37b1f906904720bdda3525 (HEAD -> master)
Author: Luke Kenneth Casson Leighton <lkcl at lkcl.net>
Date:   Wed Oct 13 13:25:09 2021 +0100

    fix layout() to put in only the number of *requested* vector elements


5,6,6,6 elements {0: 5, 1: 6, 2: 6, 3: 6}
lane_shapes {0: 5, 1: 6, 2: 6, 3: 6} vec_el_counts {0: 1, 1: 1, 2: 2, 3: 4}
width 24 6 4
dpoints
{5: [0], 6: [1, 2, 3, 3], 12: [2, 3, 3], 18: [2, 3, 3]}


HA!  excellent.  that's the right answer.

only 4 breakpoints are created, not 14.

 211     # specify that the Vector Element lengths are to be *different* at
 212     # each of the elwidths.
 213     # combined with vec_el_counts we have:
 214     # elwidth=0b00 1x 5-bit     | <--  unused               -->....5 |
 215     # elwidth=0b01 1x 6-bit     | <--  unused              -->.....6 |
 216     # elwidth=0b10 2x 12-bit    | unused   .....6 | unused    .....6 |
 217     # elwidth=0b11 3x 24-bit    | .....6 | .....6 |  .....6 | .....6 |
 218     # expected partitions      (^)       ^        ^         ^^      (^)
 219     # to be at these points:   (|)       |        |         ||      (|)
                                             18       12         65

the breakpoints at 5, 6, 12 and 18 are now correctly created.
i'll add an assert to that effect.

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


More information about the libre-soc-bugs mailing list