From bfad2a487e2e6f6476e9417d70dff73656041883 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 2 Oct 2019 18:38:24 +0200 Subject: testsuite/synth: add a test for previous commit. --- testsuite/synth/asgn01/asgn07.vhdl | 26 +++++++++++++++++++++ testsuite/synth/asgn01/tb_asgn07.vhdl | 43 +++++++++++++++++++++++++++++++++++ testsuite/synth/asgn01/testsuite.sh | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 testsuite/synth/asgn01/asgn07.vhdl create mode 100644 testsuite/synth/asgn01/tb_asgn07.vhdl (limited to 'testsuite/synth') diff --git a/testsuite/synth/asgn01/asgn07.vhdl b/testsuite/synth/asgn01/asgn07.vhdl new file mode 100644 index 000000000..f38fdf925 --- /dev/null +++ b/testsuite/synth/asgn01/asgn07.vhdl @@ -0,0 +1,26 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity asgn07 is + port (clk : std_logic; + s0 : std_logic; + r : out std_logic_vector (65 downto 0)); +end asgn07; + +architecture behav of asgn07 is +begin + process (clk) is + begin + if rising_edge(clk) then + if s0 = '1' then + r (0) <= '1'; + r (64 downto 1) <= x"ffff_eeee_dddd_cccc"; + r (65) <= '1'; + else + r (0) <= '0'; + r (8 downto 5) <= x"7"; + r (65) <= '0'; + end if; + end if; + end process; +end behav; diff --git a/testsuite/synth/asgn01/tb_asgn07.vhdl b/testsuite/synth/asgn01/tb_asgn07.vhdl new file mode 100644 index 000000000..83b19e43e --- /dev/null +++ b/testsuite/synth/asgn01/tb_asgn07.vhdl @@ -0,0 +1,43 @@ +entity tb_asgn07 is +end tb_asgn07; + +library ieee; +use ieee.std_logic_1164.all; + +architecture behav of tb_asgn07 is + signal s0 : std_logic; + signal clk : std_logic; + signal r : std_logic_vector (65 downto 0); +begin + dut: entity work.asgn07 + port map (clk => clk, s0 => s0, r => r); + + process + procedure pulse is + begin + clk <= '0'; + wait for 1 ns; + clk <= '1'; + wait for 1 ns; + end pulse; + begin + s0 <= '0'; + pulse; + assert r (0) = '0' severity failure; + assert r (65) = '0' severity failure; + + s0 <= '1'; + pulse; + assert r (0) = '1' severity failure; + assert r (64 downto 1) = x"ffff_eeee_dddd_cccc" severity failure; + assert r (65) = '1' severity failure; + + s0 <= '0'; + pulse; + assert r (0) = '0' severity failure; + assert r (64 downto 1) = x"ffff_eeee_dddd_cc7c" severity failure; + assert r (65) = '0' severity failure; + + wait; + end process; +end behav; diff --git a/testsuite/synth/asgn01/testsuite.sh b/testsuite/synth/asgn01/testsuite.sh index f9991f800..d45c0c3bd 100755 --- a/testsuite/synth/asgn01/testsuite.sh +++ b/testsuite/synth/asgn01/testsuite.sh @@ -2,7 +2,7 @@ . ../../testenv.sh -for t in asgn01 asgn02 asgn03 asgn04 asgn05 asgn06 arr04; do +for t in asgn01 asgn02 asgn03 asgn04 asgn05 asgn06 asgn07 arr04; do analyze $t.vhdl tb_$t.vhdl elab_simulate tb_$t clean -- cgit v1.2.3