From: Dmitry Selyutin Date: Wed, 10 May 2023 18:01:42 +0000 (+0000) Subject: pysvp64dis: migrate to new byteorder class X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fffb370f43bcc53168f85f34270af125afcc5134;p=openpower-isa.git pysvp64dis: migrate to new byteorder class --- diff --git a/src/openpower/sv/trans/pysvp64dis.py b/src/openpower/sv/trans/pysvp64dis.py index 8f2afc7a..b2fceeaa 100644 --- a/src/openpower/sv/trans/pysvp64dis.py +++ b/src/openpower/sv/trans/pysvp64dis.py @@ -7,6 +7,7 @@ from openpower.decoder.power_enums import ( find_wiki_dir as _find_wiki_dir, ) from openpower.decoder.power_insn import ( + ByteOrder as _ByteOrder, Style as _Style, Database as _Database, WordInstruction as _WordInstruction, @@ -15,17 +16,7 @@ from openpower.decoder.power_insn import ( ) -class ByteOrder(_enum.Enum): - LITTLE = "little" - BIG = "big" - - def __str__(self): - return self.name.lower() - - -def load(ifile, byteorder=ByteOrder.LITTLE, **_): - byteorder = str(byteorder) - +def load(ifile, byteorder=_ByteOrder.LITTLE, **_): while True: insn = ifile.read(4) length = len(insn) @@ -66,7 +57,7 @@ def main(): parser.add_argument("ofile", nargs="?", type=_argparse.FileType("w"), default=_sys.stdout) parser.add_argument("-b", "--byteorder", - type=ByteOrder, default=ByteOrder.LITTLE) + type=_ByteOrder, default=_ByteOrder.LITTLE) parser.add_argument("-s", "--short", dest="style", default=_Style.NORMAL, action="store_const", const=_Style.SHORT)