decoder/helpers.py: redirect helper class calls
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sat, 25 Sep 2021 16:29:45 +0000 (16:29 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 25 Sep 2021 20:06:53 +0000 (21:06 +0100)
src/openpower/decoder/helpers.py

index 2adc714b66a6230ef64685b26dbf034adc837dd8..43fc24e5420012957dad5911ca868e378ec2acbc 100644 (file)
@@ -1,5 +1,6 @@
 import unittest
 import struct
+import sys
 from openpower.decoder.selectable_int import (SelectableInt, onebit,
                                               selectconcat)
 from nmutil.divmod import trunc_divs, trunc_rems
@@ -461,6 +462,9 @@ class ISACallerHelper:
     def XLEN(self):
         return self.__XLEN
 
+    def __getattr__(self, attr):
+        return getattr(sys.modules[ISACallerHelper.__module__], attr)
+
 
 if __name__ == '__main__':
     log(SelectableInt.__bases__)