From 173f2fb11836777f8c7516ef15ed15945ed2411e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 7 Apr 2020 15:30:26 +0100 Subject: [PATCH] allow FieldSelectableInt to initialise from list or tuple --- src/soc/decoder/selectable_int.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/soc/decoder/selectable_int.py b/src/soc/decoder/selectable_int.py index 13ab4807..2e663bc9 100644 --- a/src/soc/decoder/selectable_int.py +++ b/src/soc/decoder/selectable_int.py @@ -15,6 +15,11 @@ class FieldSelectableInt: """ def __init__(self, si, br): self.si = si # target selectable int + if isinstance(br, list) or isinstance(br, tuple): + _br = BitRange() + for i, v in enumerate(br): + _br[i] = v + br = _br self.br = br # map of indices. def _op(self, op, b): -- 2.30.2