sv_binutils: introduce uint8_t and size_t; drop integer metaclass
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Wed, 20 Apr 2022 00:30:07 +0000 (00:30 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Wed, 20 Apr 2022 00:40:05 +0000 (00:40 +0000)
src/openpower/sv/sv_binutils.py

index bb1eb18009fcf434a19b27337435a6a9837151a3..c5ce0e1173811c80e2d6bb36a19ee111c50387f8 100644 (file)
@@ -155,16 +155,19 @@ class Struct(CType, metaclass=StructMeta):
         yield f"}}{suffix}"
 
 
-class IntegerMeta(CTypeMeta):
-    def c_decl(cls):
-        yield "#include <stdint.h>"
-
-
-class Integer(CType, int, metaclass=IntegerMeta):
+class Integer(CType, int):
     def c_value(self, prefix="", suffix=""):
         yield f"{prefix}{self}{suffix}"
 
 
+class Byte(Integer, typedef="uint8_t"):
+    pass
+
+
+class Size(Integer, typedef="size_t"):
+    pass
+
+
 class ArrayMeta(CTypeMeta):
     def __new__(metacls, name, bases, attrs, type=CType, size=0):
         cls = super().__new__(metacls, name, bases, attrs)