diff options
-rw-r--r-- | libraries/Makefile.inc | 75 | ||||
-rw-r--r-- | libraries/vendors/README.md | 154 | ||||
-rw-r--r-- | libraries/vendors/compile-altera.ps1 | 4 | ||||
-rwxr-xr-x | libraries/vendors/compile-altera.sh | 13 | ||||
-rw-r--r-- | libraries/vendors/compile-lattice.ps1 | 377 | ||||
-rwxr-xr-x | libraries/vendors/compile-lattice.sh | 9 | ||||
-rw-r--r-- | libraries/vendors/shared.psm1 | 2 | ||||
-rw-r--r-- | libraries/vendors/shared.sh | 2 | ||||
-rw-r--r-- | src/ghdldrv/ghdllocal.adb | 6 | ||||
-rw-r--r-- | src/grt/grt-processes.adb | 7 | ||||
-rw-r--r-- | src/grt/grt-vpi.adb | 97 | ||||
-rwxr-xr-x | testsuite/gna/bug028/testsuite.sh | 2 |
12 files changed, 626 insertions, 122 deletions
diff --git a/libraries/Makefile.inc b/libraries/Makefile.inc index 4ce876c9a..7308fa8e5 100644 --- a/libraries/Makefile.inc +++ b/libraries/Makefile.inc @@ -28,12 +28,12 @@ vhdl.libs.all: vhdl.libs.v87 vhdl.libs.v93 vhdl.libs.v08 vhdl.libs.v93: std.v93 ieee.v93 synopsys.v93 mentor.v93 vhdl.libs.v87: std.v87 ieee.v87 synopsys.v87 -vhdl.libs.v08: std.v08 ieee.v08 +vhdl.libs.v08: std.v08 ieee.v08 synopsys.v08 VHDLLIB_SUBDIRS= src/std src/ieee src/vital95 src/vital2000 src/synopsys src/mentor src/ieee2008 \ v87/std v87/ieee v87/synopsys \ v93/std v93/ieee v93/mentor v93/synopsys \ - v08/std v08/ieee v08/std \ + v08/std v08/ieee v08/synopsys \ STD_SRCS := std/textio.vhdl std/textio_body.vhdl IEEE_SRCS := ieee/std_logic_1164.vhdl ieee/std_logic_1164_body.vhdl \ @@ -47,33 +47,34 @@ 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 SYNOPSYS_BSRCS := synopsys/std_logic_arith.vhdl \ - synopsys/std_logic_textio.vhdl synopsys/std_logic_unsigned.vhdl \ - synopsys/std_logic_signed.vhdl \ - synopsys/std_logic_misc.vhdl synopsys/std_logic_misc-body.vhdl + synopsys/std_logic_unsigned.vhdl \ + synopsys/std_logic_signed.vhdl +SYNOPSYS8793_BSRCS := synopsys/std_logic_textio.vhdl synopsys/std_logic_misc.vhdl synopsys/std_logic_misc-body.vhdl MENTOR_BSRCS := mentor/std_logic_arith.vhdl mentor/std_logic_arith_body.vhdl IEEE08_BSRCS := \ -ieee2008/std_logic_1164.vhdl ieee2008/std_logic_1164-body.vhdl \ -ieee2008/std_logic_textio.vhdl \ -ieee2008/math_real.vhdl ieee2008/math_real-body.vhdl \ -ieee2008/math_complex.vhdl ieee2008/math_complex-body.vhdl \ -ieee2008/numeric_bit.vhdl ieee2008/numeric_bit-body.vhdl \ -ieee2008/numeric_bit_unsigned.vhdl ieee2008/numeric_bit_unsigned-body.vhdl \ -ieee2008/numeric_std.vhdl ieee2008/numeric_std-body.vhdl \ -ieee2008/numeric_std_unsigned.vhdl ieee2008/numeric_std_unsigned-body.vhdl \ -ieee2008/fixed_float_types.vhdl \ -ieee2008/fixed_generic_pkg.vhdl ieee2008/fixed_generic_pkg-body.vhdl \ -ieee2008/fixed_pkg.vhdl \ -ieee2008/float_generic_pkg.vhdl ieee2008/float_generic_pkg-body.vhdl \ -ieee2008/float_pkg.vhdl \ -ieee2008/ieee_bit_context.vhdl ieee2008/ieee_std_context.vhdl + ieee2008/std_logic_1164.vhdl ieee2008/std_logic_1164-body.vhdl \ + ieee2008/std_logic_textio.vhdl \ + ieee2008/math_real.vhdl ieee2008/math_real-body.vhdl \ + ieee2008/math_complex.vhdl ieee2008/math_complex-body.vhdl \ + ieee2008/numeric_bit.vhdl ieee2008/numeric_bit-body.vhdl \ + ieee2008/numeric_bit_unsigned.vhdl ieee2008/numeric_bit_unsigned-body.vhdl \ + ieee2008/numeric_std.vhdl ieee2008/numeric_std-body.vhdl \ + ieee2008/numeric_std_unsigned.vhdl ieee2008/numeric_std_unsigned-body.vhdl \ + ieee2008/fixed_float_types.vhdl \ + ieee2008/fixed_generic_pkg.vhdl ieee2008/fixed_generic_pkg-body.vhdl \ + ieee2008/fixed_pkg.vhdl \ + ieee2008/float_generic_pkg.vhdl ieee2008/float_generic_pkg-body.vhdl \ + ieee2008/float_pkg.vhdl \ + ieee2008/ieee_bit_context.vhdl ieee2008/ieee_std_context.vhdl STD87_BSRCS := $(STD_SRCS:.vhdl=.v87) STD93_BSRCS := $(STD_SRCS:.vhdl=.v93) STD08_BSRCS := $(STD_SRCS:.vhdl=.v08) std/env.vhdl std/env_body.vhdl IEEE87_BSRCS := $(IEEE_SRCS:.vhdl=.v87) IEEE93_BSRCS := $(IEEE_SRCS:.vhdl=.v93) $(MATH_SRCS) -SYNOPSYS87_BSRCS := $(SYNOPSYS_BSRCS) -SYNOPSYS93_BSRCS := $(SYNOPSYS_BSRCS) +SYNOPSYS87_BSRCS := $(SYNOPSYS_BSRCS) $(SYNOPSYS8793_BSRCS) +SYNOPSYS93_BSRCS := $(SYNOPSYS_BSRCS) $(SYNOPSYS8793_BSRCS) +SYNOPSYS08_BSRCS := $(SYNOPSYS_BSRCS) MENTOR93_BSRCS := $(MENTOR_BSRCS) .PREFIXES: .vhdl .v93 .v87 .v08 @@ -100,6 +101,7 @@ MENTOR93_DIR:=$(LIB93_DIR)/mentor LIB08_DIR:=$(LIBDST_DIR)/v08 STD08_DIR:=$(LIB08_DIR)/std IEEE08_DIR:=$(LIB08_DIR)/ieee +SYN08_DIR:=$(LIB08_DIR)/synopsys ANALYZE87:=$(ANALYZE) --std=87 ANALYZE93:=$(ANALYZE) --std=93 @@ -112,7 +114,9 @@ STD08_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(STD08_BSRCS)) IEEE93_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(IEEE93_BSRCS)) IEEE87_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(IEEE87_BSRCS)) IEEE08_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(IEEE08_BSRCS)) -SYNOPSYS_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(SYNOPSYS_BSRCS)) +SYNOPSYS87_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(SYNOPSYS87_BSRCS)) +SYNOPSYS93_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(SYNOPSYS93_BSRCS)) +SYNOPSYS08_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(SYNOPSYS08_BSRCS)) MENTOR93_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(MENTOR93_BSRCS)) VITAL95_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(VITAL95_BSRCS)) VITAL2000_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(VITAL2000_BSRCS)) @@ -156,7 +160,7 @@ ieee.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(IEEE87_SRCS) $(VITAL95_SRCS) std.v87 for $(LIBDST_DIR)/src/synopsys/%.vhdl: $(LIBSRC_DIR)/synopsys/%.vhdl $(LIBDST_DIR)/src/synopsys $(CP) $< $@ -synopsys.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(SYNOPSYS_SRCS) ieee.v87 force +synopsys.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(SYNOPSYS87_SRCS) ieee.v87 force $(RM) -rf $(SYN87_DIR) mkdir $(SYN87_DIR) cd $(SYN87_DIR); \ @@ -210,7 +214,7 @@ ieee.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(IEEE93_SRCS) $(VITAL2000_SRCS) std.v93 f echo $$cmd; eval $$cmd || exit 1; \ done -synopsys.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(SYNOPSYS_SRCS) ieee.v93 force +synopsys.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(SYNOPSYS93_SRCS) ieee.v93 force $(RM) -rf $(SYN93_DIR) mkdir $(SYN93_DIR) cd $(SYN93_DIR); \ @@ -271,13 +275,34 @@ $(LIBDST_DIR)/src/ieee2008/%.vhdl: $(LIBSRC_DIR)/ieee2008/%.vhdl $(LIBDST_DIR)/s $(CP) $< $@ ANALYZE_IEEE08=$(ANALYZE08) -P../std --work=ieee +ANALYZE_VITAL08=$(ANALYZE08) -P../std --work=ieee -frelaxed-rules ieee.v08: $(ANALYZE_DEP) $(LIB08_DIR) $(IEEE08_SRCS) std.v08 force $(RM) -rf $(IEEE08_DIR) mkdir $(IEEE08_DIR) -# FIXME: add VITAL2000 ? cd $(IEEE08_DIR); \ for i in $(IEEE08_BSRCS); do \ cmd="$(ANALYZE_IEEE08) ../../src/$$i"; \ echo $$cmd; eval $$cmd || exit 1; \ + done; \ + for i in $(VITAL2000_BSRCS); do \ + cmd="$(ANALYZE_VITAL08) ../../src/$$i"; \ + echo $$cmd; eval $$cmd || exit 1; \ + done + +synopsys.v08: $(ANALYZE_DEP) $(LIB08_DIR) $(SYNOPSYS08_SRCS) ieee.v08 force + $(RM) -rf $(SYN08_DIR) + mkdir $(SYN08_DIR) + cd $(SYN08_DIR); \ + $(CP) ../ieee/ieee-obj08.cf .; \ + test x$(VHDLLIBS_COPY_OBJS) = "xno" || \ + for i in $(IEEE_SRCS) $(MATH_SRCS) $(VITAL2000_SRCS); do \ + b=`basename $$i .vhdl`; \ + if [ -f ../ieee/$$b.o ]; then \ + $(LN) ../ieee/$$b.o $$b.o || exit 1; \ + fi; \ + done; \ + for i in $(SYNOPSYS08_BSRCS); do \ + cmd="$(ANALYZE_IEEE08) ../../src/$$i"; \ + echo $$cmd; eval $$cmd || exit 1; \ done diff --git a/libraries/vendors/README.md b/libraries/vendors/README.md index 31e455a4c..d39b2d9ee 100644 --- a/libraries/vendors/README.md +++ b/libraries/vendors/README.md @@ -1,14 +1,14 @@ ## Compile Scripts for Vendor VHDL Libraries -Vendors like Altera and Xilinx have there own simulation libraries, especially -for primitives, soft or hard macros. These libraries can not be shipped with -GHDL, but we offer prepared compile scripts to pre-compile a vendor library, -if the vendor tool is present on the computer. +Vendors like Altera, Lattice and Xilinx have their own simulation libraries, +especially for FPGA primitives, soft and hard macros. These libraries can not be +shipped with GHDL, but we offer prepared compile scripts to pre-compile the +vendor libraries, if the vendor tool is present on the computer. There are also popular simulation and verification libraries like [OSVVM][osvvm] -and [VUnit][vunit], which can be pre-compile. +and [VUnit][vunit], which can be pre-compile, too. -The compilation scripts are writen in shell languages: PowerShell for Windows +The compilation scripts are writen in the shell languages: PowerShell for Windows and Bash for Linux. The compile scripts can colorize the GHDL warning and error lines with the help of grc/grcat ([generic colourizer][grc]). @@ -52,84 +52,91 @@ lines with the help of grc/grcat ([generic colourizer][grc]). - vunit_lib --------------------------------------------------------------------- -### Compiling on Linux +### Script Configuration - - **Step 1 - Configure the scripts** - Please open the `config.sh` file and set the dictionary entries for the installed - vendor tools to the appropriate directory to your tool's installation folder. +The vendor library compile scripts need to know where the used / latest vendor +tool chain is installed. Therefore, the script implement a default installation +directory search as well as environment variable checks. If a vendor tool could +not be detected or the script choses the wrong vendor library source directory, +then it's possible to provide the path via `--source` or `-Source`. - `config.sh`: - ```Bash - declare -A InstallationDirectory - InstallationDirectory[AlteraQuartusII]="/opt/Altera/15.0" - InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7" - InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2015.2" - InstallationDirectory[OSVVM]="/home/<user>/git/GitHub/osvvm" - InstallationDirectory[VUnit]="/home/<user>/git/GitHub/vunit" - ``` +The generated output is stored relative to the current working directory. The +scripts create a sub-directory for each vendor. The default output directory can +be overwritten by the parameter `--output` or `-Output`. + +To compile all source files with GHDL, the simulator executable is searched in +`PATH`. The found default GHDL executable can be overwritten by setting the +environment variable `GHDL` or by passing the parameter `--ghdl` or `-GHDL` to +the scripts. + +If the vendor library compilation is used very often, we recommend to configure +these parameters in `config.sh` or `config.psm1`, so the command line can be +shortened to the essential parts. + +--------------------------------------------------------------------- +### Compiling on Linux - - **Step 2 - Browse to your simulation working directory** + - **Step 0 - Configure the scripts (optional)** + See next section for how to configure `config.sh`. + + - **Step 1 - Browse to your simulation working directory** ```Bash $ cd <MySimulationFolder> ``` - - **Step 3 - Start the compilation script(s)** + - **Step 2 - Start the compilation script(s)** ```Bash - $ <GHDL>\libraries\vendors\compile-altera.sh --all - $ <GHDL>\libraries\vendors\compile-xilinx-ise.sh --all - $ <GHDL>\libraries\vendors\compile-xilinx-vivado.sh --all - $ <GHDL>\libraries\vendors\compile-osvvm.sh --all - $ <GHDL>\libraries\vendors\compile-vunit.sh --all + $ /usr/local/lib/ghdl/vendors/compile-altera.sh --all + $ /usr/local/lib/ghdl/vendors/compile-lattice.sh --all + $ /usr/local/lib/ghdl/vendors/compile-xilinx-ise.sh --all + $ /usr/local/lib/ghdl/vendors/compile-xilinx-vivado.sh --all + $ /usr/local/lib/ghdl/vendors/compile-osvvm.sh --all + $ /usr/local/lib/ghdl/vendors/compile-vunit.sh --all ``` + + In most cases GHDL is installed into `/usr/local/`. The scripts are + installed into the `lib` directory. - - **Step 4 - Viewing the result** - This creates vendor directories in your current working directory and compiles the vendor files into them. + - **Step 3 - Viewing the result** + This creates vendor directories in your current working directory and + compiles the vendor files into them. ```Bash $ ls -ahl ... drwxr-xr-x 2 <user> <group> 56K Nov 30 17:41 altera + drwxr-xr-x 2 <user> <group> 56K Nov 30 17:42 lattice drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 osvvm - drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 vivado drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 vunit - drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 xilinx + drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 xilinx-ise + drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 xilinx-vivado ``` + --------------------------------------------------------------------- ### Compiling on Windows - - **Step 1 - Configure the scripts** - Please open the `config.psm1` file and set the dictionary entries for the installed - vendor tools to the appropriate directory to your tool's installation folder. Use an - empty string `""` for not installed tools. - - `config.psm1`: - ```PowerShell - $InstallationDirectory = @{ - "AlteraQuartusII" = "C:\Altera\15.0"; - "XilinxISE" = "C:\Xilinx\14.7"; - "XilinxVivado" = "C:\Xilinx\Vivado\2015.4"; - "OSVVM" = "D:\git\GitHub\osvvm"; - "VUnit" = "D:\git\GitHub\vunit" - } - ``` + - **Step 0 - Configure the scripts (optional)** + See next section for how to configure `config.psm1`. - - **Step 2 - Browse to your simulation working directory** + - **Step 1 - Browse to your simulation working directory** ```PowerShell PS> cd <MySimulationFolder> ``` - - **Step 3 - Start the compilation script(s)** + - **Step 2 - Start the compilation script(s)** ```PowerShell PS> <GHDL>\libraries\vendors\compile-altera.ps1 -All + PS> <GHDL>\libraries\vendors\compile-lattice.ps1 -All PS> <GHDL>\libraries\vendors\compile-xilinx-ise.ps1 -All PS> <GHDL>\libraries\vendors\compile-xilinx-vivado.ps1 -All PS> <GHDL>\libraries\vendors\compile-osvvm.ps1 -All PS> <GHDL>\libraries\vendors\compile-vunit.ps1 -All ``` - - **Step 4 - Viewing the result** - This creates vendor directories in your current working directory and compiles the vendor files into them. + - **Step 3 - Viewing the result** + This creates vendor directories in your current working directory and + compiles the vendor files into them. ```PowerShell PS> dir @@ -138,21 +145,60 @@ lines with the help of grc/grcat ([generic colourizer][grc]). Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 20.11.2015 19:33 <DIR> altera + d---- 20.11.2015 19:38 <DIR> lattice d---- 20.11.2015 19:38 <DIR> osvvm d---- 20.11.2015 19:45 <DIR> vunit_lib d---- 20.11.2015 19:06 <DIR> xilinx-ise d---- 20.11.2015 19:40 <DIR> xilinx-vivado ``` +--------------------------------------------------------------------- +### Configuration Files + +#### For Linux: `config.sh` + +Please open the `config.sh` file and set the dictionary entries for the +installed vendor tools to the appropriate directory to your tool's installation +directories. Use an empty string `""` for not installed tools. + +`config.sh`: +```Bash +declare -A InstallationDirectory +InstallationDirectory[AlteraQuartus]="/opt/Altera/15.0" +InstallationDirectory[LatticeDiamond]="/opt/Diamond/3.7_x64" +InstallationDirectory[OSVVM]="/home/<user>/git/GitHub/osvvm" +InstallationDirectory[VUnit]="/home/<user>/git/GitHub/vunit" +InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7" +InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2015.2" +``` + +#### For Windows: `config.psm1` + +Please open the `config.psm1` file and set the dictionary entries for the +installed vendor tools to the appropriate directory to your tool's installation +folder. Use an empty string `""` for not installed tools. + +`config.psm1`: +```PowerShell +$InstallationDirectory = @{ + "AlteraQuartus" = "C:\Altera\16.0"; + "LatticeDiamond" = "C:\Lattice\Diamond\3.7_x64"; + "XilinxISE" = "C:\Xilinx\14.7\ISE_DS"; + "XilinxVivado" = "C:\Xilinx\Vivado\2016.2"; + "OSVVM" = "D:\git\GitHub\osvvm"; + "VUnit" = "D:\git\GitHub\vunit" +} +``` + ### Selectable Options for the Bash Scripts: *First I should translate the scripts before writing the docu...* - - Common parameters to all scripts: + - Common parameters to most scripts: -h --help Print the embedded help page(s). -c --clean Cleanup directory before analyzing. - -n --no-warnings Don't show warnings. Report errors only. + -n --no-warnings Don't show warnings. Report errors only. -s --skip-existing Skip already compiled files (an *.o file exists). -S --skip-largefiles Don't compile large entities like DSP and PCIe primitives. -H --halt-on-error Stop compiling if an error occured. @@ -196,10 +242,12 @@ lines with the help of grc/grcat ([generic colourizer][grc]). Selectable libraries: -a --all Compile all. + --osvvm Compile the OSVVM library. - `compile-vunit.sh` Selectable libraries: -a --all Compile all. + --osvvm Compile the VUnit library. ### Selectable Options for the PowerShell Scripts: @@ -248,10 +296,12 @@ lines with the help of grc/grcat ([generic colourizer][grc]). Selectable libraries: -All Compile all. + -OSVVM Compile the OSVVM library. - `compile-vunit.ps1` Selectable libraries: -All Compile all. + -VUnit Compile the VUnit library. ------------------------ -Author: Patrick Lehmann (30.11.2015) +Author: Patrick Lehmann (22.06.2016) diff --git a/libraries/vendors/compile-altera.ps1 b/libraries/vendors/compile-altera.ps1 index 2f703e527..e4275e622 100644 --- a/libraries/vendors/compile-altera.ps1 +++ b/libraries/vendors/compile-altera.ps1 @@ -12,7 +12,7 @@ # ------------------------------------ # This is a PowerShell script (executable) which: # - creates a subdirectory in the current working directory -# - compiles all Altera Quartus-II simulation libraries and packages +# - compiles all Altera Quartus simulation libraries and packages # # ============================================================================== # Copyright (C) 2015-2016 Patrick Lehmann @@ -39,7 +39,7 @@ # .DESCRIPTION # This CmdLet: # (1) creates a subdirectory in the current working directory -# (2) compiles all Altera Quartus-II simulation libraries and packages +# (2) compiles all Altera Quartus simulation libraries and packages # o Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim # o Altera device libraries: # - arriaii, arriaii_pcie_hip, arriaiigz diff --git a/libraries/vendors/compile-altera.sh b/libraries/vendors/compile-altera.sh index e943dac3a..d6830abc6 100755 --- a/libraries/vendors/compile-altera.sh +++ b/libraries/vendors/compile-altera.sh @@ -113,10 +113,6 @@ while [[ $# > 0 ]]; do ;; --vhdl2008) VHDLStandard=2008 - echo 1>&2 -e "${COLORED_ERROR} VHDL-2008 is not yet supported by Altera.${ANSI_NOCOLOR}" - echo 1>&2 -e "${ANSI_YELLOW}Possible workaround: ${ANSI_NOCOLOR}" - echo 1>&2 -e "${ANSI_YELLOW} Compile 'std_logic_arith' and 'std_logic_unsigned' into library IEEE.${ANSI_NOCOLOR}" - exit -1 ;; --ghdl) GHDLBinDir="$2" @@ -193,6 +189,11 @@ if [ "$COMPILE_ALL" == "TRUE" ]; then COMPILE_NM=TRUE fi +if [ $VHDLStandard -eq 2008 ]; then + echo -e "${ANSI_RED}Not all Altera packages are VHDL-2008 compatible! Setting HALT_ON_ERROR to FALSE.${ANSI_NOCOLOR}" + HALT_ON_ERROR=0 +fi + DefaultDirectories=("/opt/Altera" "/opt/altera") if [ ! -z $QUARTUS_ROOTDIR ]; then EnvSourceDir=$QUARTUS_ROOTDIR/${SourceDirectories[AlteraQuartus]} @@ -660,7 +661,7 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_STRATIX" == "TRUE" ] && [ $SKIP_LARGE fi # compile fiftyfivenm library -if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NANOMETER" == "TRUE" ]; then +if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NM" == "TRUE" ]; then Library="fiftyfivenm" Files=( fiftyfivenm_atoms.vhd @@ -676,7 +677,7 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NANOMETER" == "TRUE" ]; then fi # compile twentynm library -if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NANOMETER" == "TRUE" ]; then +if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NM" == "TRUE" ]; then Library="twentynm" Files=( twentynm_atoms.vhd diff --git a/libraries/vendors/compile-lattice.ps1 b/libraries/vendors/compile-lattice.ps1 new file mode 100644 index 000000000..462685018 --- /dev/null +++ b/libraries/vendors/compile-lattice.ps1 @@ -0,0 +1,377 @@ +# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*- +# vim: tabstop=2:shiftwidth=2:noexpandtab +# kate: tab-width 2; replace-tabs off; indent-width 2; +# +# ============================================================================== +# Authors: Patrick Lehmann +# +# PowerShell Script: Script to compile the simulation libraries from Lattice +# Diamond for GHDL on Windows +# +# Description: +# ------------------------------------ +# This is a PowerShell script (executable) which: +# - creates a subdirectory in the current working directory +# - compiles all Lattice Diamond simulation libraries and packages +# +# ============================================================================== +# Copyright (C) 2015-2016 Patrick Lehmann +# +# GHDL is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2, or (at your option) any later +# version. +# +# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with GHDL; see the file COPYING. If not, write to the Free +# Software Foundation, 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ============================================================================== + +# .SYNOPSIS +# This CmdLet compiles the simulation libraries from Lattice. +# +# .DESCRIPTION +# This CmdLet: +# (1) creates a subdirectory in the current working directory +# (2) compiles all Lattice Diamond simulation libraries and packages +# o Lattice device libraries: +# - EC, ECP, ECP2, ECP3, ECP5U +# - LPTM, LPTM2 +# - MachXO, MachXO2, MachXO3L +# - SC, SCM +# - XP, XP2 +# +[CmdletBinding()] +param( + # Show the embedded help page(s) + [switch]$Help = $false, + + # Compile all libraries and packages. + [switch]$All = $false, + + # Compile the Lattice EC device libraries + [switch]$ec = $false, + # Compile the Lattice ECP device libraries + [switch]$ecp = $false, + # Compile the Lattice ECP2 device libraries + [switch]$ecp2 = $false, + # Compile the Lattice ECP3 device libraries + [switch]$ecp3 = $false, + # Compile the Lattice ECP5U device libraries + [switch]$ecp5u = $false, + + # Compile the Lattice LPTM device libraries + [switch]$lptm = $false, + # Compile the Lattice LPTM2 device libraries + [switch]$lptm2 = $false, + + # Compile the Lattice MachXO device libraries + [switch]$MachXO = $false, + # Compile the Lattice MachXO2 device libraries + [switch]$MachXO2 = $false, + # Compile the Lattice MachXO3L device libraries + [switch]$MachXO3L = $false, + + # Compile the Lattice SC device libraries + [switch]$sc = $false, + # Compile the Lattice SCM device libraries + [switch]$scm = $false, + + # Compile the Lattice XP device libraries + [switch]$xp = $false, + # Compile the Lattice XP2 device libraries + [switch]$xp2 = $false, + + # Clean up directory before analyzing. + [switch]$Clean = $false, + + # Set VHDL Standard to '93 + [switch]$VHDL93 = $false, + # Set VHDL Standard to '08 + [switch]$VHDL2008 = $false, + + # Skip warning messages. (Show errors only.) + [switch]$SuppressWarnings = $false, + # Halt on errors + [switch]$HaltOnError = $false, + + # Set vendor library source directory + [string]$Source = "", + # Set output directory name + [string]$Output = "", + # Set GHDL executable + [string]$GHDL = "" +) + +# --------------------------------------------- +# save working directory +$WorkingDir = Get-Location + +# load modules from GHDL's 'vendors' library directory +Import-Module $PSScriptRoot\config.psm1 -ArgumentList "LatticeDiamond" +Import-Module $PSScriptRoot\shared.psm1 -ArgumentList @("Lattice Diamond", "$WorkingDir") + +# Display help if no command was selected +$Help = $Help -or (-not ($All -or + ($ec -or $ecp -or $ecp2 -or $ecp3 -or $ecp5u) -or + ($lptm -or $lptm2) -or + ($MachXO -or $MachXO2 -or $MachXO3L) -or + ($sc -or $scm) -or + ($xp -or $xp2) + )) + +if ($Help) +{ Get-Help $MYINVOCATION.InvocationName -Detailed + Exit-CompileScript +} +if ($All) +{ $ec = $true + $ecp = $true + $ecp2 = $true + $ecp3 = $true + $ecp5u = $true + $lptm = $true + $lptm2 = $true + $MachXO = $true + $MachXO2 = $true + $MachXO3L = $true + $sc = $true + $scm = $true + $xp = $true + $xp2 = $true +} + +function Get-LatticeDiamondDirectory +{ if (Test-Path env:FOUNDRY) + { return $FOUNDRY + "\..\" + (Get-VendorToolSourceDirectory) } + else + { $EnvSourceDir = "" + foreach ($Drive in Get-DriveInfo) + { $Path = $Drive.Name + "Lattice\Diamond" + if (Test-Path $Path -PathType Container) + { foreach ($Major in 4..3) + { foreach ($Minor in 9..0) + { $Dir = $Path + "\" + $Major + "." + $Minor + "_x64" + if (Test-Path $Dir -PathType Container) + { $EnvSourceDir = $Dir + "\" + (Get-VendorToolSourceDirectory) + return $EnvSourceDir + } + } + } + } + } + } +} + +$SourceDirectory = Get-SourceDirectory $Source (Get-LatticeDiamondDirectory) +$DestinationDirectory = Get-DestinationDirectory $Output +$GHDLBinary = Get-GHDLBinary $GHDL + +# create "Lattice" directory and change to it +New-DestinationDirectory $DestinationDirectory +cd $DestinationDirectory + +$VHDLVersion,$VHDLStandard,$VHDLFlavor = Get-VHDLVariables $VHDL93 $VHDL2008 + +# define global GHDL Options +$GHDLOptions = @("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--ieee=$VHDLFlavor", "--no-vital-checks", "--std=$VHDLStandard", "-P$DestinationDirectory") + +$StopCompiling = $false +$ErrorCount = 0 + +$FileLists = @{ + "ec" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_LUT.vhd", "ORCA_MISC.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd"); + "ecp" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_LUT.vhd", "ORCA_MISC.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd"); + "ecp2" = @("ECP2_CMB.vhd", "ECP2_SEQ.vhd", "ECP2COMP.vhd", "ECP2_CNT.vhd", "ECP2_IO.vhd", "ECP2_LUT.vhd", "ECP2_MEM.vhd", "ECP2_MISC.vhd", "ECP2_MULT.vhd", "ECP2_SL.vhd"); + "ecp3" = @("ECP3_CMB.vhd", "ECP3_SEQ.vhd", "ECP3COMP.vhd", "ECP3_CNT.vhd", "ECP3_IO.vhd", "ECP3_LUT.vhd", "ECP3_MEM.vhd", "ECP3_MISC.vhd", "ECP3_MULT.vhd", "ECP3_SL.vhd"); + "ecp5u" = @("ECP5U_CMB.vhd", "ECP5U_SEQ.vhd", "ECP5UCOMP.vhd", "ECP5U_IO.vhd", "ECP5U_LUT.vhd", "ECP5U_MEM.vhd", "ECP5U_MISC.vhd", "ECP5U_SL.vhd", "gsr_pur_assign.vhd"); + "lptm" = @("MACHXO_CMB.vhd", "MACHXO_SEQ.vhd", "MACHXOCOMP.vhd", "MACHXO_CNT.vhd", "MACHXO_IO.vhd", "MACHXO_LUT.vhd", "MACHXO_MEM.vhd", "MACHXO_MISC.vhd"); + "lptm2" = @("MACHXO2_CMB.vhd", "MACHXO2_SEQ.vhd", "MACHXO2COMP.vhd", "gsr_pur_assign.vhd", "MACHXO2_CNT.vhd", "MACHXO2_IO.vhd", "MACHXO2_LUT.vhd", "MACHXO2_MEM.vhd", "MACHXO2_MISC.vhd"); + "machxo" = @("MACHXO_CMB.vhd", "MACHXO_SEQ.vhd", "MACHXOCOMP.vhd", "MACHXO_CNT.vhd", "MACHXO_IO.vhd", "MACHXO_LUT.vhd", "MACHXO_MEM.vhd", "MACHXO_MISC.vhd"); + "machxo2" = @("MACHXO2_CMB.vhd", "MACHXO2_SEQ.vhd", "MACHXO2COMP.vhd", "MACHXO2_CNT.vhd", "gsr_pur_assign.vhd", "MACHXO2_IO.vhd", "MACHXO2_LUT.vhd", "MACHXO2_MEM.vhd", "MACHXO2_MISC.vhd"); + "machxo3l" = @("MACHXO3L_CMB.vhd", "MACHXO3L_SEQ.vhd", "MACHXO3LCOMP.vhd", "gsr_pur_assign.vhd", "MACHXO3L_CNT.vhd", "MACHXO3L_IO.vhd", "MACHXO3L_LUT.vhd", "MACHXO3L_MEM.vhd", "MACHXO3L_MISC.vhd"); + "sc" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd", "ORCA_MIS.vhd", "ORCA_SL.vhd"); + "scm" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd", "ORCA_MIS.vhd", "ORCA_SL.vhd"); + "xp" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_LUT.vhd", "ORCA_MISC.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd"); + "xp2" = @("XP2_CMB.vhd", "XP2_SEQ.vhd", "XP2COMP.vhd", "XP2_CNT.vhd", "XP2_IO.vhd", "XP2_LUT.vhd", "XP2_MEM.vhd", "XP2_MISC.vhd", "XP2_MULT.vhd", "XP2_SL.vhd") +} + +# Cleanup directories +# ============================================================================== +if ($Clean) +{ Write-Host "[ERROR]: '-Clean' is not implemented!" + Exit-CompileScript -1 + + Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow + rm *.cf +} + + +# Lattice EC library +# ============================================================================== +if ((-not $StopCompiling) -and $ec) +{ $Library = "ec" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice ECP library +# ============================================================================== +if ((-not $StopCompiling) -and $ecp) +{ $Library = "ecp" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice ECP2 library +# ============================================================================== +if ((-not $StopCompiling) -and $ecp2) +{ $Library = "ecp2" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice ECP3 library +# ============================================================================== +if ((-not $StopCompiling) -and $ecp3) +{ $Library = "ecp3" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice ECP5U library +# ============================================================================== +if ((-not $StopCompiling) -and $ecp5u) +{ $Library = "ecp5u" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice LPTM library +# ============================================================================== +if ((-not $StopCompiling) -and $lptm) +{ $Library = "lptm" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice LPTM2 library +# ============================================================================== +if ((-not $StopCompiling) -and $lptm2) +{ $Library = "lptm2" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice MachXO library +# ============================================================================== +if ((-not $StopCompiling) -and $MachXO) +{ $Library = "MachXO" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice MachXO2 library +# ============================================================================== +if ((-not $StopCompiling) -and $MachXO2) +{ $Library = "MachXO2" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice MachXO3L library +# ============================================================================== +if ((-not $StopCompiling) -and $machxo3l) +{ $Library = "machxo3l" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice SC library +# ============================================================================== +if ((-not $StopCompiling) -and $sc) +{ $Library = "sc" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice SCM library +# ============================================================================== +if ((-not $StopCompiling) -and $scm) +{ $Library = "scm" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice XP library +# ============================================================================== +if ((-not $StopCompiling) -and $xp) +{ $Library = "xp" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +# Lattice XP2 library +# ============================================================================== +if ((-not $StopCompiling) -and $xp2) +{ $Library = "xp2" + $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } + + $ErrorCount += 0 + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + +Write-Host "--------------------------------------------------------------------------------" +Write-Host "Compiling Lattice libraries " -NoNewline +if ($ErrorCount -gt 0) +{ Write-Host "[FAILED]" -ForegroundColor Red } +else +{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green } + +Exit-CompileScript diff --git a/libraries/vendors/compile-lattice.sh b/libraries/vendors/compile-lattice.sh index 57d7f883a..8e64b1898 100755 --- a/libraries/vendors/compile-lattice.sh +++ b/libraries/vendors/compile-lattice.sh @@ -93,10 +93,6 @@ while [[ $# > 0 ]]; do ;; --vhdl2008) VHDLStandard=2008 - echo 1>&2 -e "${COLORED_ERROR} VHDL-2008 is not yet supported by Lattice.${ANSI_NOCOLOR}" - # echo 1>&2 -e "${ANSI_YELLOW}Possible workaround: ${ANSI_NOCOLOR}" - # echo 1>&2 -e "${ANSI_YELLOW} Compile 'std_logic_arith' and 'std_logic_unsigned' into library IEEE.${ANSI_NOCOLOR}" - exit -1 ;; --ghdl) GHDLBinDir="$2" @@ -177,6 +173,11 @@ else done fi +if [ $VHDLStandard -eq 2008 ]; then + echo -e "${ANSI_RED}Not all Lattice packages are VHDL-2008 compatible! Setting HALT_ON_ERROR to FALSE.${ANSI_NOCOLOR}" + HALT_ON_ERROR=0 +fi + # -> $SourceDirectories # -> $DestinationDirectories # -> $SrcDir diff --git a/libraries/vendors/shared.psm1 b/libraries/vendors/shared.psm1 index d3b93c43e..52dd206da 100644 --- a/libraries/vendors/shared.psm1 +++ b/libraries/vendors/shared.psm1 @@ -14,7 +14,7 @@ # output streams (stdout and stderr). # # ============================================================================== -# Copyright (C) 2015 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann # # GHDL is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free diff --git a/libraries/vendors/shared.sh b/libraries/vendors/shared.sh index 0193223e5..689e78964 100644 --- a/libraries/vendors/shared.sh +++ b/libraries/vendors/shared.sh @@ -143,7 +143,7 @@ GHDLSetup() { elif [ $VHDLStandard -eq 2008 ]; then VHDLVersion="v08" VHDLStandard="08" - VHDLFlavor="standard" + VHDLFlavor="synopsys" fi } diff --git a/src/ghdldrv/ghdllocal.adb b/src/ghdldrv/ghdllocal.adb index a28c44bee..fbffb5f1d 100644 --- a/src/ghdldrv/ghdllocal.adb +++ b/src/ghdldrv/ghdllocal.adb @@ -442,11 +442,7 @@ package body Ghdllocal is when Lib_Standard => Add_Library_Path ("ieee"); when Lib_Synopsys => - if Vhdl_Std >= Vhdl_08 then - Warning ("--ieee=synopsys is ignored for --std=08"); - else - Add_Library_Path ("synopsys"); - end if; + Add_Library_Path ("synopsys"); when Lib_Mentor => if Vhdl_Std >= Vhdl_08 then Warning ("--ieee=mentor is ignored for --std=08"); diff --git a/src/grt/grt-processes.adb b/src/grt/grt-processes.adb index 91e56b6ca..67b7a88a5 100644 --- a/src/grt/grt-processes.adb +++ b/src/grt/grt-processes.adb @@ -842,6 +842,13 @@ package body Grt.Processes is -- of step f of the simulation cycle, below. Next_Time := Compute_Next_Time; if Next_Time /= 0 then + if Has_Callbacks (Hooks.Cb_Last_Known_Delta) then + Call_Callbacks (Hooks.Cb_Last_Known_Delta); + Flush_Active_Chain; + Next_Time := Compute_Next_Time; + end if; + end if; + if Next_Time /= 0 then Update_Active_Chain; end if; diff --git a/src/grt/grt-vpi.adb b/src/grt/grt-vpi.adb index 1a2af50d7..d7a62330f 100644 --- a/src/grt/grt-vpi.adb +++ b/src/grt/grt-vpi.adb @@ -132,13 +132,6 @@ package body Grt.Vpi is -- Clear error status. procedure Reset_Error; - procedure Vpi_Trace (Msg : String) is - begin - if Flag_Trace then - Put_Line (Trace_File, Msg); - end if; - end Vpi_Trace; - procedure Trace_Start (Msg : String) is begin for I in 1 .. Trace_Indent loop @@ -214,11 +207,53 @@ package body Grt.Vpi is when vpiRightRange => Trace ("vpiRightRange"); + when vpiStop => + Trace ("vpiStop"); + when vpiFinish => + Trace ("vpiFinish"); + when vpiReset => + Trace ("vpiReset"); + when others => Trace (V); end case; end Trace_Property; + procedure Trace_Format (F : Integer) is + begin + case F is + when vpiBinStrVal => + Trace ("BinStr"); + when vpiOctStrVal => + Trace ("OctStr"); + when vpiDecStrVal => + Trace ("DecStr"); + when vpiHexStrVal => + Trace ("HexStr"); + when vpiScalarVal => + Trace ("Scalar"); + when vpiIntVal => + Trace ("Int"); + when vpiRealVal => + Trace ("Real"); + when vpiStringVal => + Trace ("String"); + when vpiVectorVal => + Trace ("Vector"); + when vpiStrengthVal => + Trace ("Strength"); + when vpiTimeVal => + Trace ("Time"); + when vpiObjTypeVal => + Trace ("ObjType"); + when vpiSuppressVal => + Trace ("Suppress"); + + when others => + Trace (F); + end case; + end Trace_Format; + procedure Trace_Time_Tag (V : Integer) is begin case V is @@ -797,7 +832,7 @@ package body Grt.Vpi is Trace_Start ("vpi_get_value ("); Trace (Expr); Trace (", {format="); - Trace (Value.Format); + Trace_Format (Value.Format); Trace ("}) = "); end if; @@ -1131,7 +1166,21 @@ package body Grt.Vpi is Res : Integer; pragma Unreferenced (Res); begin + if Flag_Trace then + Trace_Start ("vpi call callback "); + Trace_Cb_Reason (Hand.Cb.Reason); + Trace (" "); + Trace (Hand); + Trace_Newline; + Trace_Indent := Trace_Indent + 1; + end if; Res := Hand.Cb.Cb_Rtn (Hand.Cb'Access); + if Flag_Trace then + Trace_Indent := Trace_Indent - 1; + Trace_Start ("vpi end callback "); + Trace (Hand); + Trace_Newline; + end if; end Execute_Callback; procedure Execute_Callback_List (List : Callback_List) @@ -1158,25 +1207,12 @@ package body Grt.Vpi is function To_vpiHandle is new Ada.Unchecked_Conversion (System.Address, vpiHandle); + -- Wrapper procedure Call_Callback (Arg : System.Address) is Hand : constant vpiHandle := To_vpiHandle (Arg); begin - if Flag_Trace then - Trace_Start ("vpi call callback "); - Trace_Cb_Reason (Hand.Cb.Reason); - Trace (" "); - Trace (Hand); - Trace_Newline; - Trace_Indent := Trace_Indent + 1; - end if; Execute_Callback (Hand); - if Flag_Trace then - Trace_Indent := Trace_Indent - 1; - Trace_Start ("vpi end callback "); - Trace (Hand); - Trace_Newline; - end if; end Call_Callback; procedure Call_Valuechange_Callback (Arg : System.Address) @@ -1291,7 +1327,10 @@ package body Grt.Vpi is -- int vpi_get_vlog_info(p_vpi_vlog_info vlog_info_p) function vpi_get_vlog_info (info : p_vpi_vlog_info) return integer is begin - Vpi_Trace ("vpi_get_vlog_info"); + if Flag_Trace then + Trace_Start ("vpi_get_vlog_info"); + Trace_Newline; + end if; info.all := (Argc => 0, Argv => Null_Address, @@ -1307,6 +1346,11 @@ package body Grt.Vpi is pragma Unreferenced (aRef); pragma Unreferenced (aIndex); begin + if Flag_Trace then + Trace_Start ("vpi_handle_by_index UNIMPLEMENTED!"); + Trace_Newline; + end if; + return null; end vpi_handle_by_index; @@ -1475,7 +1519,10 @@ package body Grt.Vpi is is pragma Unreferenced (aSs); begin - Vpi_Trace ("vpi_register_systf"); + if Flag_Trace then + Trace_Start ("vpi_register_systf"); + Trace_Newline; + end if; end vpi_register_systf; -- int vpi_remove_cb(vpiHandle ref) @@ -1566,7 +1613,7 @@ package body Grt.Vpi is begin if Flag_Trace then Trace_Start ("vpi_control ("); - Trace (Op); + Trace_Property (Op); Trace (", "); Trace (Status); Trace (")"); diff --git a/testsuite/gna/bug028/testsuite.sh b/testsuite/gna/bug028/testsuite.sh index 2567fba26..6eb89c3d0 100755 --- a/testsuite/gna/bug028/testsuite.sh +++ b/testsuite/gna/bug028/testsuite.sh @@ -3,7 +3,7 @@ . ../../testenv.sh GHDL_STD_FLAGS=--std=08 -GHDL_FLAGS=--ieee=synopsys +GHDL_FLAGS=--ieee=mentor analyze simple.vhdl 2>&1 | grep ignored clean |