diff options
Diffstat (limited to 'testsuite/synth')
-rw-r--r-- | testsuite/synth/issue1081/test.vhdl | 33 | ||||
-rwxr-xr-x | testsuite/synth/issue1081/testsuite.sh | 11 |
2 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/synth/issue1081/test.vhdl b/testsuite/synth/issue1081/test.vhdl new file mode 100644 index 000000000..b946f9f82 --- /dev/null +++ b/testsuite/synth/issue1081/test.vhdl @@ -0,0 +1,33 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity test is + port( + clk: in std_ulogic; + a_in : in std_ulogic_vector(1 downto 0); + b_out : out std_ulogic_vector(2 downto 0) + ); +end test; + +architecture rtl of test is + function test_fn(a: std_ulogic_vector(1 downto 0)) return std_ulogic_vector is + variable n : integer range 0 to 3; + begin + case a is + when "11" => + n := 0; + when "10" => + n:= 1; + when others => + --n := 0; + return "000"; + end case; + return "1" & std_ulogic_vector(to_unsigned(n, 2)); + end; +begin + process(clk) + begin + b_out <= test_fn(a_in); + end process; +end; diff --git a/testsuite/synth/issue1081/testsuite.sh b/testsuite/synth/issue1081/testsuite.sh new file mode 100755 index 000000000..a4c28bcd4 --- /dev/null +++ b/testsuite/synth/issue1081/testsuite.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +. ../../testenv.sh + +for t in test; do + synth $t.vhdl -e $t > syn_$t.vhdl + analyze syn_$t.vhdl + clean +done + +echo "Test successful" |