sv_binutils: determine the longest name
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sun, 23 Jan 2022 11:45:01 +0000 (11:45 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sun, 23 Jan 2022 11:45:01 +0000 (11:45 +0000)
src/openpower/sv/sv_binutils.py

index 7d6c1bab324a5cce2db72a228ae0f65b4b549de8..5a484f782f6e19f017cde4c9e991a44c6bc9aecd 100644 (file)
@@ -270,6 +270,9 @@ class Codegen(_enum.Enum):
             yield "extern const unsigned int svp64_num_entries;"
             yield ""
 
+            yield f"#define SVP64_NAME_MAX {max(map(lambda entry: len(entry.name), entries))}"
+            yield ""
+
             yield "#ifdef __cplusplus"
             yield "}"
             yield "#endif"