From: Dmitry Selyutin Date: Mon, 25 Apr 2022 20:28:08 +0000 (+0000) Subject: sv_binutils: fix fields enum c_decl method X-Git-Tag: sv_maxu_works-initial~458 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4cc137ed0a826b720455c5ee7ac6c0ad22cb0b4;p=openpower-isa.git sv_binutils: fix fields enum c_decl method --- diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index 532056f2..42a03c21 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -407,7 +407,11 @@ class FieldsMappingMeta(EnumMeta): return cls.__setter def c_decl(cls): - yield from super().c_decl() + yield f"{cls.c_typedef} {{" + for field_name in cls.__members__.keys(): + short_c_tag = cls.c_tag[:-len("_field")] + yield from indent([f"{short_c_tag}_{field_name},".upper()]) + yield f"}};" yield from cls.__struct.c_decl() yield cls.__getter.__class__.c_var(name=f"{cls.__tag}_get", suffix=";") yield cls.__setter.__class__.c_var(name=f"{cls.__tag}_set", suffix=";")