From: Dmitry Selyutin Date: Sat, 17 Sep 2022 12:57:40 +0000 (+0300) Subject: power_fields: fix field slicing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27de06de7bae5ea813ec6598f543d380b7a89e52;p=openpower-isa.git power_fields: fix field slicing --- diff --git a/src/openpower/decoder/power_fields.py b/src/openpower/decoder/power_fields.py index c1a2d483..80aa1d4e 100644 --- a/src/openpower/decoder/power_fields.py +++ b/src/openpower/decoder/power_fields.py @@ -178,6 +178,9 @@ class Field(Reference, metaclass=FieldMeta): if isinstance(key, int): bit = self.storage[self.__class__.__members__[key]] return _SelectableInt(value=bit, bits=1) + if isinstance(key, slice): + assert key.step is None or key.step == 1 + key = range(key.start, key.stop) return _selectconcat(*(self[bit] for bit in tuple(key)))