From a23c345495bfc7d17dfd788926d3c0441c1baf0e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 18 Mar 2022 07:57:31 +0100 Subject: testsuite/synth: add a test for #2011 --- testsuite/synth/issue2011/tb_testcase.vhdl | 25 +++++++++++++++++++++++++ testsuite/synth/issue2011/testcase.vhdl | 26 ++++++++++++++++++++++++++ testsuite/synth/issue2011/testsuite.sh | 8 ++++++++ 3 files changed, 59 insertions(+) create mode 100644 testsuite/synth/issue2011/tb_testcase.vhdl create mode 100644 testsuite/synth/issue2011/testcase.vhdl create mode 100755 testsuite/synth/issue2011/testsuite.sh (limited to 'testsuite') diff --git a/testsuite/synth/issue2011/tb_testcase.vhdl b/testsuite/synth/issue2011/tb_testcase.vhdl new file mode 100644 index 000000000..38c879450 --- /dev/null +++ b/testsuite/synth/issue2011/tb_testcase.vhdl @@ -0,0 +1,25 @@ +entity tb_testcase is +end tb_testcase; + +library ieee; +use ieee.std_logic_1164.all; + +architecture behav of tb_testcase is + signal sel : std_ulogic_vector(3 downto 0); + signal result : std_ulogic_vector(63 downto 0); +begin + dut: entity work.testcase + port map (sel, result); + + process + begin + sel <= "0000"; + wait for 1 ns; + assert result = x"00000000_00000000"; + + sel <= "1101"; + wait for 1 ns; + assert result = x"ffffffff_00000000"; + wait; + end process; +end behav; diff --git a/testsuite/synth/issue2011/testcase.vhdl b/testsuite/synth/issue2011/testcase.vhdl new file mode 100644 index 000000000..3e4b7995c --- /dev/null +++ b/testsuite/synth/issue2011/testcase.vhdl @@ -0,0 +1,26 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity testcase is + port ( + misc_sel : in std_ulogic_vector(3 downto 0); + result : out std_ulogic_vector(63 downto 0) + ); +end entity testcase; + +architecture behaviour of testcase is +begin + testcase_0: process(all) + variable misc : std_ulogic_vector(63 downto 0); + begin + case misc_sel is + when "1101" => + misc := x"FFFFFFFF00000000"; + --misc := x"FFFFFFFF80000000"; + when others => + misc := x"0000000000000000"; + end case; + result <= misc; + end process; +end architecture behaviour; diff --git a/testsuite/synth/issue2011/testsuite.sh b/testsuite/synth/issue2011/testsuite.sh new file mode 100755 index 000000000..5a1802f70 --- /dev/null +++ b/testsuite/synth/issue2011/testsuite.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +synth_tb testcase + +echo "Test successful" -- cgit v1.2.3