From e5c609f31d485dcb5796103d5b8b0cf332960070 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 16 Jan 2021 08:35:38 +0100 Subject: libraries: unuse 'openieee', rename enable_openieee to enable_gplcompat --- .github/workflows/push.yml | 2 +- Makefile.in | 43 ++++++++------- configure | 30 +++++------ doc/getting/Releases.rst | 17 ++++-- libraries/Makefile.inc | 98 ++++++++++++++++++---------------- libraries/openieee/upf-body.vhdl | 26 --------- libraries/openieee/upf.vhdl | 19 ------- libraries/upf/upf-body.vhdl | 26 +++++++++ libraries/upf/upf.vhdl | 19 +++++++ scripts/ci-run.sh | 17 +++--- testsuite/sanity/004all08/testsuite.sh | 6 --- 11 files changed, 159 insertions(+), 144 deletions(-) delete mode 100644 libraries/openieee/upf-body.vhdl delete mode 100644 libraries/openieee/upf.vhdl create mode 100644 libraries/upf/upf-body.vhdl create mode 100644 libraries/upf/upf.vhdl diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ec2d10431..5ccca9a90 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -113,7 +113,7 @@ jobs: - name: '🧰 Checkout' uses: actions/checkout@v2 - - run: TASK=buster+mcode ./scripts/ci-run.sh -c --gpl --no-synth + - run: TASK=buster+mcode ./scripts/ci-run.sh -c --gplcompat # # GNU/Linux diff --git a/Makefile.in b/Makefile.in index c1967c606..cd9e8c954 100644 --- a/Makefile.in +++ b/Makefile.in @@ -37,7 +37,7 @@ ghdl_version=@ghdl_version@ libghdl_version=@libghdl_version@ enable_werror=@enable_werror@ enable_checks=@enable_checks@ -enable_openieee=@enable_openieee@ +enable_gplcompat=@enable_gplcompat@ enable_libghdl=@enable_libghdl@ default_pic=@default_pic@ @@ -118,7 +118,7 @@ LIBDST_DIR:=$(libdirsuffix) LIBVHDL_FLAGS_TO_PASS=\ LIBSRC_DIR="$(LIBSRC_DIR)" \ LIBDST_DIR="$(LIBDST_DIR)" \ - enable_openieee="$(enable_openieee)" \ + enable_gplcompat="$(enable_gplcompat)" \ LN="$(LN)" CP="$(CP)" MKDIR="$(MKDIR)" # Object files from grt for the synthesis. @@ -533,21 +533,27 @@ install.vpi.local: all.vpi ################ Libraries ############################################### -VHDLLIB_SUBDIRS_COMMON= src/std src/std/v87 src/std/v93 src/std/v08 \ - src/synopsys src/synopsys/v08 \ - std/v87 ieee/v87 \ - std/v93 ieee/v93 \ - std/v08 ieee/v08 \ - src/openieee - -VHDLLIB_SUBDIRS_FULL= src/ieee src/vital95 src/vital2000 \ - src/ieee/v87 src/ieee/v93 src/ieee2008 - -ifeq ($(enable_openieee),false) -VHDLLIB_SUBDIRS=$(VHDLLIB_SUBDIRS_COMMON) $(VHDLLIB_SUBDIRS_FULL) -else -VHDLLIB_SUBDIRS=$(VHDLLIB_SUBDIRS_COMMON) \ - src/openieee/v87 src/openieee/v93 src/openieee/v08 +VHDLLIB_SUBDIRS= \ + ieee/v87 \ + ieee/v93 \ + ieee/v08 \ + std/v87 \ + std/v93 \ + std/v08 \ + src/ieee \ + src/ieee/v87 \ + src/ieee/v93 \ + src/ieee2008 \ + src/std \ + src/std/v87 \ + src/std/v93 \ + src/std/v08 \ + src/synopsys \ + src/synopsys/v08 \ + src/upf + +ifeq ($(enable_gplcompat),false) +VHDLLIB_SUBDIRS+=src/vital95 src/vital2000 endif install.dirs: @@ -610,8 +616,7 @@ create-dirs: force # Remove non GPL compatible source files clean-pure-gpl: -# IEEE 1164 or vital libraries aren't GPL compatible - $(RM) -rf libraries/ieee libraries/ieee2008 +# Vital libraries aren't GPL compatible $(RM) -rf libraries/vital95 libraries/vital2000 # The GNA testsuite contains open-source reproducer that may not be GPL. $(RM) -rf testsuite/gna diff --git a/configure b/configure index ed22ab255..bf247d659 100755 --- a/configure +++ b/configure @@ -41,7 +41,7 @@ build= build_mode= enable_werror=true enable_checks=true -enable_openieee=unknown +enable_gplcompat=unknown enable_libghdl=true enable_synth=true default_pic=false @@ -52,7 +52,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_libghdl 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_gplcompat enable_libghdl libghdl_version ghdl_version" # Find srcdir srcdir=`dirname $progname` @@ -102,8 +102,8 @@ for opt do --disable-werror) enable_werror=false;; --enable-checks) enable_checks=true;; --disable-checks) enable_checks=false;; - --enable-openieee) enable_openieee=true;; - --disable-openieee) enable_openieee=false;; + --enable-gplcompat) enable_gplcompat=true;; + --disable-gplcompat) enable_gplcompat=false;; --enable-libghdl) enable_libghdl=true;; --disable-libghdl) enable_libghdl=false;; --enable-synth) enable_synth=true;; @@ -133,7 +133,7 @@ Options [defaults in brackets]: --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-gplcompat use GPL-compatible sources for ieee library --enable-libghdl also build the libghdl shared library --disable-synth do not build with synthesis feature EOF @@ -198,19 +198,19 @@ if [ "$enable_libghdl" = true ]; then fi fi -# Default for enable_openieee -if [ "$enable_openieee" = "unknown" ]; then - if test -d $srcdir/libraries/ieee ; then - enable_openieee=false +# Default for enable_gplcompat +if [ "$enable_gplcompat" = "unknown" ]; then + if test -d $srcdir/libraries/vital95 && test -d $srcdir/libraries/vital2000; then + enable_gplcompat=false echo "Use full IEEE library" else - enable_openieee=true - echo "Use openieee source files for IEEE library (but partial)" + enable_gplcompat=true + echo "Use GPL-compatible source files for IEEE library (but partial)" fi -elif [ "$enable_openieee" = false ]; then - if ! test -d $srcdir/libraries/ieee ; then - echo "Sorry, full ieee library source files not present" - echo "consider --enable-openieee" +elif [ "$enable_gplcompat" = false ]; then + if ! test -d $srcdir/libraries/vital95 || ! test -d $srcdir/libraries/vital2000; then + echo "Sorry, full IEEE library source files not present" + echo "consider --enable-gplcompat" exit 1 fi fi diff --git a/doc/getting/Releases.rst b/doc/getting/Releases.rst index f076e9e4f..2a80d8591 100644 --- a/doc/getting/Releases.rst +++ b/doc/getting/Releases.rst @@ -9,14 +9,19 @@ Releases and sources Using package managers ********************** -Package managers of many popular distributions provide pre-built packages of GHDL. This is the case for `apt` (Debian/Ubuntu), `dnf` (Fedora/CentOS) or `pacman` (Arch Linux). Since GHDL supports three different backends and two library sets (ieee or openieee), at least six packages with different features might be available in each package manager. See differences between backends in :ref:`BUILD`. +Package managers of many popular distributions provide pre-built packages of GHDL. This is the case for `apt` +(Debian/Ubuntu), `dnf` (Fedora/CentOS) or `pacman` (Arch Linux). Since GHDL supports three different backends and two +library sets (_regular_ or GPL-compatible), at least six packages with different features might be available in each package +manager. See differences between backends in :ref:`BUILD`. .. _RELEASE:packages: Downloading pre-built packages ****************************** -Assets from nightly GHDL builds are available at `github.com/ghdl/ghdl/releases/nightly `_. These are mostly meant to be used in Continuous Integration (CI) workflows. Precisely, `setup-ghdl-ci `_ allows to easily setup nightly assets in GitHub Actions workflows. +Assets from nightly GHDL builds are available at `github.com/ghdl/ghdl/releases/nightly `__. +These are mostly meant to be used in Continuous Integration (CI) workflows. Precisely, `setup-ghdl-ci `__ +allows to easily setup nightly assets in GitHub Actions workflows. Furthermore, assets from stable builds are available for a larger set of platforms: @@ -61,8 +66,9 @@ Downloading Source Files .. HINT:: - All the following procedures will retrieve the latest development version of GHDL, i.e., the `master` branch at `github.com/ghdl/ghdl `_. - We do our best to keep it stable, but bugs can seldom be published. See `HINT` boxes below for instructions to get older releases. + All the following procedures will retrieve the latest development version of GHDL, i.e., the `master` branch at + `github.com/ghdl/ghdl `_. We do our best to keep it stable, but bugs can seldom be + published. See `HINT` boxes below for instructions to get older releases. .. _RELEASE:Sources:Zip: @@ -91,7 +97,8 @@ choose your desired format/version: .. HINT:: - To download a specific version of GHDL, use this alternative URL, where ```` is ``tar.gz`` or ``zip``: ``https://codeload.github.com/ghdl/ghdl//``. + To download a specific version of GHDL, use this alternative URL, where ```` is ``tar.gz`` or ``zip``: + ``https://codeload.github.com/ghdl/ghdl//``. .. _RELEASE:Sources:GitClone: diff --git a/libraries/Makefile.inc b/libraries/Makefile.inc index 941776c29..90b178893 100644 --- a/libraries/Makefile.inc +++ b/libraries/Makefile.inc @@ -26,38 +26,46 @@ vhdl.libs.all: vhdl.libs.v87 vhdl.libs.v93 vhdl.libs.v08 -enable_openieee=false +enable_gplcompat=false -ifeq ($(enable_openieee),false) -# Full libraries vhdl.libs.v87: std.v87 ieee.v87 vhdl.libs.v93: std.v93 ieee.v93 vhdl.libs.v08: std.v08 ieee.v08 $(LIBDST_DIR)/src/ieee2008/LICENSE -else -# GPL compatible -vhdl.libs.v87: std.v87 ieee.v87 -vhdl.libs.v93: std.v93 ieee.v93 -vhdl.libs.v08: std.v08 ieee.v08 -endif -STD_SRCS := textio.vhdl textio-body.vhdl -SYNOPSYS_BSRCS := std_logic_arith.vhdl \ - std_logic_unsigned.vhdl std_logic_signed.vhdl -SYNOPSYS_V_BSRCS := std_logic_misc.vhdl std_logic_misc-body.vhdl -SYNOPSYS8793_BSRCS := std_logic_textio.vhdl -UPF_SRCS := openieee/upf.vhdl openieee/upf-body.vhdl - -ifeq ($(enable_openieee),false) -IEEE_SRCS := std_logic_1164.vhdl std_logic_1164-body.vhdl \ - numeric_bit.vhdl numeric_bit-body.vhdl \ - numeric_std.vhdl numeric_std-body.vhdl -MATH_SRCS := math_real.vhdl math_real-body.vhdl \ - math_complex.vhdl math_complex-body.vhdl -VITAL95_BSRCS := vital95/vital_timing.vhdl vital95/vital_timing-body.vhdl \ - vital95/vital_primitives.vhdl vital95/vital_primitives-body.vhdl -VITAL2000_BSRCS := vital2000/timing_p.vhdl vital2000/timing_b.vhdl \ - vital2000/prmtvs_p.vhdl vital2000/prmtvs_b.vhdl \ - vital2000/memory_p.vhdl vital2000/memory_b.vhdl +STD_SRCS := \ + textio.vhdl \ + textio-body.vhdl + +SYNOPSYS_BSRCS := \ + std_logic_arith.vhdl \ + std_logic_unsigned.vhdl \ + std_logic_signed.vhdl + +SYNOPSYS_V_BSRCS := \ + std_logic_misc.vhdl \ + std_logic_misc-body.vhdl + +SYNOPSYS8793_BSRCS := \ + std_logic_textio.vhdl + +UPF_SRCS := \ + upf/upf.vhdl \ + upf/upf-body.vhdl + +IEEE_SRCS := \ + std_logic_1164.vhdl \ + std_logic_1164-body.vhdl \ + numeric_bit.vhdl \ + numeric_bit-body.vhdl \ + numeric_std.vhdl \ + numeric_std-body.vhdl + +MATH_SRCS := \ + math_real.vhdl \ + math_real-body.vhdl \ + math_complex.vhdl \ + math_complex-body.vhdl + IEEE08_BSRCS := \ ieee2008/std_logic_1164.vhdl ieee2008/std_logic_1164-body.vhdl \ ieee2008/std_logic_textio.vhdl \ @@ -78,19 +86,21 @@ IEEE08_BSRCS := \ IEEE87_BSRCS := $(addprefix ieee/v87/,$(IEEE_SRCS)) $(UPF_SRCS) IEEE93_BSRCS := $(addprefix ieee/v93/,$(IEEE_SRCS)) $(addprefix ieee/,$(MATH_SRCS)) $(UPF_SRCS) -else -IEEE_SRCS := std_logic_1164.vhdl std_logic_1164-body.vhdl \ - numeric_bit.vhdl numeric_bit-body.vhdl \ - numeric_std.vhdl numeric_std-body.vhdl -MATH_SRCS := math_real.vhdl math_real-body.vhdl VITAL95_BSRCS := VITAL2000_BSRCS := -IEEE08_BSRCS := v08/std_logic_1164.vhdl v08/std_logic_1164-body.vhdl \ - math_real.vhdl math_real-body.vhdl - -IEEE87_BSRCS := $(addprefix openieee/v87/,$(IEEE_SRCS)) $(UPF_SRCS) -IEEE93_BSRCS := $(addprefix openieee/v93/,$(IEEE_SRCS)) $(addprefix openieee/,$(MATH_SRCS)) $(UPF_SRCS) -IEEE08_BSRCS := $(addprefix openieee/,$(IEEE08_BSRCS)) $(UPF_SRCS) +ifeq ($(enable_gplcompat),false) +VITAL95_BSRCS := \ + vital95/vital_timing.vhdl \ + vital95/vital_timing-body.vhdl \ + vital95/vital_primitives.vhdl \ + vital95/vital_primitives-body.vhdl +VITAL2000_BSRCS := \ + vital2000/timing_p.vhdl \ + vital2000/timing_b.vhdl \ + vital2000/prmtvs_p.vhdl \ + vital2000/prmtvs_b.vhdl \ + vital2000/memory_p.vhdl \ + vital2000/memory_b.vhdl endif ANALYZE=$(GHDL) -a $(GHDL_FLAGS) @@ -158,7 +168,7 @@ $(STD87_DIR)/std-obj87.cf: $(ANALYZE_DEP) $(STD87_SRCS) $(LIBDST_DIR)/src/ieee/v87/%.vhdl: $(LIBSRC_DIR)/ieee/%.vhdl $(SED_V87) < $< > $@ -$(LIBDST_DIR)/src/openieee/v87/%.vhdl: $(LIBSRC_DIR)/openieee/v87/%.vhdl +$(LIBDST_DIR)/src/upf/%.vhdl: $(LIBSRC_DIR)/upf/%.vhdl $(CP) $< $@ $(LIBDST_DIR)/src/vital95/%.vhdl: $(LIBSRC_DIR)/vital95/%.vhdl @@ -203,13 +213,10 @@ $(STD93_DIR)/std-obj93.cf: $(ANALYZE_DEP) $(STD93_SRCS) $(LIBDST_DIR)/src/ieee/v93/%.vhdl: $(LIBSRC_DIR)/ieee/%.vhdl $(SED_V93) < $< > $@ -$(LIBDST_DIR)/src/ieee/%.vhdl: $(LIBSRC_DIR)/ieee/%.vhdl - $(CP) $< $@ - -$(LIBDST_DIR)/src/openieee/%.vhdl: $(LIBSRC_DIR)/openieee/%.vhdl +$(LIBDST_DIR)/src/upf/%.vhdl: $(LIBSRC_DIR)/upf/%.vhdl $(CP) $< $@ -$(LIBDST_DIR)/src/openieee/v93/%.vhdl: $(LIBSRC_DIR)/openieee/v93/%.vhdl +$(LIBDST_DIR)/src/ieee/%.vhdl: $(LIBSRC_DIR)/ieee/%.vhdl $(CP) $< $@ $(LIBDST_DIR)/src/vital2000/%.vhdl: $(LIBSRC_DIR)/vital2000/%.vhdl @@ -255,9 +262,10 @@ $(LIBDST_DIR)/src/ieee2008/%.vhdl: $(LIBSRC_DIR)/ieee2008/%.vhdl $(LIBDST_DIR)/src/ieee2008/LICENSE: $(LIBSRC_DIR)/ieee2008/LICENSE $(CP) $< $@ -$(LIBDST_DIR)/src/openieee/v08/%.vhdl: $(LIBSRC_DIR)/openieee/v08/%.vhdl +$(LIBDST_DIR)/src/upf/%.vhdl: $(LIBSRC_DIR)/upf/%.vhdl $(CP) $< $@ + ANALYZE_IEEE08=$(ANALYZE08) -P../.. --work=ieee ANALYZE_VITAL08=$(ANALYZE08) -P../.. --work=ieee -frelaxed-rules diff --git a/libraries/openieee/upf-body.vhdl b/libraries/openieee/upf-body.vhdl deleted file mode 100644 index 039299bfc..000000000 --- a/libraries/openieee/upf-body.vhdl +++ /dev/null @@ -1,26 +0,0 @@ -package body upf is - - function supply_on ( - constant supply_name : string; - constant voltage : real) - return boolean is - begin - return true; - end supply_on; - - function supply_partial_on ( - constant supply_name : string; - constant voltage : real) - return boolean is - begin - return true; - end supply_partial_on; - - function supply_off ( - constant supply_name : string) - return boolean is - begin - return true; - end supply_off; - -end upf; diff --git a/libraries/openieee/upf.vhdl b/libraries/openieee/upf.vhdl deleted file mode 100644 index 974798331..000000000 --- a/libraries/openieee/upf.vhdl +++ /dev/null @@ -1,19 +0,0 @@ --- modelled according to IEEE Std 1801-2015, 11.2 - -package upf is - - function supply_on ( - constant supply_name : string; - constant voltage : real) - return boolean; - - function supply_partial_on ( - constant supply_name : string; - constant voltage : real) - return boolean; - - function supply_off ( - constant supply_name : string) - return boolean; - -end upf; diff --git a/libraries/upf/upf-body.vhdl b/libraries/upf/upf-body.vhdl new file mode 100644 index 000000000..039299bfc --- /dev/null +++ b/libraries/upf/upf-body.vhdl @@ -0,0 +1,26 @@ +package body upf is + + function supply_on ( + constant supply_name : string; + constant voltage : real) + return boolean is + begin + return true; + end supply_on; + + function supply_partial_on ( + constant supply_name : string; + constant voltage : real) + return boolean is + begin + return true; + end supply_partial_on; + + function supply_off ( + constant supply_name : string) + return boolean is + begin + return true; + end supply_off; + +end upf; diff --git a/libraries/upf/upf.vhdl b/libraries/upf/upf.vhdl new file mode 100644 index 000000000..974798331 --- /dev/null +++ b/libraries/upf/upf.vhdl @@ -0,0 +1,19 @@ +-- modelled according to IEEE Std 1801-2015, 11.2 + +package upf is + + function supply_on ( + constant supply_name : string; + constant voltage : real) + return boolean; + + function supply_partial_on ( + constant supply_name : string; + constant voltage : real) + return boolean; + + function supply_off ( + constant supply_name : string) + return boolean; + +end upf; diff --git a/scripts/ci-run.sh b/scripts/ci-run.sh index cee5d05e2..049cae510 100755 --- a/scripts/ci-run.sh +++ b/scripts/ci-run.sh @@ -88,11 +88,11 @@ ISSYNTH=true for arg in "$@"; do shift case "$arg" in - "--color"|"-color") set -- "$@" "-c";; - "--backend"|"-backend") set -- "$@" "-b";; - "--pkg"|"-pkg") set -- "$@" "-p";; - "--gpl"|"-gpl") set -- "$@" "-g";; - "--no-synth"|"-no-synth") set -- "$@" "-s";; + "--color"|"-color") set -- "$@" "-c";; + "--backend"|"-backend") set -- "$@" "-b";; + "--pkg"|"-pkg") set -- "$@" "-p";; + "--gplcompat"|"-gplcompat") set -- "$@" "-g";; + "--no-synth"|"-no-synth") set -- "$@" "-s";; *) set -- "$@" "$arg" esac done @@ -192,9 +192,9 @@ buildCmdOpts () { BUILD_CMD_OPTS="$ENABLECOLOR -b $DBACK" if [ "x$ISGPL" = "xtrue" ]; then - BUILD_CMD_OPTS="$BUILD_CMD_OPTS --gpl" - PKG_NAME="${PKG_NAME}-gpl" - DEXT="-gpl" + BUILD_CMD_OPTS="$BUILD_CMD_OPTS --gplcompat" + PKG_NAME="${PKG_NAME}-gplcompat" + DEXT="-gplcompat" fi export BUILD_CMD_OPTS="${BUILD_CMD_OPTS} -p $PKG_NAME" @@ -238,6 +238,7 @@ build () { mkdir "$GPLDIR" cp -pdrl $files "$GPLDIR" tar -zcf "${GPLDIR}.tgz" "$GPLDIR" + CONFIG_OPTS+=' --enable-gplcompat' gend fi diff --git a/testsuite/sanity/004all08/testsuite.sh b/testsuite/sanity/004all08/testsuite.sh index 3be90ebc3..81d2961b9 100755 --- a/testsuite/sanity/004all08/testsuite.sh +++ b/testsuite/sanity/004all08/testsuite.sh @@ -1,11 +1,5 @@ #!/bin/sh -if [ "$ISGPL" = "true" ]; then - # std_logic_1164 not available in openieee. - echo "test skipped" - exit 0 -fi - . ../../testenv.sh GHDL_STD_FLAGS="--std=08" -- cgit v1.2.3