From: Luke Kenneth Casson Leighton Date: Fri, 23 Apr 2021 13:19:12 +0000 (+0100) Subject: sorting out wiki directories X-Git-Tag: 0.0.1~37 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=015a6ef1a4951085be9da3bdfa98c012c74d362c;p=openpower-isa.git sorting out wiki directories --- diff --git a/setup.py b/setup.py index d2b0216d..00ff7597 100644 --- a/setup.py +++ b/setup.py @@ -48,4 +48,9 @@ setup( install_requires=install_requires, tests_require=test_requires, test_suite='nose.collector', + entry_points = { + 'console_scripts': [ + 'pywriter=openpower.decoder.pseudo.pywriter:pywriter' + ] + } ) diff --git a/src/openpower/decoder/power_enums.py b/src/openpower/decoder/power_enums.py index 3353d202..5a29e8f1 100644 --- a/src/openpower/decoder/power_enums.py +++ b/src/openpower/decoder/power_enums.py @@ -24,18 +24,13 @@ from collections import namedtuple def find_wiki_dir(): filedir = os.path.dirname(os.path.abspath(__file__)) basedir = dirname(dirname(dirname(filedir))) - tabledir = join(basedir, 'libreriscv') - tabledir = join(tabledir, 'openpower') - return join(tabledir, 'isatables') + tabledir = join(basedir, 'openpower') + isatables = join(tabledir, 'isatables') + print ("find_wiki_dir", isatables) + return isatables def find_wiki_file(name): - filedir = os.path.dirname(os.path.abspath(__file__)) - basedir = dirname(dirname(dirname(filedir))) - tabledir = join(basedir, 'libreriscv') - tabledir = join(tabledir, 'openpower') - tabledir = join(tabledir, 'isatables') - return join(find_wiki_dir(), name) diff --git a/src/openpower/decoder/pseudo/pywriter.py b/src/openpower/decoder/pseudo/pywriter.py index 77ff775e..355d8ae5 100644 --- a/src/openpower/decoder/pseudo/pywriter.py +++ b/src/openpower/decoder/pseudo/pywriter.py @@ -4,10 +4,10 @@ import os import sys import shutil import subprocess -from soc.decoder.pseudo.pagereader import ISA -from soc.decoder.power_pseudo import convert_to_python -from soc.decoder.orderedset import OrderedSet -from soc.decoder.isa.caller import create_args +from openpower.decoder.pseudo.pagereader import ISA +from openpower.decoder.power_pseudo import convert_to_python +from openpower.decoder.orderedset import OrderedSet +from openpower.decoder.isa.caller import create_args def get_isasrc_dir(): @@ -129,7 +129,7 @@ class PyISAWriter(ISA): f.write(' }\n') -if __name__ == '__main__': +def pywriter(): isa = PyISAWriter() write_isa_class = True if len(sys.argv) == 1: # quick way to do it @@ -146,3 +146,6 @@ if __name__ == '__main__': isa.patch_if_needed(source) if write_isa_class: isa.write_isa_class() + +if __name__ == '__main__': + pywriter()