From 8cc6576bab311080b96f356f343b9238a04bd413 Mon Sep 17 00:00:00 2001 From: Cesar Strauss Date: Sat, 20 Feb 2021 18:12:03 -0300 Subject: [PATCH] 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. --- src/soc/consts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): -- 2.30.2