From: Dmitry Selyutin Date: Sun, 23 Jan 2022 18:22:42 +0000 (+0000) Subject: sv_binutils: consider opcode whenever names match X-Git-Tag: sv_maxu_works-initial~539 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe7090942f86fc3aa7d8121d43892b6de4a5e5f9;p=openpower-isa.git sv_binutils: consider opcode whenever names match --- diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index 1f076147..8e7239a7 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -102,6 +102,12 @@ class Opcode(CType): fmt = f"{{value:0{self.bits}b}}:{{mask:0{self.bits}b}}" return fmt.format(value=self.value, mask=self.mask) + def __lt__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented + + return self.__value < other.__value + @classmethod def c_decl(cls): yield f"struct svp64_opcode {{" @@ -186,6 +192,10 @@ class Entry(CType): def __lt__(self, other): if not isinstance(other, self.__class__): return NotImplemented + + if self.name == other.name: + return self.opcode < other.opcode + return self.name < other.name @classmethod