power_enums: simplify extra idx string conversion
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 4 Jun 2023 09:20:26 +0000 (12:20 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 4 Jun 2023 09:32:00 +0000 (12:32 +0300)
src/openpower/decoder/power_enums.py

index 95cc4ae94e9b078dc70c5e5eec2e182b688d2d2d..1e512d8a9d70abcaae55c86a8f0faf148df25ab3 100644 (file)
@@ -239,14 +239,14 @@ class SVExtra(Enum):
     Idx3 = 4
     Idx_1_2 = 5  # due to weird BA/BB for crops
 
-    def __repr__(self):
+    def __str__(self):
         return {
             SVExtra.NONE: "NONE",
-            SVExtra.Idx0: "extra0",
-            SVExtra.Idx1: "extra1",
-            SVExtra.Idx2: "extra2",
-            SVExtra.Idx3: "extra3",
-            SVExtra.Idx_1_2: "extra1/extra2",
+            SVExtra.Idx0: "EXTRA0",
+            SVExtra.Idx1: "EXTRA1",
+            SVExtra.Idx2: "EXTRA2",
+            SVExtra.Idx3: "EXTRA3",
+            SVExtra.Idx_1_2: "EXTRA1/EXTRA2",
         }[self]
 
 # Backward compatibility