[Libre-soc-bugs] [Bug 716] PartitionedSignal Slice and Part needed for __getitem__

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Oct 21 12:28:57 BST 2021


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

--- Comment #16 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
inferring how Part works from the difference between bit_select and
word_select:

 413         if type(offset) is Const and isinstance(width, int):
 414             return self[offset.value * width:(offset.value + 1) * width]
 415         return Part(self, offset, width, stride=width, src_loc_at=1)

the one-line (key part of) Part i believe would be more like:

     return (self >> (offset*stride))[:width]

it is this aimple because under no circumstances are we doing LHS Part.

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


More information about the libre-soc-bugs mailing list