From: Dmitry Selyutin Date: Wed, 20 Apr 2022 00:30:07 +0000 (+0000) Subject: sv_binutils: introduce uint8_t and size_t; drop integer metaclass X-Git-Tag: sv_maxu_works-initial~478 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a54e9315a4e4c9f216cd17b62e940493bc183eb2;p=openpower-isa.git sv_binutils: introduce uint8_t and size_t; drop integer metaclass --- diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index bb1eb180..c5ce0e11 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -155,16 +155,19 @@ class Struct(CType, metaclass=StructMeta): yield f"}}{suffix}" -class IntegerMeta(CTypeMeta): - def c_decl(cls): - yield "#include " - - -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)