From e7cb1a65d3a1c22aa14a313b89b2210f2df4e31e Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 2 Aug 2022 15:50:07 +0300 Subject: [PATCH] power_enums: allow SVPtype aliases --- src/openpower/decoder/power_enums.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openpower/decoder/power_enums.py b/src/openpower/decoder/power_enums.py index e414178c..3886bab0 100644 --- a/src/openpower/decoder/power_enums.py +++ b/src/openpower/decoder/power_enums.py @@ -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): -- 2.30.2