From: Cesar Strauss Date: Sat, 20 Feb 2021 21:12:03 +0000 (-0300) Subject: Actually forward the field width to field_slice() X-Git-Tag: convert-csv-opcode-to-binary~192 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8cc6576bab311080b96f356f343b9238a04bd413;p=soc.git Actually forward the field width to field_slice() This means that field extraction of multi-bit subfields, for field sizes other than 64 bits, was buggy up to now. Fortunately, there were no users of non-default field sizes so far. --- diff --git a/src/soc/consts.py b/src/soc/consts.py index d555e55b..108a730d 100644 --- a/src/soc/consts.py +++ b/src/soc/consts.py @@ -77,7 +77,7 @@ def field(r, msb0_start, msb0_end=None, field_width=64): if msb0_end is None: return r[(field_width - 1) - msb0_start] else: - return r[field_slice(msb0_start, msb0_end)] + return r[field_slice(msb0_start, msb0_end, field_width)] def sel(r, sel_bits, field_width=None):