sv_binutils: print opcode as hexadecimal
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sun, 9 Jan 2022 15:24:49 +0000 (15:24 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sun, 9 Jan 2022 16:36:40 +0000 (16:36 +0000)
src/openpower/sv/sv_binutils.py

index 3bddd99b6ea45e08c628ea297aefaa098809a83f..f416d0836cddbcd99c749c3d26f1cb7e6533bd04 100644 (file)
@@ -118,8 +118,8 @@ class Opcode(Field):
     def c_value(self, prefix="", suffix=""):
         yield f"{prefix}{{"
         yield from indent([
-            f".value = {self.value},",
-            f".mask = {self.mask},",
+            f".value = UINT32_C(0x{self.value:08X}),",
+            f".mask = UINT32_C(0x{self.mask:08X}),",
         ])
         yield f"}}{suffix}"