diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-21 16:19:29 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-21 16:19:29 +0200 |
commit | 28e8fd62c58280d96d4733418adc195e6f8db7b0 (patch) | |
tree | b1ac27640b25c3dce1fbcb74282dd6dee1b31046 /testsuite | |
parent | c1a00497e2357f5518c7f89c682dc6f25cd48101 (diff) | |
download | ghdl-28e8fd62c58280d96d4733418adc195e6f8db7b0.tar.gz ghdl-28e8fd62c58280d96d4733418adc195e6f8db7b0.tar.bz2 ghdl-28e8fd62c58280d96d4733418adc195e6f8db7b0.zip |
testsuite/synth: Add testcase for tgingold/ghdlsynth-beta#39
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/synth/issue39/record_test.vhdl (renamed from testsuite/synth/issue39/rec.vhdl) | 0 | ||||
-rw-r--r-- | testsuite/synth/issue39/tb_record_test.vhdl | 65 | ||||
-rwxr-xr-x | testsuite/synth/issue39/testsuite.sh | 2 |
3 files changed, 66 insertions, 1 deletions
diff --git a/testsuite/synth/issue39/rec.vhdl b/testsuite/synth/issue39/record_test.vhdl index b199cfa36..b199cfa36 100644 --- a/testsuite/synth/issue39/rec.vhdl +++ b/testsuite/synth/issue39/record_test.vhdl diff --git a/testsuite/synth/issue39/tb_record_test.vhdl b/testsuite/synth/issue39/tb_record_test.vhdl new file mode 100644 index 000000000..31db03d59 --- /dev/null +++ b/testsuite/synth/issue39/tb_record_test.vhdl @@ -0,0 +1,65 @@ +entity tb_record_test is +end tb_record_test; + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +architecture behav of tb_record_test is + signal clk : std_logic; + signal sl_in : std_logic; + signal slv_in : std_logic_vector(7 downto 0); + signal int_in : integer range 0 to 15; + signal usig_in : unsigned(7 downto 0); + signal sl_out : std_logic; + signal slv_out : std_logic_vector(7 downto 0); + signal int_out : integer range 0 to 15; + signal usig_out : unsigned(7 downto 0); +begin + dut: entity work.record_test + port map ( + clk => clk, + sl_in => sl_in, + slv_in => slv_in, + int_in => int_in, + usig_in => usig_in, + sl_out => sl_out, + slv_out => slv_out, + int_out => int_out, + usig_out => usig_out); + + process + begin + clk <= '0'; + sl_in <= '1'; + slv_in <= x"12"; + int_in <= 13; + usig_in <= x"d5"; + + wait for 1 ns; + clk <= '1'; + wait for 1 ns; + + assert sl_out = '1' severity failure; + assert slv_out = x"12" severity failure; + assert int_out = 13 severity failure; + assert usig_out = x"d5" severity failure; + + sl_in <= '0'; + slv_in <= x"9b"; + int_in <= 3; + usig_in <= x"72"; + + clk <= '0'; + wait for 1 ns; + clk <= '1'; + wait for 1 ns; + + assert sl_out = '0' severity failure; + assert slv_out = x"9b" severity failure; + assert int_out = 3 severity failure; + assert usig_out = x"72" severity failure; + + wait; + end process; +end behav; diff --git a/testsuite/synth/issue39/testsuite.sh b/testsuite/synth/issue39/testsuite.sh index b12533cc8..9bef83a1f 100755 --- a/testsuite/synth/issue39/testsuite.sh +++ b/testsuite/synth/issue39/testsuite.sh @@ -2,7 +2,7 @@ . ../../testenv.sh -for t in rec2; do +for t in record_test rec2; do analyze $t.vhdl tb_$t.vhdl elab_simulate tb_$t clean |