diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-07-30 07:45:43 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-07-30 07:48:09 +0200 |
commit | d6998051266d78c2380fa15c960b334c1d1b9450 (patch) | |
tree | ee901b77d0570450a0eb2716a6202dc83dae54cf /testsuite/synth | |
parent | eb148c31b8c15fd425093200ce6973c880f4fa93 (diff) | |
download | ghdl-d6998051266d78c2380fa15c960b334c1d1b9450.tar.gz ghdl-d6998051266d78c2380fa15c960b334c1d1b9450.tar.bz2 ghdl-d6998051266d78c2380fa15c960b334c1d1b9450.zip |
testsuite/synth: add test for #1413
Diffstat (limited to 'testsuite/synth')
-rw-r--r-- | testsuite/synth/issue1413/fixed_point_example.vhdl | 16 | ||||
-rw-r--r-- | testsuite/synth/issue1413/repro1.vhdl | 15 | ||||
-rwxr-xr-x | testsuite/synth/issue1413/testsuite.sh | 10 |
3 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/synth/issue1413/fixed_point_example.vhdl b/testsuite/synth/issue1413/fixed_point_example.vhdl new file mode 100644 index 000000000..d5dc35601 --- /dev/null +++ b/testsuite/synth/issue1413/fixed_point_example.vhdl @@ -0,0 +1,16 @@ +library ieee; + use ieee.std_logic_1164.all; + use ieee.fixed_pkg.all; + use ieee.fixed_float_types.all; + +entity fixed_point_example is +end fixed_point_example; + +architecture behavioral of fixed_point_example is + constant C_SIGNED_VALUE : sfixed(7 downto 0) := (others => '1'); + constant C_RECIPROCAL_SIGNED_VALUE : sfixed(0 downto -8) := reciprocal(C_SIGNED_VALUE); + + constant C_UNSIGNED_VALUE : ufixed(7 downto 0) := (others => '1'); + constant C_RECIPROCAL_UNSIGNED_VALUE : ufixed(1 downto -7) := reciprocal(C_UNSIGNED_VALUE); +begin +end behavioral; diff --git a/testsuite/synth/issue1413/repro1.vhdl b/testsuite/synth/issue1413/repro1.vhdl new file mode 100644 index 000000000..9f3d3336f --- /dev/null +++ b/testsuite/synth/issue1413/repro1.vhdl @@ -0,0 +1,15 @@ +library ieee; + use ieee.std_logic_1164.all; + use ieee.numeric_Std.all; + +entity repro1 is + port (res : out unsigned(7 downto 0)); +end; + +architecture behav of repro1 is + constant left : unsigned := x"71"; + constant right : unsigned := x"03"; + constant r : unsigned := left / right; +begin + res <= r; +end behav; diff --git a/testsuite/synth/issue1413/testsuite.sh b/testsuite/synth/issue1413/testsuite.sh new file mode 100755 index 000000000..2fce0f56b --- /dev/null +++ b/testsuite/synth/issue1413/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 +synth_analyze repro1 +synth_analyze fixed_point_example +clean + +echo "Test successful" |