power_enums: allow SVPtype aliases
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 2 Aug 2022 12:50:07 +0000 (15:50 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 14 Aug 2022 19:07:43 +0000 (22:07 +0300)
src/openpower/decoder/power_enums.py

index e414178c379ded09c7b9b92984612d9682a0056e..3886bab00a47e359904ecb553252b7eb05189973 100644 (file)
@@ -178,6 +178,10 @@ class SVPtype(Enum):
     P1 = 1
     P2 = 2
 
+    @classmethod
+    def _missing_(cls, value):
+        return {"1P": SVPtype.P1, "2P": SVPtype.P2}[value]
+
 
 @unique
 class SVEtype(Enum):