diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2020-12-28 23:12:21 +0100 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2020-12-28 23:12:21 +0100 |
commit | 13fd5ccc6a8b9e59212b5493eb319c6f932eb906 (patch) | |
tree | 8ba15020049ae61917ca2c389a5b28feab6d6511 | |
parent | bfd38acc0c6f3f82823fa1a496e90ef1e64da997 (diff) | |
parent | 8da838eff60114746a5d81e7d0c21bb5e777546e (diff) | |
download | ghdl-13fd5ccc6a8b9e59212b5493eb319c6f932eb906.tar.gz ghdl-13fd5ccc6a8b9e59212b5493eb319c6f932eb906.tar.bz2 ghdl-13fd5ccc6a8b9e59212b5493eb319c6f932eb906.zip |
Merge remote-tracking branch 'github-umarcor/py/GHDL' into paebbels/pyGHDL
-rw-r--r-- | .github/workflows/push.yml | 32 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rwxr-xr-x | dist/ci-run.sh | 18 | ||||
-rw-r--r-- | dist/msys2-llvm/PKGBUILD (renamed from dist/msys2-mingw/llvm/PKGBUILD) | 2 | ||||
-rw-r--r-- | dist/msys2-mcode/PKGBUILD (renamed from dist/msys2-mingw/mcode/PKGBUILD) | 2 | ||||
-rw-r--r-- | dist/msys2-mingw/run.sh | 91 | ||||
-rw-r--r-- | doc/index.rst | 2 | ||||
-rw-r--r-- | doc/internals/AST.rst | 2 | ||||
-rw-r--r-- | doc/using/py/pyutils.rst | 4 | ||||
-rw-r--r-- | doc/using/py/thin.rst | 48 | ||||
-rw-r--r-- | doc/using/py/vhdl.rst | 79 | ||||
-rw-r--r-- | doc/using/pyGHDL/index.rst (renamed from doc/using/py/libghdl.rst) | 4 | ||||
-rw-r--r-- | doc/using/pyGHDL/libghdl.rst | 49 | ||||
-rw-r--r-- | doc/using/pyGHDL/pyutils.rst | 4 | ||||
-rw-r--r-- | doc/using/pyGHDL/vhdl.rst | 79 | ||||
-rwxr-xr-x | scripts/pnodes.py (renamed from pyGHDL/xtools/pnodes.py) | 0 | ||||
-rwxr-xr-x | scripts/pnodespy.py (renamed from pyGHDL/xtools/pnodespy.py) | 0 | ||||
-rw-r--r-- | src/edif/Makefile | 12 | ||||
-rw-r--r-- | src/psl/Makefile | 11 | ||||
-rw-r--r-- | src/vhdl/Makefile | 35 | ||||
-rw-r--r-- | testsuite/pyunit/testsuite.sh | 53 | ||||
-rwxr-xr-x | testsuite/testsuite.sh | 27 |
24 files changed, 239 insertions, 321 deletions
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 179b833e0..46346ae1e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -115,15 +115,14 @@ jobs: max-parallel: 2 matrix: include: [ - {installs: "MINGW32", pkg: "mcode"}, - #{installs: "MINGW32", pkg: "llvm"}, ! Not yet functional - #{installs: "MINGW64", pkg: "mcode"}, ! mcode is not yet supported on win64 - {installs: "MINGW64", pkg: "llvm"}, + {installs: "MINGW32", arch: i686, pkg: "mcode"}, + #{installs: "MINGW32", arch: i686, pkg: "llvm"}, ! Not yet functional + #{installs: "MINGW64", arch: x86_64, pkg: "mcode"}, ! mcode is not yet supported on win64 + {installs: "MINGW64", arch: x86_64, pkg: "llvm"}, ] name: '🟪 MSYS2 · ${{ matrix.installs }} · ${{ matrix.pkg }}' env: MINGW_INSTALLS: ${{ matrix.installs }} - TARGET: ${{ matrix.pkg }} defaults: run: shell: msys2 {0} @@ -134,29 +133,40 @@ jobs: with: msystem: MSYS update: true - install: base-devel git + install: > + base-devel + git + mingw-w64-${{ matrix.arch }}-toolchain - run: git config --global core.autocrlf input shell: bash - name: '🧰 Checkout' uses: actions/checkout@v2 + with: + # The command 'git describe' (used for version) needs the history. + fetch-depth: 0 + + - name: Build package + run: | + cd dist/msys2-${{ matrix.pkg }} + makepkg-mingw --noconfirm --noprogressbar -sCLf - - name: Build and (hopefully) install package - run: ./dist/msys2-mingw/run.sh -b + - name: Install package + run: pacman --noconfirm -U dist/msys2-${{ matrix.pkg }}/mingw-w64-*-any.pkg.tar.zst - name: '📤 Upload artifact: builddir' uses: actions/upload-artifact@v2 with: name: ${{ matrix.installs }}-${{ matrix.pkg }}-builddir path: | - ./dist/msys2-mingw/${{ matrix.pkg }}/src/ - ./dist/msys2-mingw/${{ matrix.pkg }}/pkg/ + ./dist/msys2-${{ matrix.pkg }}/src/ + ./dist/msys2-${{ matrix.pkg }}/pkg/ - name: '📤 Upload artifact: package' uses: actions/upload-artifact@v2 with: - path: ./dist/msys2-mingw/${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst + path: ./dist/msys2-${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst - name: Test package run: | diff --git a/Makefile.in b/Makefile.in index 1ef92ac8d..c089789d5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -457,7 +457,7 @@ uninstall.libghdl: libghdl-py.tgz: [ -d pythonb ] || $(MKDIR) pythonb - $(CP) -r $(srcdir)/python/libghdl $(srcdir)/python/setup.py pythonb + $(CP) -r $(srcdir)/pyGHDL/libghdl $(srcdir)/setup.py pythonb tar -zcvf $@ -C pythonb . ################ ghwdump ################################################# @@ -98,7 +98,7 @@ That's all! - `libghdl` is a shared library that includes a subset of the regular features plus some features to be used by extension tools (i.e. `libghdl-py`). This is built along with the regular GHDL and it supports both non-synthesisable and synthesisable code. Nonetheless, this is not for users, but for tools built on top of the core. When configured along with `--enable-synth`, this shared library includes **[experimental]** synthesis features too. -- [libghdl-py](python/libghdl) is a Python interface to `libghdl`. Currently, it is only used by `ghdl-ls`; however, it can be useful for advanced users which are willing to build Python utilities based on GHDL. +- [pyGHDL](pyGHDL) is a Python interface to `libghdl`. Currently, it is only used by `ghdl-ls`; however, it can be useful for advanced users which are willing to build Python utilities based on GHDL. - **[experimental]** [ghdl-yosys-plugin](https://github.com/ghdl/ghdl-yosys-plugin) is the integration of GHDL as a frontend plugin module for [Yosys Open SYnthesis Suite](http://www.clifford.at/yosys/), which uses the `libghdl` library (built with `--enable-synth`). @@ -190,7 +190,7 @@ fi # Check the version of libghdl is correct. if [ "$enable_libghdl" = true ]; then - libghdl_version="$srcdir/python/libghdl/version.py" + libghdl_version="$srcdir/pyGHDL/libghdl/version.py" # Extract content between single quotes in version.py, to avoid false positives due to LF/CRLF mismatch. if [ "$ghdl_version" != "`sed 's/.*"\(.*\)".*/\1/g' $libghdl_version`" ]; then echo "Sorry, the version of $libghdl_version is not correct" diff --git a/dist/ci-run.sh b/dist/ci-run.sh index cd4a2572b..1db79fc34 100755 --- a/dist/ci-run.sh +++ b/dist/ci-run.sh @@ -420,12 +420,24 @@ ci_run () { if [ "x$IS_MACOS" = "xtrue" ]; then CC=clang \ prefix="`cd ./install-mcode; pwd`/usr/local" \ - ./testsuite/testsuite.sh sanity gna vests vpi + ./testsuite/testsuite.sh sanity pyunit gna vests vpi else # Build ghdl/ghdl:$GHDL_IMAGE_TAG image build_img_ghdl + case "$GHDL_IMAGE_TAG" in + *ubuntu*) + GHDL_TEST_IMAGE="test:$GHDL_IMAGE_TAG-py" + docker build -t "$GHDL_TEST_IMAGE" - <<-EOF +FROM ghdl/ghdl:$GHDL_IMAGE_TAG +RUN apt update -qq && apt install -y python +EOF + ;; + *) + GHDL_TEST_IMAGE="ghdl/ghdl:$GHDL_IMAGE_TAG" + ;; + esac # Run test in docker container - tests="sanity" + tests="sanity pyunit" if [ "x$ISGPL" != "xtrue" ]; then tests="$tests gna" fi @@ -434,7 +446,7 @@ ci_run () { tests="$tests synth" fi tests="$tests vpi" - $RUN "ghdl/ghdl:$GHDL_IMAGE_TAG" bash -c "GHDL=ghdl ./testsuite/testsuite.sh $tests" + $RUN "$GHDL_TEST_IMAGE" bash -c "GHDL=ghdl ./testsuite/testsuite.sh $tests" fi if [ ! -f testsuite/test_ok ]; then diff --git a/dist/msys2-mingw/llvm/PKGBUILD b/dist/msys2-llvm/PKGBUILD index 9fe2c28bd..6de6916dc 100644 --- a/dist/msys2-mingw/llvm/PKGBUILD +++ b/dist/msys2-llvm/PKGBUILD @@ -13,7 +13,7 @@ build() { cd "${srcdir}/builddir" export CC=clang export CXX=clang++ - ../../../../../configure --prefix=${MINGW_PREFIX} --with-llvm-config="llvm-config --link-static" LDFLAGS="-static" --enable-libghdl --enable-synth + ../../../../configure --prefix=${MINGW_PREFIX} --with-llvm-config="llvm-config --link-static" LDFLAGS="-static" --enable-libghdl --enable-synth make GNATMAKE="gnatmake -j$(nproc)" } diff --git a/dist/msys2-mingw/mcode/PKGBUILD b/dist/msys2-mcode/PKGBUILD index 75205b025..70423d64d 100644 --- a/dist/msys2-mingw/mcode/PKGBUILD +++ b/dist/msys2-mcode/PKGBUILD @@ -11,7 +11,7 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-gcc-ada") build() { mkdir "${srcdir}/builddir" cd "${srcdir}/builddir" - ../../../../../configure --prefix=${MINGW_PREFIX} LDFLAGS=-static --enable-libghdl --enable-synth + ../../../../configure --prefix=${MINGW_PREFIX} LDFLAGS=-static --enable-libghdl --enable-synth make GNATMAKE="gnatmake -j$(nproc)" } diff --git a/dist/msys2-mingw/run.sh b/dist/msys2-mingw/run.sh deleted file mode 100644 index 186520b05..000000000 --- a/dist/msys2-mingw/run.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh - -cd $(dirname $0) - -# Stop in case of error -set -e - -enable_color() { - ENABLECOLOR='-c ' - ANSI_RED="\033[31m" - ANSI_GREEN="\033[32m" - ANSI_YELLOW="\033[33m" - ANSI_BLUE="\033[34m" - ANSI_MAGENTA="\033[35m" - ANSI_GRAY="\033[90m" - ANSI_CYAN="\033[36;1m" - ANSI_DARKCYAN="\033[36m" - ANSI_NOCOLOR="\033[0m" -} - -disable_color() { unset ENABLECOLOR ANSI_RED ANSI_GREEN ANSI_YELLOW ANSI_BLUE ANSI_MAGENTA ANSI_CYAN ANSI_DARKCYAN ANSI_NOCOLOR; } -enable_color - -print_start() { - if [ "x$2" != "x" ]; then - COL="$2" - elif [ "x$BASE_COL" != "x" ]; then - COL="$BASE_COL" - else - COL="$ANSI_YELLOW" - fi - printf "${COL}${1}$ANSI_NOCOLOR\n" -} - -gstart () { - print_start "$@" -} -gend () { - : -} -gblock () { - gstart "$1" - shift - $@ - gend -} - -[ -n "$CI" ] && { - echo "INFO: set 'gstart' and 'gend' for CI" - gstart () { - printf '::group::' - print_start "$@" - SECONDS=0 - } - - gend () { - duration=$SECONDS - echo '::endgroup::' - printf "${ANSI_GRAY}took $(($duration / 60)) min $(($duration % 60)) sec.${ANSI_NOCOLOR}\n" - } -} || echo "INFO: not in CI" - -#--- - -if [ -z "$TARGET" ]; then - printf "${ANSI_RED}Undefined TARGET!$ANSI_NOCOLOR" - exit 1 -fi -cd "$TARGET" - -# The command 'git describe' (used for version) needs the history. Get it. -# But the following command fails if the repository is complete. -gblock "Fetch --unshallow" git fetch --unshallow || true - -case "$MINGW_INSTALLS" in - *32) - TARBALL_ARCH="i686" - ;; - *64) - TARBALL_ARCH="x86_64" - ;; - *) - printf "${ANSI_RED}Unknown MINGW_INSTALLS=${MINGW_INSTALLS}!$ANSI_NOCOLOR" - exit 1 -esac - -gblock 'Install toolchain' pacman -S --noconfirm --needed base-devel mingw-w64-${TARBALL_ARCH}-toolchain -gblock 'Build package' makepkg-mingw --noconfirm --noprogressbar -sCLf --noarchive -gblock 'Archive package' makepkg-mingw --noconfirm --noprogressbar -R -gblock 'List artifacts' ls -la -gblock 'Install package' pacman --noconfirm -U "mingw-w64-${TARBALL_ARCH}-ghdl-${TARGET}-ci"-*-any.pkg.tar.zst diff --git a/doc/index.rst b/doc/index.rst index 8ea01b675..3fc554d56 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -145,7 +145,7 @@ GHDL using/Foreign using/ImplementationOfVHDL using/ImplementationOfVITAL - using/py/libghdl + using/pyGHDL/index .. raw:: latex diff --git a/doc/internals/AST.rst b/doc/internals/AST.rst index 488fa6d71..ad52f0286 100644 --- a/doc/internals/AST.rst +++ b/doc/internals/AST.rst @@ -75,7 +75,7 @@ either a node reference, a boolean flag or a enumerated type (like node or to a list. The accessors for the node are generated automatically by the python -script :file:`src/xtools/pnodes.py`. +script :file:`src/scripts/pnodes.py`. Why a meta-model ? ****************** diff --git a/doc/using/py/pyutils.rst b/doc/using/py/pyutils.rst deleted file mode 100644 index 58a84496a..000000000 --- a/doc/using/py/pyutils.rst +++ /dev/null @@ -1,4 +0,0 @@ -libghdl.thin.vhdl.pyutils -========================= - -.. automodule:: libghdl.thin.vhdl.pyutils diff --git a/doc/using/py/thin.rst b/doc/using/py/thin.rst deleted file mode 100644 index e02b48aec..000000000 --- a/doc/using/py/thin.rst +++ /dev/null @@ -1,48 +0,0 @@ -libghdl.thin -============ - -libghdl.thin.errorout ---------------------- - -.. automodule:: libghdl.thin.errorout - -libghdl.thin.errorout_console ------------------------------ - -.. automodule:: libghdl.thin.errorout_console - -libghdl.thin.errorout_memory ------------------------------ - -.. automodule:: libghdl.thin.errorout_memory - -libghdl.thin.files_map ----------------------- - -.. automodule:: libghdl.thin.files_map - -libghdl.thin.files_map_editor ------------------------------ - -.. automodule:: libghdl.thin.files_map_editor - -libghdl.thin.flags ------------------- - -.. automodule:: libghdl.thin.flags - -libghdl.thin.libraries ----------------------- - -.. automodule:: libghdl.thin.libraries - -libghdl.thin.name_table ------------------------ - -.. automodule:: libghdl.thin.name_table - -libghdl.thin.std_names ----------------------- - -.. automodule:: libghdl.thin.std_names - diff --git a/doc/using/py/vhdl.rst b/doc/using/py/vhdl.rst deleted file mode 100644 index e978cc6e8..000000000 --- a/doc/using/py/vhdl.rst +++ /dev/null @@ -1,79 +0,0 @@ -libghdl.thin.vhdl -================= - -.. automodule:: libghdl.thin.vhdl - -libghdl.thin.vhdl.canon ------------------------ - -.. automodule:: libghdl.thin.vhdl.canon - -libghdl.thin.vhdl.elocations ----------------------------- - -.. automodule:: libghdl.thin.vhdl.elocations - -libghdl.thin.vhdl.flists ------------------------- - -.. automodule:: libghdl.thin.vhdl.flists - -libghdl.thin.vhdl.formatters ----------------------------- - -.. automodule:: libghdl.thin.vhdl.formatters - -libghdl.thin.vhdl.ieee ----------------------- - -.. automodule:: libghdl.thin.vhdl.ieee - -libghdl.thin.vhdl.lists ------------------------ - -.. automodule:: libghdl.thin.vhdl.lists - -libghdl.thin.vhdl.nodes ------------------------ - -.. automodule:: libghdl.thin.vhdl.nodes - -libghdl.thin.vhdl.nodes_meta ----------------------------- - -.. automodule:: libghdl.thin.vhdl.nodes_meta - -libghdl.thin.vhdl.nodes_utils ------------------------------ - -.. automodule:: libghdl.thin.vhdl.nodes_utils - -libghdl.thin.vhdl.parse ------------------------ - -.. automodule:: libghdl.thin.vhdl.parse - -libghdl.thin.vhdl.scanner -------------------------- - -.. automodule:: libghdl.thin.vhdl.scanner - -libghdl.thin.vhdl.sem ---------------------- - -.. automodule:: libghdl.thin.vhdl.sem - -libghdl.thin.vhdl.sem_lib -------------------------- - -.. automodule:: libghdl.thin.vhdl.sem_lib - -libghdl.thin.vhdl.std_package ------------------------------ - -.. automodule:: libghdl.thin.vhdl.std_package - -libghdl.thin.vhdl.tokens ------------------------- - -.. automodule:: libghdl.thin.vhdl.tokens diff --git a/doc/using/py/libghdl.rst b/doc/using/pyGHDL/index.rst index 7c95ab8c1..ddbddec45 100644 --- a/doc/using/py/libghdl.rst +++ b/doc/using/pyGHDL/index.rst @@ -3,11 +3,9 @@ Python Interface ################ -.. automodule:: libghdl - .. toctree:: :hidden: - thin + libghdl vhdl pyutils diff --git a/doc/using/pyGHDL/libghdl.rst b/doc/using/pyGHDL/libghdl.rst new file mode 100644 index 000000000..cc73b3a96 --- /dev/null +++ b/doc/using/pyGHDL/libghdl.rst @@ -0,0 +1,49 @@ +libghdl +======= + +.. automodule:: libghdl + +libghdl.errorout +---------------- + +.. automodule:: libghdl.errorout + +libghdl.errorout_console +------------------------ + +.. automodule:: libghdl.errorout_console + +libghdl.errorout_memory +----------------------- + +.. automodule:: libghdl.errorout_memory + +libghdl.files_map +----------------- + +.. automodule:: libghdl.files_map + +libghdl.files_map_editor +------------------------ + +.. automodule:: libghdl.files_map_editor + +libghdl.flags +------------- + +.. automodule:: libghdl.flags + +libghdl.libraries +----------------- + +.. automodule:: libghdl.libraries + +libghdl.name_table +------------------ + +.. automodule:: libghdl.name_table + +libghdl.std_names +----------------- + +.. automodule:: libghdl.std_names diff --git a/doc/using/pyGHDL/pyutils.rst b/doc/using/pyGHDL/pyutils.rst new file mode 100644 index 000000000..5efe078b8 --- /dev/null +++ b/doc/using/pyGHDL/pyutils.rst @@ -0,0 +1,4 @@ +libghdl.pyutils +=============== + +.. automodule:: libghdl.pyutils diff --git a/doc/using/pyGHDL/vhdl.rst b/doc/using/pyGHDL/vhdl.rst new file mode 100644 index 000000000..a18538011 --- /dev/null +++ b/doc/using/pyGHDL/vhdl.rst @@ -0,0 +1,79 @@ +libghdl.vhdl +============ + +.. automodule:: libghdl.vhdl + +libghdl.vhdl.canon +------------------ + +.. automodule:: libghdl.vhdl.canon + +libghdl.vhdl.elocations +----------------------- + +.. automodule:: libghdl.vhdl.elocations + +libghdl.vhdl.flists +------------------- + +.. automodule:: libghdl.vhdl.flists + +libghdl.vhdl.formatters +----------------------- + +.. automodule:: libghdl.vhdl.formatters + +libghdl.vhdl.ieee +----------------- + +.. automodule:: libghdl.vhdl.ieee + +libghdl.vhdl.lists +------------------ + +.. automodule:: libghdl.vhdl.lists + +libghdl.vhdl.nodes +------------------ + +.. automodule:: libghdl.vhdl.nodes + +libghdl.vhdl.nodes_meta +----------------------- + +.. automodule:: libghdl.vhdl.nodes_meta + +libghdl.vhdl.nodes_utils +------------------------ + +.. automodule:: libghdl.vhdl.nodes_utils + +libghdl.vhdl.parse +------------------ + +.. automodule:: libghdl.vhdl.parse + +libghdl.vhdl.scanner +-------------------- + +.. automodule:: libghdl.vhdl.scanner + +libghdl.vhdl.sem +---------------- + +.. automodule:: libghdl.vhdl.sem + +libghdl.vhdl.sem_lib +-------------------- + +.. automodule:: libghdl.vhdl.sem_lib + +libghdl.vhdl.std_package +------------------------ + +.. automodule:: libghdl.vhdl.std_package + +libghdl.vhdl.tokens +------------------- + +.. automodule:: libghdl.vhdl.tokens diff --git a/pyGHDL/xtools/pnodes.py b/scripts/pnodes.py index 793c1c712..793c1c712 100755 --- a/pyGHDL/xtools/pnodes.py +++ b/scripts/pnodes.py diff --git a/pyGHDL/xtools/pnodespy.py b/scripts/pnodespy.py index 0e0f5ba9e..0e0f5ba9e 100755 --- a/pyGHDL/xtools/pnodespy.py +++ b/scripts/pnodespy.py diff --git a/src/edif/Makefile b/src/edif/Makefile index 3a3cb4a8b..e7e449483 100644 --- a/src/edif/Makefile +++ b/src/edif/Makefile @@ -6,8 +6,16 @@ ortho_srcdir=../ortho GEN_SRCS=edif-nodes.adb edif-nodes_meta.ads edif-nodes_meta.adb CC=gcc -PNODES=../../python/xtools/pnodes.py -PNODES_ARGS=--field-file=edif-nodes.adb.in --kind-file=edif-nodes.ads --node-file=edif-nodes.ads --template-file=edif-nodes.adb.in --meta-basename=edif-nodes_meta --kind-type=Nkind --kind-range-prefix=Nkinds_ --kind-prefix=N_ --node-type=Node +PNODES=../../scripts/pnodes.py +PNODES_ARGS=--field-file=edif-nodes.adb.in \ + --kind-file=edif-nodes.ads \ + --node-file=edif-nodes.ads \ + --template-file=edif-nodes.adb.in \ + --meta-basename=edif-nodes_meta \ + --kind-type=Nkind \ + --kind-range-prefix=Nkinds_ \ + --kind-prefix=N_ \ + --node-type=Node all: dump_edif diff --git a/src/psl/Makefile b/src/psl/Makefile index fdcfccaf7..9d7627263 100644 --- a/src/psl/Makefile +++ b/src/psl/Makefile @@ -20,11 +20,18 @@ # be committed and distribued with the sources, so that users don't need to # regenerate them (and don't need to have python installed). -PNODES=../../python/xtools/pnodes.py +PNODES=../../scripts/pnodes.py DEPS=psl-nodes.ads psl-nodes.adb.in $(PNODES) -PNODES_FLAGS=--field-file=psl-nodes.adb.in --kind-file=psl-nodes.ads --node-file=psl-nodes.ads --template-file=psl-nodes.adb.in --meta-basename=psl-nodes_meta --kind-type=Nkind --kind-prefix=N_ --node-type=Node +PNODES_FLAGS=--field-file=psl-nodes.adb.in \ + --kind-file=psl-nodes.ads \ + --node-file=psl-nodes.ads \ + --template-file=psl-nodes.adb.in \ + --meta-basename=psl-nodes_meta \ + --kind-type=Nkind \ + --kind-prefix=N_ \ + --node-type=Node GEN_FILES=psl-nodes.adb psl-nodes_meta.ads psl-nodes_meta.adb diff --git a/src/vhdl/Makefile b/src/vhdl/Makefile index 754f063dd..08277b4d5 100644 --- a/src/vhdl/Makefile +++ b/src/vhdl/Makefile @@ -20,18 +20,23 @@ # be committed and distribued with the sources, so that users don't need to # regenerate them (and don't need to have python installed). -PNODES=../../python/xtools/pnodes.py -PNODESPY=../../python/xtools/pnodespy.py +PNODES=../../scripts/pnodes.py +PNODESPY=../../scripts/pnodespy.py DEPS=vhdl-nodes.ads vhdl-nodes.adb.in $(PNODES) -GEN_FILES=vhdl-nodes.adb vhdl-nodes_meta.ads vhdl-nodes_meta.adb \ - vhdl-elocations.adb vhdl-elocations_meta.ads vhdl-elocations_meta.adb \ - ../../python/libghdl/thin/vhdl/nodes.py \ - ../../python/libghdl/thin/vhdl/nodes_meta.py \ - ../../python/libghdl/thin/vhdl/tokens.py \ - ../../python/libghdl/thin/vhdl/elocations.py \ - ../../python/libghdl/thin/errorout.py ../../python/libghdl/thin/std_names.py +GEN_FILES=vhdl-nodes.adb \ + vhdl-nodes_meta.ads \ + vhdl-nodes_meta.adb \ + vhdl-elocations.adb \ + vhdl-elocations_meta.ads \ + vhdl-elocations_meta.adb \ + ../../pyGHDL/libghdl/vhdl/nodes.py \ + ../../pyGHDL/libghdl/vhdl/nodes_meta.py \ + ../../pyGHDL/libghdl/vhdl/tokens.py \ + ../../pyGHDL/libghdl/vhdl/elocations.py \ + ../../pyGHDL/libghdl/errorout.py \ + ../../pyGHDL/libghdl/std_names.py NODES_FLAGS=--node-file=vhdl-nodes.ads --field-file=vhdl-nodes.adb.in \ --template-file=vhdl-nodes.adb.in --kind-file=vhdl-nodes.ads \ @@ -73,32 +78,32 @@ vhdl-elocations_meta.adb: vhdl-elocations_meta.adb.in vhdl-elocations.ads $(DEPS $(PNODES) $(ELOCATIONS_FLAGS) meta_body > $@ chmod -w $@ -../../python/libghdl/thin/vhdl/nodes.py: $(DEPS) $(PNODESPY) +../../pyGHDL/libghdl/vhdl/nodes.py: $(DEPS) $(PNODESPY) $(RM) $@ $(PNODESPY) $(NODES_FLAGS) libghdl-nodes > $@ chmod -w $@ -../../python/libghdl/thin/vhdl/nodes_meta.py: $(DEPS) $(PNODESPY) +../../pyGHDL/libghdl/vhdl/nodes_meta.py: $(DEPS) $(PNODESPY) $(RM) $@ $(PNODESPY) $(NODES_FLAGS) libghdl-meta > $@ chmod -w $@ -../../python/libghdl/thin/std_names.py: $(PNODESPY) ../std_names.ads +../../pyGHDL/libghdl/std_names.py: $(PNODESPY) ../std_names.ads $(RM) $@ $(PNODESPY) $(NODES_FLAGS) libghdl-names > $@ chmod -w $@ -../../python/libghdl/thin/vhdl/tokens.py: $(PNODESPY) vhdl-tokens.ads +../../pyGHDL/libghdl/vhdl/tokens.py: $(PNODESPY) vhdl-tokens.ads $(RM) $@ $(PNODESPY) $(NODES_FLAGS) libghdl-tokens > $@ chmod -w $@ -../../python/libghdl/thin/vhdl/elocations.py: $(PNODESPY) vhdl-elocations.ads +../../pyGHDL/libghdl/vhdl/elocations.py: $(PNODESPY) vhdl-elocations.ads $(RM) $@ $(PNODESPY) $(ELOCATIONS_FLAGS) libghdl-elocs > $@ chmod -w $@ -../../python/libghdl/thin/errorout.py: $(PNODESPY) ../errorout.ads +../../pyGHDL/libghdl/errorout.py: $(PNODESPY) ../errorout.ads $(RM) $@ $(PNODESPY) $(ELOCATIONS_FLAGS) libghdl-errorout > $@ chmod -w $@ diff --git a/testsuite/pyunit/testsuite.sh b/testsuite/pyunit/testsuite.sh deleted file mode 100644 index 12b367f2c..000000000 --- a/testsuite/pyunit/testsuite.sh +++ /dev/null @@ -1,53 +0,0 @@ -#! /bin/sh - -# Driver for a testsuite. - -set -e - -# This is the only place where test dirs are specified. Do not duplicate this -# line -dirs="*[0-9]" - -failures="" -full=n - -for opt; do - case "$opt" in - -k | --keep-going) full=y ;; - --dir=*) dirs=`echo $opt | sed -e 's/--dir=//'` ;; - --skip=*) d=`echo $opt | sed -e 's/--skip=//'` - dirs=`echo "" $dirs | sed -e "s/ $d//"` ;; - --start-at=*) d=`echo $opt | sed -e 's/--start-at=//'` - dirs=`echo "" $dirs | sed -e "s/^.* $d//"` - dirs="$d $dirs" ;; - --list-tests) echo $dirs; exit 0;; - *) echo "Unknown option $opt" - exit 2 - ;; - esac -done - -singlerun() { - echo "" - echo "dir $1:" - cd $1 - if ! ./testsuite.sh; then - echo "#################################################################" - echo "######### FAILURE: $1" - echo "#################################################################" - if [ $2 = "y" ]; then - failures="$failures $1" - else - exit 1; - fi - fi - cd .. -} - -for i in $dirs; do singlerun $i $full; done - -if [ x"$failures" = x"" ]; then - echo "tests are successful" && exit 0 -else - echo "test failed ($failures)" && exit 1 -fi diff --git a/testsuite/testsuite.sh b/testsuite/testsuite.sh index fd686ccd0..b77ccdbc5 100755 --- a/testsuite/testsuite.sh +++ b/testsuite/testsuite.sh @@ -112,7 +112,7 @@ do_sanity () { [ "$failures" = "" ] || exit 1 } -# The GNA testsuite: regression testsuite using reports/issues from gna.org +# The GNA testsuite: regression testsuite using reports/issues from gna.org and from GitHub do_gna () { gstart "[GHDL - test] gna" cd gna @@ -138,6 +138,26 @@ do_gna () { [ "$failures" = "" ] || exit 1 } +# The Python Unit testsuite: regression testsuite for Python bindings to libghdl +do_pyunit () { + gstart "[GHDL - test] pyunit" + cd pyunit + + dirs=`./testsuite.sh --list-tests` + if ./testsuite.sh > test.log 2>&1 ; then + printf "pyunit: ${ANSI_GREEN}ok${ANSI_NOCOLOR}\n" + # Don't disp log + else + printf "pyunit: ${ANSI_RED}failed${ANSI_NOCOLOR}\n" + cat test.log + failures="$failures" + fi + + cd .. + gend + [ "$failures" = "" ] || exit 1 +} + # The VESTS testsuite: compliance testsuite, from: https://github.com/nickg/vests.git 388250486a do_vests () { gstart "[GHDL - test] vests" @@ -226,7 +246,7 @@ for opt; do esac done -if [ "x$tests" = "x" ]; then tests="sanity gna vests synth vpi"; fi +if [ "x$tests" = "x" ]; then tests="sanity pyunit gna vests synth vpi"; fi echo "tests: $tests" @@ -234,10 +254,11 @@ echo "tests: $tests" do_test() { case $1 in sanity) do_sanity;; + pyunit) do_pyunit;; gna) do_gna;; vests) do_vests;; synth) do_synth;; - vpi) do_vpi;; + vpi) do_vpi;; *) printf "${ANSI_RED}$0: test name '$1' is unknown${ANSI_NOCOLOR}\n" exit 1;; |