diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-03-26 12:46:08 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-03-26 12:46:08 +0100 |
commit | 60d7fa83b5e3a0da1ba4d5a7900a83bd1548b1ce (patch) | |
tree | 92ea5482f583d1727d0497f0d22aaa46c1167ea2 /testsuite | |
parent | f4379fb9e41384f15a339e3c9d8485d36687ccc4 (diff) | |
download | ghdl-60d7fa83b5e3a0da1ba4d5a7900a83bd1548b1ce.tar.gz ghdl-60d7fa83b5e3a0da1ba4d5a7900a83bd1548b1ce.tar.bz2 ghdl-60d7fa83b5e3a0da1ba4d5a7900a83bd1548b1ce.zip |
testsuite/synth: add a test for previous commit.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/synth/asgn01/asgn09.vhdl | 18 | ||||
-rw-r--r-- | testsuite/synth/asgn01/tb_asgn09.vhdl | 40 | ||||
-rwxr-xr-x | testsuite/synth/asgn01/testsuite.sh | 12 |
3 files changed, 61 insertions, 9 deletions
diff --git a/testsuite/synth/asgn01/asgn09.vhdl b/testsuite/synth/asgn01/asgn09.vhdl new file mode 100644 index 000000000..3a947ecc1 --- /dev/null +++ b/testsuite/synth/asgn01/asgn09.vhdl @@ -0,0 +1,18 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity asgn09 is + port (a, b, c, d : std_logic_vector (1 downto 0); + sel : std_logic_vector(1 downto 0); + o : out std_logic_vector (3 downto 0)); +end asgn09; + +architecture behav of asgn09 is +begin + with sel select + o (1 downto 0) <= a when "00", + b when "01", + c when "10", + d when others; + o(3 downto 2) <= a or b; +end behav; diff --git a/testsuite/synth/asgn01/tb_asgn09.vhdl b/testsuite/synth/asgn01/tb_asgn09.vhdl new file mode 100644 index 000000000..156e50666 --- /dev/null +++ b/testsuite/synth/asgn01/tb_asgn09.vhdl @@ -0,0 +1,40 @@ +entity tb_asgn09 is +end tb_asgn09; + +library ieee; +use ieee.std_logic_1164.all; + +architecture behav of tb_asgn09 is + signal a, b, c, d : std_logic_vector (1 downto 0); + signal sel : std_logic_vector(1 downto 0); + signal o : std_logic_vector (3 downto 0); +begin + dut: entity work.asgn09 + port map (a, b, c, d, sel, o); + + process + begin + a <= "10"; + b <= "01"; + c <= "00"; + d <= "11"; + + sel <= "00"; + wait for 1 ns; + assert o = "1110" severity failure; + + sel <= "01"; + wait for 1 ns; + assert o = "1101" severity failure; + + sel <= "10"; + wait for 1 ns; + assert o = "1100" severity failure; + + sel <= "11"; + wait for 1 ns; + assert o = "1111" severity failure; + + wait; + end process; +end behav; diff --git a/testsuite/synth/asgn01/testsuite.sh b/testsuite/synth/asgn01/testsuite.sh index ad298ced7..dc82fd270 100755 --- a/testsuite/synth/asgn01/testsuite.sh +++ b/testsuite/synth/asgn01/testsuite.sh @@ -2,15 +2,9 @@ . ../../testenv.sh -for t in asgn01 asgn02 asgn03 asgn04 asgn05 asgn06 asgn07 asgn08 arr04; do - analyze $t.vhdl tb_$t.vhdl - elab_simulate tb_$t - clean - - synth $t.vhdl -e $t > syn_$t.vhdl - analyze syn_$t.vhdl tb_$t.vhdl - elab_simulate tb_$t - clean +for t in asgn01 asgn02 asgn03 asgn04 asgn05 asgn06 asgn07 asgn08 \ + arr04 asgn09; do + synth_tb $t done echo "Test successful" |