aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-07-30 19:28:31 +0200
committerTristan Gingold <tgingold@free.fr>2020-07-30 19:28:31 +0200
commit39d5d4ee51c0a655b862f52b9d1edba25bf8eed8 (patch)
treefa6937bf0fbd2bf70bc291d93e6572e59a33f5cd /testsuite
parentc5a1561aaca4e7af5b8cafa40022cafa913cd007 (diff)
downloadghdl-39d5d4ee51c0a655b862f52b9d1edba25bf8eed8.tar.gz
ghdl-39d5d4ee51c0a655b862f52b9d1edba25bf8eed8.tar.bz2
ghdl-39d5d4ee51c0a655b862f52b9d1edba25bf8eed8.zip
testsuite/synth: add a test for #1417
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/issue1417/fixed_point_example.vhdl21
-rwxr-xr-xtestsuite/synth/issue1417/testsuite.sh9
2 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/synth/issue1417/fixed_point_example.vhdl b/testsuite/synth/issue1417/fixed_point_example.vhdl
new file mode 100644
index 000000000..bd64da3a3
--- /dev/null
+++ b/testsuite/synth/issue1417/fixed_point_example.vhdl
@@ -0,0 +1,21 @@
+library ieee;
+ use ieee.std_logic_1164.all;
+ use ieee.fixed_pkg.all;
+ use ieee.fixed_float_types.all;
+
+entity fixed_point_example is
+ port (
+ data_in : in std_logic_vector(7 downto 0)
+ );
+end fixed_point_example;
+
+architecture behavioral of fixed_point_example is
+ signal data_tmp : sfixed(1 downto -3);
+begin
+ data_tmp <= resize(
+ to_sfixed(data_in, 3, -4),
+ data_tmp,
+ fixed_saturate,
+ fixed_round
+ );
+end behavioral;
diff --git a/testsuite/synth/issue1417/testsuite.sh b/testsuite/synth/issue1417/testsuite.sh
new file mode 100755
index 000000000..3690ae8a4
--- /dev/null
+++ b/testsuite/synth/issue1417/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+synth_analyze fixed_point_example
+clean
+
+echo "Test successful"