From 27de06de7bae5ea813ec6598f543d380b7a89e52 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 17 Sep 2022 15:57:40 +0300 Subject: [PATCH] power_fields: fix field slicing --- src/openpower/decoder/power_fields.py | 3 +++ 1 file changed, 3 insertions(+) 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))) -- 2.30.2