From 59c1ca8e6b59b3ad0f1b13ac4345dd6ee4bd9dfd Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 2 Apr 2020 16:41:43 +0100 Subject: [PATCH] move reading into constructor --- src/soc/decoder/pseudo/pagereader.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/soc/decoder/pseudo/pagereader.py b/src/soc/decoder/pseudo/pagereader.py index 0b3a3c36..a9582481 100644 --- a/src/soc/decoder/pseudo/pagereader.py +++ b/src/soc/decoder/pseudo/pagereader.py @@ -64,6 +64,10 @@ class ISA: def __init__(self): self.instr = OrderedDict() self.forms = {} + for pth in os.listdir(os.path.join(get_isa_dir())): + print (get_isa_dir(), pth) + assert pth.endswith(".mdwn"), "only %s in isa dir" % pth + self.read_file(pth) def read_file(self, fname): fname = os.path.join(get_isa_dir(), fname) @@ -165,9 +169,4 @@ class ISA: if __name__ == '__main__': isa = ISA() - for pth in os.listdir(os.path.join(get_isa_dir())): - print (get_isa_dir(), pth) - assert pth.endswith(".mdwn"), "only %s in isa dir" % pth - isa.read_file(pth) - isa.pprint_ops() -- 2.30.2