selectable_int: support FSI.__len__ method
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 19 Aug 2022 04:53:35 +0000 (07:53 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Aug 2022 19:38:52 +0000 (20:38 +0100)
src/openpower/decoder/selectable_int.py

index 22985014e292f046f95decee20f0e7a820600d04..22fb8311cef15eed2b76f88f2c6b09893552fd68 100644 (file)
@@ -70,6 +70,9 @@ class FieldSelectableInt:
         vi = op(vi)
         return self.merge(vi)
 
+    def __len__(self):
+        return len(self.br)
+
     def __getitem__(self, key):
         log("getitem", key, self.br)
         if isinstance(key, SelectableInt):