sv_binutils: generate fields tables
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Wed, 20 Apr 2022 12:27:57 +0000 (12:27 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Wed, 20 Apr 2022 12:28:15 +0000 (12:28 +0000)
src/openpower/sv/sv_binutils.py

index 9d9ce41c7e69f5a1a9d788cf7a03641d629c9fdd..114e7c6f46d2b3f6305821b6459164cdbddd1956 100644 (file)
@@ -474,6 +474,13 @@ class Codegen(_enum.Enum):
             yield from indent(num_entries.c_value(suffix=";"))
             yield ""
 
+            for mapping in (Prefix, RM):
+                name = mapping.__name__.lower()
+                yield from mapping.c_var(name=f"svp64_{name}_entries", prefix="static ", suffix="[] = \\")
+                yield from mapping().c_value(suffix=";")
+                yield ""
+            yield ""
+
         entries = Entry[...](entries)
         num_entries = Size("(sizeof (svp64_entries) / sizeof (svp64_entries[0])")