From: Dmitry Selyutin Date: Tue, 30 Aug 2022 10:01:26 +0000 (+0300) Subject: pagereader.ISA: support iteration X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=06823fad6164e87f95f0c4fafee094a166e4f913;p=openpower-isa.git pagereader.ISA: support iteration --- diff --git a/src/openpower/decoder/pseudo/pagereader.py b/src/openpower/decoder/pseudo/pagereader.py index aa9a0972..7319f077 100644 --- a/src/openpower/decoder/pseudo/pagereader.py +++ b/src/openpower/decoder/pseudo/pagereader.py @@ -63,7 +63,6 @@ def get_isa_dir(): class ISA: - def __init__(self): self.instr = OrderedDict() self.forms = {} @@ -85,6 +84,9 @@ class ISA: with open(name, "w") as f: f.write('\n'.join(rewrite) + '\n') + def __iter__(self): + yield from self.instr.items() + def read_file_for_rewrite(self, fname): pagename = fname.split('.')[0] fname = os.path.join(get_isa_dir(), fname)