From d6998051266d78c2380fa15c960b334c1d1b9450 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 30 Jul 2020 07:45:43 +0200 Subject: testsuite/synth: add test for #1413 --- testsuite/synth/issue1413/fixed_point_example.vhdl | 16 ++++++++++++++++ testsuite/synth/issue1413/repro1.vhdl | 15 +++++++++++++++ testsuite/synth/issue1413/testsuite.sh | 10 ++++++++++ 3 files changed, 41 insertions(+) create mode 100644 testsuite/synth/issue1413/fixed_point_example.vhdl create mode 100644 testsuite/synth/issue1413/repro1.vhdl create mode 100755 testsuite/synth/issue1413/testsuite.sh (limited to 'testsuite') 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" -- cgit v1.2.3