From: Dmitry Selyutin Date: Sun, 9 Jan 2022 16:52:22 +0000 (+0000) Subject: sv_binutils: sort entries by name X-Git-Tag: sv_maxu_works-initial~573 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d3dc5fc2348dafb334be8c4a687ccf239d9ce5eb;p=openpower-isa.git sv_binutils: sort entries by name --- diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index e29a01c1..719475c8 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -187,6 +187,11 @@ class Entry: sv_cr_in: SVEXTRA sv_cr_out: SVEXTRA + def __lt__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented + return self.name < other.name + @classmethod def c_decl(cls): bits_all = 0 @@ -366,6 +371,7 @@ def main(codegen): } for (path, opcode_cls) in table.items(): entries.extend(parse(path, opcode_cls)) + entries = sorted(entries) for line in codegen.generate(entries): print(line)