sv_binutils: support multiple opcodes; minor fixes
authorDmitry Selyutin <ghostmansd@gmail.com>
Mon, 12 Sep 2022 19:28:24 +0000 (22:28 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 13 Sep 2022 23:23:33 +0000 (00:23 +0100)
src/openpower/sv/sv_binutils.py

index d34fb099ae65d1a6778d26288ea50c5804a7a228..6ace71b20e7b5cb08c51919c6f8e35e394c72341 100644 (file)
@@ -391,11 +391,15 @@ class Opcode(Struct):
     mask: Mask
 
 
-class Opcodes(Object, c_typedef="const uint64_t *"):
+class Opcodes(Object, c_typedef="const struct svp64_opcode *"):
     def __init__(self, offset):
         self.__offset = offset
         return super().__init__()
 
+    @classmethod
+    def c_var(cls, name, prefix="", suffix=""):
+        return f"{prefix}{cls.c_typedef}{name}{suffix}"
+
     @classmethod
     def c_decl(cls):
         yield "const struct svp64_opcode *opcodes;"