From: Luke Kenneth Casson Leighton Date: Tue, 7 Apr 2020 14:30:26 +0000 (+0100) Subject: allow FieldSelectableInt to initialise from list or tuple X-Git-Tag: div_pipeline~1435^2~51 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=173f2fb11836777f8c7516ef15ed15945ed2411e;p=soc.git allow FieldSelectableInt to initialise from list or tuple --- 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):