From: Luke Kenneth Casson Leighton Date: Thu, 2 Apr 2020 15:41:43 +0000 (+0100) Subject: move reading into constructor X-Git-Tag: div_pipeline~1566 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59c1ca8e6b59b3ad0f1b13ac4345dd6ee4bd9dfd;p=soc.git move reading into constructor --- 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()