diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-02 18:38:24 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-02 18:38:24 +0200 |
commit | bfad2a487e2e6f6476e9417d70dff73656041883 (patch) | |
tree | fa158658cb2d35ab588dfe0b2aa99e00ce99712f /testsuite/synth | |
parent | 8b212a75204bd4bc6cc7cca583377fdf86651f2a (diff) | |
download | ghdl-bfad2a487e2e6f6476e9417d70dff73656041883.tar.gz ghdl-bfad2a487e2e6f6476e9417d70dff73656041883.tar.bz2 ghdl-bfad2a487e2e6f6476e9417d70dff73656041883.zip |
testsuite/synth: add a test for previous commit.
Diffstat (limited to 'testsuite/synth')
-rw-r--r-- | testsuite/synth/asgn01/asgn07.vhdl | 26 | ||||
-rw-r--r-- | testsuite/synth/asgn01/tb_asgn07.vhdl | 43 | ||||
-rwxr-xr-x | testsuite/synth/asgn01/testsuite.sh | 2 |
3 files changed, 70 insertions, 1 deletions
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 |