From f4cc137ed0a826b720455c5ee7ac6c0ad22cb0b4 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 25 Apr 2022 20:28:08 +0000 Subject: [PATCH] sv_binutils: fix fields enum c_decl method --- src/openpower/sv/sv_binutils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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=";") -- 2.30.2