From: Luke Kenneth Casson Leighton Date: Sun, 5 Apr 2020 20:12:38 +0000 (+0100) Subject: got fed up of hard-coded names, allow pywriter.py to take arguments X-Git-Tag: div_pipeline~1459 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2af63cb111248f6907bc21171e1065cc5ea38c3;p=soc.git got fed up of hard-coded names, allow pywriter.py to take arguments --- diff --git a/src/soc/decoder/pseudo/pywriter.py b/src/soc/decoder/pseudo/pywriter.py index 4eb59439..2afc2d3c 100644 --- a/src/soc/decoder/pseudo/pywriter.py +++ b/src/soc/decoder/pseudo/pywriter.py @@ -1,6 +1,7 @@ # python code-writer for OpenPOWER ISA pseudo-code parsing import os +import sys from soc.decoder.pseudo.pagereader import ISA from soc.decoder.power_pseudo import convert_to_python from soc.decoder.orderedset import OrderedSet @@ -100,17 +101,11 @@ class PyISAWriter(ISA): if __name__ == '__main__': isa = PyISAWriter() - isa.write_pysource('fixedarith') - isa.write_pysource('sprset') - #isa.write_pysource('system') + if len(sys.argv) == 1: # quick way to do it + print (dir(isa)) + sources = isa.page.keys() + else: + sources = sys.argv[1:] + for source in sources: + isa.write_pysource(source) isa.write_isa_class() - exit(0) - isa.write_pysource('stringldst') - isa.write_pysource('fixedshift') - isa.write_pysource('condition') - isa.write_pysource('fixedtrap') - isa.write_pysource('branch') - isa.write_pysource('fixedlogical') - isa.write_pysource('fixedstore') - isa.write_pysource('fixedload') - isa.write_pysource('comparefixed')