diff options
-rw-r--r-- | Makefile.in | 22 | ||||
-rwxr-xr-x | configure | 21 | ||||
-rwxr-xr-x | dist/travis/travis-ci.sh | 4 | ||||
-rw-r--r-- | python/libghdl/__init__.py | 47 | ||||
-rw-r--r-- | python/libghdl/setup.py | 26 | ||||
-rw-r--r-- | python/libghdl/thin/errorout.py (renamed from src/vhdl/python/libghdl/thin/errorout.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/errorout_memory.py (renamed from src/vhdl/python/libghdl/thin/errorout_memory.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/files_map.py (renamed from src/vhdl/python/libghdl/thin/files_map.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/files_map_editor.py (renamed from src/vhdl/python/libghdl/thin/files_map_editor.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/flags.py (renamed from src/vhdl/python/libghdl/thin/flags.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/libraries.py (renamed from src/vhdl/python/libghdl/thin/libraries.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/name_table.py (renamed from src/vhdl/python/libghdl/thin/name_table.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/std_names.py (renamed from src/vhdl/python/libghdl/thin/std_names.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/canon.py (renamed from src/vhdl/python/libghdl/thin/vhdl/canon.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/elocations.py (renamed from src/vhdl/python/libghdl/thin/vhdl/elocations.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/flists.py (renamed from src/vhdl/python/libghdl/thin/vhdl/flists.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/formatters.py (renamed from src/vhdl/python/libghdl/thin/vhdl/formatters.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/ieee.py (renamed from src/vhdl/python/libghdl/thin/vhdl/ieee.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/lists.py (renamed from src/vhdl/python/libghdl/thin/vhdl/lists.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/nodes.py (renamed from src/vhdl/python/libghdl/thin/vhdl/nodes.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/nodes_meta.py (renamed from src/vhdl/python/libghdl/thin/vhdl/nodes_meta.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/nodes_utils.py (renamed from src/vhdl/python/libghdl/thin/vhdl/nodes_utils.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/parse.py (renamed from src/vhdl/python/libghdl/thin/vhdl/parse.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/pyutils.py (renamed from src/vhdl/python/libghdl/thin/vhdl/pyutils.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/scanner.py (renamed from src/vhdl/python/libghdl/thin/vhdl/scanner.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/sem.py (renamed from src/vhdl/python/libghdl/thin/vhdl/sem.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/sem_lib.py (renamed from src/vhdl/python/libghdl/thin/vhdl/sem_lib.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/std_package.py (renamed from src/vhdl/python/libghdl/thin/vhdl/std_package.py) | 0 | ||||
-rw-r--r-- | python/libghdl/thin/vhdl/tokens.py (renamed from src/vhdl/python/libghdl/thin/vhdl/tokens.py) | 0 | ||||
-rwxr-xr-x | python/pnodes/pnodespy.py (renamed from src/vhdl/python/pnodespy.py) | 0 | ||||
-rw-r--r-- | setup.py.in | 57 | ||||
-rw-r--r-- | src/vhdl/libghdl/grt-modules.adb (renamed from src/vhdl/python/grt-modules.adb) | 0 | ||||
-rw-r--r-- | src/vhdl/libghdl/libghdl.adb (renamed from src/vhdl/python/libghdl.adb) | 0 | ||||
-rw-r--r-- | src/vhdl/libghdl/libghdl.ads (renamed from src/vhdl/python/libghdl.ads) | 0 | ||||
-rw-r--r-- | src/vhdl/python/libghdl/__init__.py | 34 |
35 files changed, 104 insertions, 107 deletions
diff --git a/Makefile.in b/Makefile.in index eea47de70..6654413cc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -40,7 +40,7 @@ libghdl_version=@libghdl_version@ enable_werror=@enable_werror@ enable_checks=@enable_checks@ enable_openieee=@enable_openieee@ -enable_python=@enable_python@ +enable_libghdl=@enable_libghdl@ default_pic=@default_pic@ INSTALL_PROGRAM=install -m 755 @@ -191,7 +191,7 @@ libs.vhdl.mcode: ghdl_mcode$(EXEEXT) install.mcode.program: install.dirs ghdl_mcode$(EXEEXT) $(INSTALL_PROGRAM) ghdl_mcode$(EXEEXT) $(DESTDIR)$(bindir)/ghdl$(EXEEXT) -install.mcode: install.mcode.program install.vhdllib install.vpi +install.mcode: install.mcode.program install.vhdllib install.vpi install.libghdl oread-mcode$(EXEEXT): force $(MAKE) -f $(srcdir)/src/ortho/mcode/Makefile \ @@ -259,7 +259,7 @@ libs.vhdl.gcc: ghdllib: libs.vhdl.gcc $(libdirsuffix)/libgrt.a -install.gcc: install.vhdllib install.grt install.vpi +install.gcc: install.vhdllib install.grt install.vpi install.libghdl #################### For gcc backend - development only (local build) #### @@ -339,7 +339,7 @@ install.llvm.program: install.dirs ghdl1-llvm$(EXEEXT) ghdl_llvm$(EXEEXT) $(INSTALL_PROGRAM) ghdl_llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl$(EXEEXT) $(INSTALL_PROGRAM) ghdl1-llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl1-llvm$(EXEEXT) -install.llvm: install.llvm.program install.vhdllib install.grt install.vpi +install.llvm: install.llvm.program install.vhdllib install.grt install.vpi install.libghdl ################ For simul (no code generation, interpretation) ########## @@ -359,7 +359,7 @@ install.simul: install.simul.program install.vhdllib ################ libghdl (library for the vhdl part) #################### -LIBGHDL_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/vhdl/python -aI$(srcdir)/src/ghdldrv +LIBGHDL_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/vhdl/libghdl -aI$(srcdir)/src/ghdldrv libghdl_name=libghdl-$(libghdl_version)$(SOEXT) @@ -368,7 +368,17 @@ $(libghdl_name): $(GRT_SRC_DEPS) version.ads force all.libghdl.true: $(libghdl_name) all.libghdl.false: -all.libghdl: all.libghdl.$(enable_python) +all.libghdl: all.libghdl.$(enable_libghdl) + +install.libghdl.true: + $(INSTALL_PROGRAM) -p $(libghdl_name) $(DESTDIR)$(libdir)/ + $(MKDIR) python + $(CP) -r $(srcdir)/python/libghdl python + $(MV) config.py python/libghdl/ + tar -zcvf ../libghdl-py.tgz -C python/libghdl . + +install.libghdl.false: +install.libghdl: install.libghdl.$(enable_libghdl) ################ ghdlsynth library ###################################### @@ -44,7 +44,7 @@ build_mode= enable_werror=true enable_checks=true enable_openieee=unknown -enable_python=false +enable_libghdl=true default_pic=false EXEEXT= SOEXT=.so @@ -53,7 +53,7 @@ PIC_FLAGS=-fPIC show_help=no progname=$0 -subst_vars="CC CXX GNATMAKE MAKE CFLAGS LDFLAGS build srcdir abs_srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_config llvm_be backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS default_pic enable_werror enable_checks enable_openieee enable_python libghdl_version ghdl_version" +subst_vars="CC CXX GNATMAKE MAKE CFLAGS LDFLAGS build srcdir abs_srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_config llvm_be backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS default_pic enable_werror enable_checks enable_openieee enable_libghdl libghdl_version ghdl_version" # Find srcdir srcdir=`dirname $progname` @@ -105,8 +105,8 @@ for opt do --disable-checks) enable_checks=false;; --enable-openieee) enable_openieee=true;; --disable-openieee) enable_openieee=false;; - --enable-python) enable_python=true;; - --disable-python) enable_python=false;; + --enable-libghdl) enable_libghdl=true;; + --disable-libghdl) enable_libghdl=false;; --default-pic) default_pic=true;; --enable-coverage) build_mode="coverage";; -h|-help|--help) show_help=yes;; @@ -131,8 +131,8 @@ Options [defaults in brackets]: backtrace on errors (only for llvm). --disable-werror warnings don't stop build --disable-checks disable internal checks + --disable-libghdl do not build libghdl shared library --enable-openieee use gpl-compatible sources for ieee library - --enable-python build python libghdl EOF exit 0 fi @@ -293,6 +293,14 @@ if [ ! -d pic ]; then fi fi +if [ "$enable_libghdl" = true ]; then + cat > config.py <<-EOF +__version__ = '${ghdl_version}' +__libghdl_version__ = '${libghdl_version}' +__libghdl__ = 'libghdl-${libghdl_version}${SOEXT}' +EOF +fi + # Generate config.status rm -f config.status { @@ -317,9 +325,6 @@ rm -f config.status done sed_opts=`echo $subst_vars | sed -e "s/\\([a-zA-Z_]*\\)/ -e \"s%@\1@%\$\1%g\"/g"` subst_files="ghdl.gpr Makefile" - if [ "$enable_python" = true ]; then - subst_files="$subst_files setup.py" - fi echo "for f in $subst_files; do" echo ' echo "Creating $f"' echo " sed $sed_opts" '< $srcdir/${f}.in > $f' diff --git a/dist/travis/travis-ci.sh b/dist/travis/travis-ci.sh index e036f677e..664412a76 100755 --- a/dist/travis/travis-ci.sh +++ b/dist/travis/travis-ci.sh @@ -5,7 +5,7 @@ build_img_ghdl() { travis_start "build_run" "$ANSI_BLUE[DOCKER build] ghdl/ghdl:${IMAGE_TAG}$ANSI_NOCOLOR" docker build -t ghdl/ghdl:$IMAGE_TAG . -f-<<EOF FROM ghdl/run:$IMAGE_TAG -ADD `ls | grep -oP 'ghdl-.*tgz'` /usr/local +ADD `ls | grep '^ghdl.*\.tgz'` /usr/local EOF travis_finish "build_run" } @@ -58,7 +58,7 @@ travis_finish "opts" RUN="docker run --rm -t -e TRAVIS=$TRAVIS -e CONFIG_OPTS="$CONFIG_OPTS" -v $(pwd):/work -w /work" if [ "$TRAVIS_OS_NAME" = "osx" ]; then - bash -c "${scriptdir}/build.sh $BUILD_CMD_OPTS" + CONFIG_OPTS="--disable-libghdl" bash -c "${scriptdir}/build.sh $BUILD_CMD_OPTS" else # Assume linux diff --git a/python/libghdl/__init__.py b/python/libghdl/__init__.py new file mode 100644 index 000000000..97b7acc82 --- /dev/null +++ b/python/libghdl/__init__.py @@ -0,0 +1,47 @@ +import ctypes +from os import environ +from os.path import dirname, join +from shutil import which +from libghdl.config import __libghdl__ + + +def _to_char_p(arg): + return ctypes.c_char_p(arg), len(arg) + + +def get_ghdl_path(): + _dir = None + for envvar in [environ.get(item) for item in ['GHDL_BIN_PATH', 'VUNIT_GHDL_PATH']]: + if envvar: + _dir = envvar + break + if not _dir: + _dir = which(environ.get('GHDL', 'ghdl')) + if _dir: + _dir = join(dirname(_dir), '..', 'lib') + return _dir + + +_basedir = get_ghdl_path() or dirname(__file__) + +libghdl = ctypes.CDLL(join(_basedir, __libghdl__)) + +libghdl.libghdl_init() + + +def set_option(opt): + arg = _to_char_p(opt) + return libghdl.libghdl__set_option(arg[0], arg[1]) + + +def analyze_init(): + return libghdl.libghdl__analyze_init() + + +def analyze_file(fname): + arg = _to_char_p(fname) + return libghdl.libghdl__analyze_file(arg[0], arg[1]) + + +_prefix = environ.get("LIBGHDL_PREFIX") or '--PREFIX=%s' % join(_basedir, 'ghdl') +set_option(_prefix.encode('utf-8')) diff --git a/python/libghdl/setup.py b/python/libghdl/setup.py new file mode 100644 index 000000000..c7c3de80b --- /dev/null +++ b/python/libghdl/setup.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +from distutils.core import setup +from config import __version__ + +setup( + name='libghdl', + version=__version__, + description='Interface to ghdl, a VHDL analyzer', + long_description="""GHDL is a vhdl simulator and libghdl provides a low-level +interface to the parser. This library gives access to the AST so that you can +write tools like linters. +""", + author='Tristan Gingold', + author_email='tgingold@free.fr', + url='http://github.com/ghdl/ghdl', + license='GPL-2.0-or-later', + package_dir={ + 'libghdl': './' + }, + packages=[ + 'libghdl', + 'libghdl.thin', + 'libghdl.thin.vhdl' + ] +) diff --git a/src/vhdl/python/libghdl/thin/errorout.py b/python/libghdl/thin/errorout.py index 809cc919e..809cc919e 100644 --- a/src/vhdl/python/libghdl/thin/errorout.py +++ b/python/libghdl/thin/errorout.py diff --git a/src/vhdl/python/libghdl/thin/errorout_memory.py b/python/libghdl/thin/errorout_memory.py index 8027795df..8027795df 100644 --- a/src/vhdl/python/libghdl/thin/errorout_memory.py +++ b/python/libghdl/thin/errorout_memory.py diff --git a/src/vhdl/python/libghdl/thin/files_map.py b/python/libghdl/thin/files_map.py index b0029b0a4..b0029b0a4 100644 --- a/src/vhdl/python/libghdl/thin/files_map.py +++ b/python/libghdl/thin/files_map.py diff --git a/src/vhdl/python/libghdl/thin/files_map_editor.py b/python/libghdl/thin/files_map_editor.py index e19317d0e..e19317d0e 100644 --- a/src/vhdl/python/libghdl/thin/files_map_editor.py +++ b/python/libghdl/thin/files_map_editor.py diff --git a/src/vhdl/python/libghdl/thin/flags.py b/python/libghdl/thin/flags.py index cc49c1651..cc49c1651 100644 --- a/src/vhdl/python/libghdl/thin/flags.py +++ b/python/libghdl/thin/flags.py diff --git a/src/vhdl/python/libghdl/thin/libraries.py b/python/libghdl/thin/libraries.py index cb5f20ec2..cb5f20ec2 100644 --- a/src/vhdl/python/libghdl/thin/libraries.py +++ b/python/libghdl/thin/libraries.py diff --git a/src/vhdl/python/libghdl/thin/name_table.py b/python/libghdl/thin/name_table.py index cda0b3e1c..cda0b3e1c 100644 --- a/src/vhdl/python/libghdl/thin/name_table.py +++ b/python/libghdl/thin/name_table.py diff --git a/src/vhdl/python/libghdl/thin/std_names.py b/python/libghdl/thin/std_names.py index bef6eee48..bef6eee48 100644 --- a/src/vhdl/python/libghdl/thin/std_names.py +++ b/python/libghdl/thin/std_names.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/canon.py b/python/libghdl/thin/vhdl/canon.py index 48f421618..48f421618 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/canon.py +++ b/python/libghdl/thin/vhdl/canon.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/elocations.py b/python/libghdl/thin/vhdl/elocations.py index 642598650..642598650 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/elocations.py +++ b/python/libghdl/thin/vhdl/elocations.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/flists.py b/python/libghdl/thin/vhdl/flists.py index 6cdd39ff3..6cdd39ff3 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/flists.py +++ b/python/libghdl/thin/vhdl/flists.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/formatters.py b/python/libghdl/thin/vhdl/formatters.py index 9c8bf9afb..9c8bf9afb 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/formatters.py +++ b/python/libghdl/thin/vhdl/formatters.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/ieee.py b/python/libghdl/thin/vhdl/ieee.py index d1192537d..d1192537d 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/ieee.py +++ b/python/libghdl/thin/vhdl/ieee.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/lists.py b/python/libghdl/thin/vhdl/lists.py index 8fc180073..8fc180073 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/lists.py +++ b/python/libghdl/thin/vhdl/lists.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/nodes.py b/python/libghdl/thin/vhdl/nodes.py index 61ff4d14e..61ff4d14e 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/nodes.py +++ b/python/libghdl/thin/vhdl/nodes.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/nodes_meta.py b/python/libghdl/thin/vhdl/nodes_meta.py index 8d717732e..8d717732e 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/nodes_meta.py +++ b/python/libghdl/thin/vhdl/nodes_meta.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/nodes_utils.py b/python/libghdl/thin/vhdl/nodes_utils.py index 8ea92969e..8ea92969e 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/nodes_utils.py +++ b/python/libghdl/thin/vhdl/nodes_utils.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/parse.py b/python/libghdl/thin/vhdl/parse.py index c6fbb5259..c6fbb5259 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/parse.py +++ b/python/libghdl/thin/vhdl/parse.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/pyutils.py b/python/libghdl/thin/vhdl/pyutils.py index 28b4464f3..28b4464f3 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/pyutils.py +++ b/python/libghdl/thin/vhdl/pyutils.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/scanner.py b/python/libghdl/thin/vhdl/scanner.py index 8cea66ba3..8cea66ba3 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/scanner.py +++ b/python/libghdl/thin/vhdl/scanner.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/sem.py b/python/libghdl/thin/vhdl/sem.py index df82435da..df82435da 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/sem.py +++ b/python/libghdl/thin/vhdl/sem.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/sem_lib.py b/python/libghdl/thin/vhdl/sem_lib.py index 28f7adc39..28f7adc39 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/sem_lib.py +++ b/python/libghdl/thin/vhdl/sem_lib.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/std_package.py b/python/libghdl/thin/vhdl/std_package.py index a9628ce89..a9628ce89 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/std_package.py +++ b/python/libghdl/thin/vhdl/std_package.py diff --git a/src/vhdl/python/libghdl/thin/vhdl/tokens.py b/python/libghdl/thin/vhdl/tokens.py index 572c3906d..572c3906d 100644 --- a/src/vhdl/python/libghdl/thin/vhdl/tokens.py +++ b/python/libghdl/thin/vhdl/tokens.py diff --git a/src/vhdl/python/pnodespy.py b/python/pnodes/pnodespy.py index 4a2859838..4a2859838 100755 --- a/src/vhdl/python/pnodespy.py +++ b/python/pnodes/pnodespy.py diff --git a/setup.py.in b/setup.py.in deleted file mode 100644 index 27f3778f4..000000000 --- a/setup.py.in +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup, Extension -import distutils.file_util -import distutils.dir_util -from distutils.command.build import build -import os -import os.path - -so_ext = "@SOEXT@" -libghdl_version = "@libghdl_version@" -ghdl_version = "@ghdl_version@" - -long_description = """GHDL is a vhdl simulator and libghdl provides a low-level -interface to the parser. This library gives access to the AST so that you can -write tools like linters. -""" - -class GHDLBuild(build): - def my_copy_tree(self, src, dst): - """Tuned version of copy_tree: exclude .o files""" - distutils.dir_util.mkpath(dst, verbose=True) - - for n in os.listdir(src): - src_name = os.path.join(src, n) - dst_name = os.path.join(dst, n) - - if os.path.isdir(src_name): - self.my_copy_tree(src_name, dst_name) - elif not src_name.endswith(".o"): - distutils.file_util.copy_file(src_name, dst_name) - - def run(self): - # Run original build code - build.run(self) - - # Copy VHDL libraries & shared library - dstdir = os.path.join(self.build_lib, 'libghdl') - libghdl_filename = "libghdl-" + libghdl_version + so_ext - distutils.file_util.copy_file(libghdl_filename, dstdir) - with open(os.path.join(dstdir, "config.py"), 'w') as f: - f.write('libghdl_filename="{}"\n'.format(libghdl_filename)) - self.my_copy_tree(os.path.join("lib", "ghdl"), - os.path.join(dstdir, "ghdl")) - -setup (name='libghdl', - version=ghdl_version, - description = 'Interface to ghdl, a VHDL analyzer', - long_description = long_description, - author = 'Tristan Gingold', - author_email = 'tgingold@free.fr', - url = 'http://github.com/ghdl/ghdl', - license = 'GPL-2.0-or-later', - package_dir = {'libghdl' : 'src/vhdl/python/libghdl'}, - packages = ['libghdl', 'libghdl.thin', 'libghdl.thin.vhdl'], - cmdclass = { - 'build': GHDLBuild}) diff --git a/src/vhdl/python/grt-modules.adb b/src/vhdl/libghdl/grt-modules.adb index 7f40b0536..7f40b0536 100644 --- a/src/vhdl/python/grt-modules.adb +++ b/src/vhdl/libghdl/grt-modules.adb diff --git a/src/vhdl/python/libghdl.adb b/src/vhdl/libghdl/libghdl.adb index 7226e5295..7226e5295 100644 --- a/src/vhdl/python/libghdl.adb +++ b/src/vhdl/libghdl/libghdl.adb diff --git a/src/vhdl/python/libghdl.ads b/src/vhdl/libghdl/libghdl.ads index dbc6b260e..dbc6b260e 100644 --- a/src/vhdl/python/libghdl.ads +++ b/src/vhdl/libghdl/libghdl.ads diff --git a/src/vhdl/python/libghdl/__init__.py b/src/vhdl/python/libghdl/__init__.py deleted file mode 100644 index 9bae63a8e..000000000 --- a/src/vhdl/python/libghdl/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -import ctypes -import os.path -from libghdl.config import libghdl_filename - -# Load the DLL. -_basedir = os.path.dirname(__file__) -libghdl = ctypes.CDLL(os.path.join(_basedir, libghdl_filename)) - -# Low-level initialization (elaboration). -libghdl.libghdl_init() - -# Set the default prefix. -if False: - _prefix = os.path.join(_basedir, "ghdl") - _prefix_opt = ("--PREFIX=" + _prefix).encode('utf-8') - libghdl.libghdl__set_option( - ctypes.c_char_p(_prefix_opt), len(_prefix_opt)) - -# libghdl - -_set_option = libghdl.libghdl__set_option -_analyze_file = libghdl.libghdl__analyze_file - - -def set_option(opt): - return _set_option(ctypes.c_char_p(opt), len(opt)) - - -def analyze_init(): - return libghdl.libghdl__analyze_init() - - -def analyze_file(filename): - return _analyze_file(ctypes.c_char_p(filename), len(filename)) |